types.d.ts 407 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520
  1. /*
  2. * This file was automatically generated.
  3. * DO NOT MODIFY BY HAND.
  4. * Run `yarn special-lint-fix` to update
  5. */
  6. import { Buffer } from "buffer";
  7. import { Scope } from "eslint-scope";
  8. import {
  9. ArrayExpression,
  10. ArrayPattern,
  11. ArrowFunctionExpression,
  12. AssignmentExpression,
  13. AssignmentPattern,
  14. AssignmentProperty,
  15. AwaitExpression,
  16. BaseNode,
  17. BigIntLiteral,
  18. BinaryExpression,
  19. BlockStatement,
  20. BreakStatement,
  21. CatchClause,
  22. ChainExpression,
  23. ClassBody,
  24. ClassDeclaration,
  25. ClassExpression,
  26. Comment,
  27. ConditionalExpression,
  28. ContinueStatement,
  29. DebuggerStatement,
  30. Directive,
  31. DoWhileStatement,
  32. EmptyStatement,
  33. ExportAllDeclaration as ExportAllDeclarationImport,
  34. ExportDefaultDeclaration,
  35. ExportNamedDeclaration as ExportNamedDeclarationImport,
  36. ExportSpecifier,
  37. ExpressionStatement,
  38. ForInStatement,
  39. ForOfStatement,
  40. ForStatement,
  41. FunctionDeclaration,
  42. FunctionExpression,
  43. Identifier,
  44. IfStatement,
  45. ImportDeclaration as ImportDeclarationImport,
  46. ImportDefaultSpecifier,
  47. ImportExpression as ImportExpressionImport,
  48. ImportNamespaceSpecifier,
  49. ImportSpecifier,
  50. LabeledStatement,
  51. LogicalExpression,
  52. MemberExpression,
  53. MetaProperty,
  54. MethodDefinition,
  55. NewExpression,
  56. ObjectExpression,
  57. ObjectPattern,
  58. PrivateIdentifier,
  59. Program,
  60. Property,
  61. PropertyDefinition,
  62. RegExpLiteral,
  63. RestElement,
  64. ReturnStatement,
  65. SequenceExpression,
  66. SimpleCallExpression,
  67. SimpleLiteral,
  68. SpreadElement,
  69. StaticBlock,
  70. Super,
  71. SwitchCase,
  72. SwitchStatement,
  73. TaggedTemplateExpression,
  74. TemplateElement,
  75. TemplateLiteral,
  76. ThisExpression,
  77. ThrowStatement,
  78. TryStatement,
  79. UnaryExpression,
  80. UpdateExpression,
  81. VariableDeclaration,
  82. VariableDeclarator,
  83. WhileStatement,
  84. WithStatement,
  85. YieldExpression
  86. } from "estree";
  87. import {
  88. IncomingMessage,
  89. ServerOptions as ServerOptionsImport,
  90. ServerResponse
  91. } from "http";
  92. import { ListenOptions, Server } from "net";
  93. import { validate as validateFunction } from "schema-utils";
  94. import { default as ValidationError } from "schema-utils/declarations/ValidationError";
  95. import { ValidationErrorConfiguration } from "schema-utils/declarations/validate";
  96. import {
  97. AsArray,
  98. AsyncParallelHook,
  99. AsyncSeriesBailHook,
  100. AsyncSeriesHook,
  101. AsyncSeriesWaterfallHook,
  102. HookMap,
  103. IfSet,
  104. MultiHook,
  105. SyncBailHook,
  106. SyncHook,
  107. SyncWaterfallHook,
  108. TapOptions
  109. } from "tapable";
  110. import { SecureContextOptions, TlsOptions } from "tls";
  111. import { URL } from "url";
  112. import { Context } from "vm";
  113. declare interface Abortable {
  114. /**
  115. * When provided the corresponding `AbortController` can be used to cancel an asynchronous action.
  116. */
  117. signal?: AbortSignal;
  118. }
  119. declare class AbstractLibraryPlugin<T> {
  120. constructor(__0: {
  121. /**
  122. * name of the plugin
  123. */
  124. pluginName: string;
  125. /**
  126. * used library type
  127. */
  128. type: string;
  129. });
  130. /**
  131. * Apply the plugin
  132. */
  133. apply(compiler: Compiler): void;
  134. parseOptions(library: LibraryOptions): false | T;
  135. finishEntryModule(
  136. module: Module,
  137. entryName: string,
  138. libraryContext: LibraryContext<T>
  139. ): void;
  140. embedInRuntimeBailout(
  141. module: Module,
  142. renderContext: RenderContextJavascriptModulesPlugin,
  143. libraryContext: LibraryContext<T>
  144. ): undefined | string;
  145. strictRuntimeBailout(
  146. renderContext: RenderContextJavascriptModulesPlugin,
  147. libraryContext: LibraryContext<T>
  148. ): undefined | string;
  149. runtimeRequirements(
  150. chunk: Chunk,
  151. set: Set<string>,
  152. libraryContext: LibraryContext<T>
  153. ): void;
  154. render(
  155. source: Source,
  156. renderContext: RenderContextJavascriptModulesPlugin,
  157. libraryContext: LibraryContext<T>
  158. ): Source;
  159. renderStartup(
  160. source: Source,
  161. module: Module,
  162. renderContext: StartupRenderContext,
  163. libraryContext: LibraryContext<T>
  164. ): Source;
  165. chunkHash(
  166. chunk: Chunk,
  167. hash: Hash,
  168. chunkHashContext: ChunkHashContext,
  169. libraryContext: LibraryContext<T>
  170. ): void;
  171. static COMMON_LIBRARY_NAME_MESSAGE: string;
  172. }
  173. declare interface AdditionalData {
  174. [index: string]: any;
  175. webpackAST: object;
  176. }
  177. declare class AggressiveMergingPlugin {
  178. constructor(options?: AggressiveMergingPluginOptions);
  179. options: AggressiveMergingPluginOptions;
  180. /**
  181. * Apply the plugin
  182. */
  183. apply(compiler: Compiler): void;
  184. }
  185. declare interface AggressiveMergingPluginOptions {
  186. /**
  187. * minimal size reduction to trigger merging
  188. */
  189. minSizeReduce?: number;
  190. }
  191. declare class AggressiveSplittingPlugin {
  192. constructor(options?: AggressiveSplittingPluginOptions);
  193. options: AggressiveSplittingPluginOptions;
  194. /**
  195. * Apply the plugin
  196. */
  197. apply(compiler: Compiler): void;
  198. static wasChunkRecorded(chunk: Chunk): boolean;
  199. }
  200. declare interface AggressiveSplittingPluginOptions {
  201. /**
  202. * Extra cost for each chunk (Default: 9.8kiB).
  203. */
  204. chunkOverhead?: number;
  205. /**
  206. * Extra cost multiplicator for entry chunks (Default: 10).
  207. */
  208. entryChunkMultiplicator?: number;
  209. /**
  210. * Byte, max size of per file (Default: 50kiB).
  211. */
  212. maxSize?: number;
  213. /**
  214. * Byte, split point. (Default: 30kiB).
  215. */
  216. minSize?: number;
  217. }
  218. type Algorithm = string | typeof Hash;
  219. type Alias = string | false | string[];
  220. declare interface AliasOption {
  221. alias: Alias;
  222. name: string;
  223. onlyModule?: boolean;
  224. }
  225. type AliasOptionNewRequest = string | false | string[];
  226. declare interface AliasOptions {
  227. [index: string]: AliasOptionNewRequest;
  228. }
  229. declare interface Argument {
  230. description?: string;
  231. simpleType: SimpleType;
  232. multiple: boolean;
  233. configs: ArgumentConfig[];
  234. }
  235. declare interface ArgumentConfig {
  236. description?: string;
  237. negatedDescription?: string;
  238. path: string;
  239. multiple: boolean;
  240. type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
  241. values?: any[];
  242. }
  243. type ArrayBufferLike = ArrayBuffer | SharedArrayBuffer;
  244. type ArrayBufferView =
  245. | Uint8Array<ArrayBufferLike>
  246. | Uint8ClampedArray<ArrayBufferLike>
  247. | Uint16Array<ArrayBufferLike>
  248. | Uint32Array<ArrayBufferLike>
  249. | Int8Array<ArrayBufferLike>
  250. | Int16Array<ArrayBufferLike>
  251. | Int32Array<ArrayBufferLike>
  252. | BigUint64Array<ArrayBufferLike>
  253. | BigInt64Array<ArrayBufferLike>
  254. | Float32Array<ArrayBufferLike>
  255. | Float64Array<ArrayBufferLike>
  256. | DataView<ArrayBufferLike>;
  257. declare interface Asset {
  258. /**
  259. * the filename of the asset
  260. */
  261. name: string;
  262. /**
  263. * source of the asset
  264. */
  265. source: Source;
  266. /**
  267. * info about the asset
  268. */
  269. info: AssetInfo;
  270. }
  271. declare interface AssetDependencyMeta {
  272. sourceType: "css-url";
  273. }
  274. declare interface AssetEmittedInfo {
  275. content: Buffer;
  276. source: Source;
  277. compilation: Compilation;
  278. outputPath: string;
  279. targetPath: string;
  280. }
  281. type AssetFilterItemTypes =
  282. | string
  283. | RegExp
  284. | ((name: string, asset: StatsAsset) => boolean);
  285. /**
  286. * Options object for data url generation.
  287. */
  288. declare interface AssetGeneratorDataUrlOptions {
  289. /**
  290. * Asset encoding (defaults to base64).
  291. */
  292. encoding?: false | "base64";
  293. /**
  294. * Asset mimetype (getting from file extension by default).
  295. */
  296. mimetype?: string;
  297. }
  298. type AssetGeneratorOptions = AssetInlineGeneratorOptions &
  299. AssetResourceGeneratorOptions;
  300. type AssetInfo = KnownAssetInfo & Record<string, any>;
  301. /**
  302. * Generator options for asset/inline modules.
  303. */
  304. declare interface AssetInlineGeneratorOptions {
  305. /**
  306. * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
  307. */
  308. binary?: boolean;
  309. /**
  310. * The options for data url generator.
  311. */
  312. dataUrl?:
  313. | AssetGeneratorDataUrlOptions
  314. | ((
  315. source: string | Buffer,
  316. context: { filename: string; module: Module }
  317. ) => string);
  318. }
  319. /**
  320. * Options object for DataUrl condition.
  321. */
  322. declare interface AssetParserDataUrlOptions {
  323. /**
  324. * Maximum size of asset that should be inline as modules. Default: 8kb.
  325. */
  326. maxSize?: number;
  327. }
  328. /**
  329. * Parser options for asset modules.
  330. */
  331. declare interface AssetParserOptions {
  332. /**
  333. * The condition for inlining the asset as DataUrl.
  334. */
  335. dataUrlCondition?:
  336. | AssetParserDataUrlOptions
  337. | ((
  338. source: string | Buffer,
  339. context: { filename: string; module: Module }
  340. ) => boolean);
  341. }
  342. /**
  343. * Generator options for asset/resource modules.
  344. */
  345. declare interface AssetResourceGeneratorOptions {
  346. /**
  347. * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
  348. */
  349. binary?: boolean;
  350. /**
  351. * Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.
  352. */
  353. emit?: boolean;
  354. /**
  355. * 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.
  356. */
  357. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  358. /**
  359. * 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.
  360. */
  361. outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  362. /**
  363. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  364. */
  365. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  366. }
  367. declare class AsyncDependenciesBlock extends DependenciesBlock {
  368. constructor(
  369. groupOptions:
  370. | null
  371. | (RawChunkGroupOptions & { name?: null | string } & {
  372. entryOptions?: EntryOptions;
  373. }),
  374. loc?: null | SyntheticDependencyLocation | RealDependencyLocation,
  375. request?: null | string
  376. );
  377. groupOptions: RawChunkGroupOptions & { name?: null | string } & {
  378. entryOptions?: EntryOptions;
  379. };
  380. loc?: null | SyntheticDependencyLocation | RealDependencyLocation;
  381. request?: null | string;
  382. chunkName?: null | string;
  383. module: any;
  384. }
  385. declare abstract class AsyncQueue<T, K, R> {
  386. hooks: {
  387. beforeAdd: AsyncSeriesHook<[T]>;
  388. added: SyncHook<[T]>;
  389. beforeStart: AsyncSeriesHook<[T]>;
  390. started: SyncHook<[T]>;
  391. result: SyncHook<
  392. [T, undefined | null | WebpackError, undefined | null | R]
  393. >;
  394. };
  395. getContext(): string;
  396. setContext(value: string): void;
  397. add(item: T, callback: CallbackAsyncQueue<R>): void;
  398. invalidate(item: T): void;
  399. /**
  400. * Waits for an already started item
  401. */
  402. waitFor(item: T, callback: CallbackAsyncQueue<R>): void;
  403. stop(): void;
  404. increaseParallelism(): void;
  405. decreaseParallelism(): void;
  406. isProcessing(item: T): boolean;
  407. isQueued(item: T): boolean;
  408. isDone(item: T): boolean;
  409. clear(): void;
  410. }
  411. declare class AsyncWebAssemblyModulesPlugin {
  412. constructor(options: AsyncWebAssemblyModulesPluginOptions);
  413. options: AsyncWebAssemblyModulesPluginOptions;
  414. /**
  415. * Apply the plugin
  416. */
  417. apply(compiler: Compiler): void;
  418. renderModule(
  419. module: Module,
  420. renderContext: WebAssemblyRenderContext,
  421. hooks: CompilationHooksAsyncWebAssemblyModulesPlugin
  422. ): Source;
  423. static getCompilationHooks(
  424. compilation: Compilation
  425. ): CompilationHooksAsyncWebAssemblyModulesPlugin;
  426. }
  427. declare interface AsyncWebAssemblyModulesPluginOptions {
  428. /**
  429. * mangle imports
  430. */
  431. mangleImports?: boolean;
  432. }
  433. declare class AutomaticPrefetchPlugin {
  434. constructor();
  435. /**
  436. * Apply the plugin
  437. */
  438. apply(compiler: Compiler): void;
  439. }
  440. type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
  441. declare interface BackendApi {
  442. dispose: (arg0: (arg0?: null | Error) => void) => void;
  443. module: (arg0: Module) => ModuleResult;
  444. }
  445. declare class BannerPlugin {
  446. constructor(options: BannerPluginArgument);
  447. options: BannerPluginOptions;
  448. banner: (data: { hash?: string; chunk: Chunk; filename: string }) => string;
  449. /**
  450. * Apply the plugin
  451. */
  452. apply(compiler: Compiler): void;
  453. }
  454. type BannerPluginArgument =
  455. | string
  456. | BannerPluginOptions
  457. | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
  458. declare interface BannerPluginOptions {
  459. /**
  460. * Specifies the banner.
  461. */
  462. banner:
  463. | string
  464. | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
  465. /**
  466. * If true, the banner will only be added to the entry chunks.
  467. */
  468. entryOnly?: boolean;
  469. /**
  470. * Exclude all modules matching any of these conditions.
  471. */
  472. exclude?: string | RegExp | Rule[];
  473. /**
  474. * If true, banner will be placed at the end of the output.
  475. */
  476. footer?: boolean;
  477. /**
  478. * Include all modules matching any of these conditions.
  479. */
  480. include?: string | RegExp | Rule[];
  481. /**
  482. * If true, banner will not be wrapped in a comment.
  483. */
  484. raw?: boolean;
  485. /**
  486. * Specifies the stage when add a banner.
  487. */
  488. stage?: number;
  489. /**
  490. * Include all modules that pass test assertion.
  491. */
  492. test?: string | RegExp | Rule[];
  493. }
  494. declare interface BaseResolveRequest {
  495. path: string | false;
  496. context?: object;
  497. descriptionFilePath?: string;
  498. descriptionFileRoot?: string;
  499. descriptionFileData?: JsonObjectTypes;
  500. relativePath?: string;
  501. ignoreSymlinks?: boolean;
  502. fullySpecified?: boolean;
  503. __innerRequest?: string;
  504. __innerRequest_request?: string;
  505. __innerRequest_relativePath?: string;
  506. }
  507. declare abstract class BasicEvaluatedExpression {
  508. type: number;
  509. range?: [number, number];
  510. falsy: boolean;
  511. truthy: boolean;
  512. nullish?: boolean;
  513. sideEffects: boolean;
  514. bool?: boolean;
  515. number?: number;
  516. bigint?: bigint;
  517. regExp?: RegExp;
  518. string?: string;
  519. quasis?: BasicEvaluatedExpression[];
  520. parts?: BasicEvaluatedExpression[];
  521. array?: any[];
  522. items?: BasicEvaluatedExpression[];
  523. options?: BasicEvaluatedExpression[];
  524. prefix?: null | BasicEvaluatedExpression;
  525. postfix?: null | BasicEvaluatedExpression;
  526. wrappedInnerExpressions?: BasicEvaluatedExpression[];
  527. identifier?: string | VariableInfoInterface;
  528. rootInfo?: string | VariableInfoInterface;
  529. getMembers?: () => string[];
  530. getMembersOptionals?: () => boolean[];
  531. getMemberRanges?: () => [number, number][];
  532. expression?:
  533. | Program
  534. | ImportDeclarationImport
  535. | ExportNamedDeclarationImport
  536. | ExportAllDeclarationImport
  537. | ImportExpressionImport
  538. | UnaryExpression
  539. | ArrayExpression
  540. | ArrowFunctionExpression
  541. | AssignmentExpression
  542. | AwaitExpression
  543. | BinaryExpression
  544. | SimpleCallExpression
  545. | NewExpression
  546. | ChainExpression
  547. | ClassExpression
  548. | ConditionalExpression
  549. | FunctionExpression
  550. | Identifier
  551. | SimpleLiteral
  552. | RegExpLiteral
  553. | BigIntLiteral
  554. | LogicalExpression
  555. | MemberExpression
  556. | MetaProperty
  557. | ObjectExpression
  558. | SequenceExpression
  559. | TaggedTemplateExpression
  560. | TemplateLiteral
  561. | ThisExpression
  562. | UpdateExpression
  563. | YieldExpression
  564. | SpreadElement
  565. | PrivateIdentifier
  566. | FunctionDeclaration
  567. | VariableDeclaration
  568. | ClassDeclaration
  569. | ExpressionStatement
  570. | BlockStatement
  571. | StaticBlock
  572. | EmptyStatement
  573. | DebuggerStatement
  574. | WithStatement
  575. | ReturnStatement
  576. | LabeledStatement
  577. | BreakStatement
  578. | ContinueStatement
  579. | IfStatement
  580. | SwitchStatement
  581. | ThrowStatement
  582. | TryStatement
  583. | WhileStatement
  584. | DoWhileStatement
  585. | ForStatement
  586. | ForInStatement
  587. | ForOfStatement
  588. | ExportDefaultDeclaration
  589. | MethodDefinition
  590. | PropertyDefinition
  591. | VariableDeclarator
  592. | SwitchCase
  593. | CatchClause
  594. | ObjectPattern
  595. | ArrayPattern
  596. | RestElement
  597. | AssignmentPattern
  598. | Property
  599. | Super
  600. | AssignmentProperty
  601. | ClassBody
  602. | ImportSpecifier
  603. | ImportDefaultSpecifier
  604. | ImportNamespaceSpecifier
  605. | ExportSpecifier
  606. | TemplateElement;
  607. isUnknown(): boolean;
  608. isNull(): boolean;
  609. isUndefined(): boolean;
  610. isString(): boolean;
  611. isNumber(): boolean;
  612. isBigInt(): boolean;
  613. isBoolean(): boolean;
  614. isRegExp(): boolean;
  615. isConditional(): boolean;
  616. isArray(): boolean;
  617. isConstArray(): boolean;
  618. isIdentifier(): boolean;
  619. isWrapped(): boolean;
  620. isTemplateString(): boolean;
  621. /**
  622. * Is expression a primitive or an object type value?
  623. */
  624. isPrimitiveType(): undefined | boolean;
  625. /**
  626. * Is expression a runtime or compile-time value?
  627. */
  628. isCompileTimeValue(): boolean;
  629. /**
  630. * Gets the compile-time value of the expression
  631. */
  632. asCompileTimeValue(): any;
  633. isTruthy(): boolean;
  634. isFalsy(): boolean;
  635. isNullish(): undefined | boolean;
  636. /**
  637. * Can this expression have side effects?
  638. */
  639. couldHaveSideEffects(): boolean;
  640. /**
  641. * Creates a boolean representation of this evaluated expression.
  642. */
  643. asBool(): undefined | boolean;
  644. /**
  645. * Creates a nullish coalescing representation of this evaluated expression.
  646. */
  647. asNullish(): undefined | boolean;
  648. /**
  649. * Creates a string representation of this evaluated expression.
  650. */
  651. asString(): undefined | string;
  652. setString(string: string): BasicEvaluatedExpression;
  653. setUndefined(): BasicEvaluatedExpression;
  654. setNull(): BasicEvaluatedExpression;
  655. /**
  656. * Set's the value of this expression to a number
  657. */
  658. setNumber(number: number): BasicEvaluatedExpression;
  659. /**
  660. * Set's the value of this expression to a BigInt
  661. */
  662. setBigInt(bigint: bigint): BasicEvaluatedExpression;
  663. /**
  664. * Set's the value of this expression to a boolean
  665. */
  666. setBoolean(bool: boolean): BasicEvaluatedExpression;
  667. /**
  668. * Set's the value of this expression to a regular expression
  669. */
  670. setRegExp(regExp: RegExp): BasicEvaluatedExpression;
  671. /**
  672. * Set's the value of this expression to a particular identifier and its members.
  673. */
  674. setIdentifier(
  675. identifier: string | VariableInfoInterface,
  676. rootInfo: string | VariableInfoInterface,
  677. getMembers: () => string[],
  678. getMembersOptionals?: () => boolean[],
  679. getMemberRanges?: () => [number, number][]
  680. ): BasicEvaluatedExpression;
  681. /**
  682. * Wraps an array of expressions with a prefix and postfix expression.
  683. */
  684. setWrapped(
  685. prefix?: null | BasicEvaluatedExpression,
  686. postfix?: null | BasicEvaluatedExpression,
  687. innerExpressions?: BasicEvaluatedExpression[]
  688. ): BasicEvaluatedExpression;
  689. /**
  690. * Stores the options of a conditional expression.
  691. */
  692. setOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  693. /**
  694. * Adds options to a conditional expression.
  695. */
  696. addOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  697. /**
  698. * Set's the value of this expression to an array of expressions.
  699. */
  700. setItems(items: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  701. /**
  702. * Set's the value of this expression to an array of strings.
  703. */
  704. setArray(array: string[]): BasicEvaluatedExpression;
  705. /**
  706. * Set's the value of this expression to a processed/unprocessed template string. Used
  707. * for evaluating TemplateLiteral expressions in the JavaScript Parser.
  708. */
  709. setTemplateString(
  710. quasis: BasicEvaluatedExpression[],
  711. parts: BasicEvaluatedExpression[],
  712. kind: "raw" | "cooked"
  713. ): BasicEvaluatedExpression;
  714. templateStringKind?: "raw" | "cooked";
  715. setTruthy(): BasicEvaluatedExpression;
  716. setFalsy(): BasicEvaluatedExpression;
  717. /**
  718. * Set's the value of the expression to nullish.
  719. */
  720. setNullish(value: boolean): BasicEvaluatedExpression;
  721. /**
  722. * Set's the range for the expression.
  723. */
  724. setRange(range: [number, number]): BasicEvaluatedExpression;
  725. /**
  726. * Set whether or not the expression has side effects.
  727. */
  728. setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression;
  729. /**
  730. * Set the expression node for the expression.
  731. */
  732. setExpression(
  733. expression?:
  734. | Program
  735. | ImportDeclarationImport
  736. | ExportNamedDeclarationImport
  737. | ExportAllDeclarationImport
  738. | ImportExpressionImport
  739. | UnaryExpression
  740. | ArrayExpression
  741. | ArrowFunctionExpression
  742. | AssignmentExpression
  743. | AwaitExpression
  744. | BinaryExpression
  745. | SimpleCallExpression
  746. | NewExpression
  747. | ChainExpression
  748. | ClassExpression
  749. | ConditionalExpression
  750. | FunctionExpression
  751. | Identifier
  752. | SimpleLiteral
  753. | RegExpLiteral
  754. | BigIntLiteral
  755. | LogicalExpression
  756. | MemberExpression
  757. | MetaProperty
  758. | ObjectExpression
  759. | SequenceExpression
  760. | TaggedTemplateExpression
  761. | TemplateLiteral
  762. | ThisExpression
  763. | UpdateExpression
  764. | YieldExpression
  765. | SpreadElement
  766. | PrivateIdentifier
  767. | FunctionDeclaration
  768. | VariableDeclaration
  769. | ClassDeclaration
  770. | ExpressionStatement
  771. | BlockStatement
  772. | StaticBlock
  773. | EmptyStatement
  774. | DebuggerStatement
  775. | WithStatement
  776. | ReturnStatement
  777. | LabeledStatement
  778. | BreakStatement
  779. | ContinueStatement
  780. | IfStatement
  781. | SwitchStatement
  782. | ThrowStatement
  783. | TryStatement
  784. | WhileStatement
  785. | DoWhileStatement
  786. | ForStatement
  787. | ForInStatement
  788. | ForOfStatement
  789. | ExportDefaultDeclaration
  790. | MethodDefinition
  791. | PropertyDefinition
  792. | VariableDeclarator
  793. | SwitchCase
  794. | CatchClause
  795. | ObjectPattern
  796. | ArrayPattern
  797. | RestElement
  798. | AssignmentPattern
  799. | Property
  800. | Super
  801. | AssignmentProperty
  802. | ClassBody
  803. | ImportSpecifier
  804. | ImportDefaultSpecifier
  805. | ImportNamespaceSpecifier
  806. | ExportSpecifier
  807. | TemplateElement
  808. ): BasicEvaluatedExpression;
  809. }
  810. declare interface Bootstrap {
  811. header: string[];
  812. beforeStartup: string[];
  813. startup: string[];
  814. afterStartup: string[];
  815. allowInlineStartup: boolean;
  816. }
  817. type BufferEncoding =
  818. | "ascii"
  819. | "utf8"
  820. | "utf-8"
  821. | "utf16le"
  822. | "utf-16le"
  823. | "ucs2"
  824. | "ucs-2"
  825. | "latin1"
  826. | "binary"
  827. | "base64"
  828. | "base64url"
  829. | "hex";
  830. type BufferEncodingOption = "buffer" | { encoding: "buffer" };
  831. type BuildInfo = KnownBuildInfo & Record<string, any>;
  832. type BuildMeta = KnownBuildMeta & Record<string, any>;
  833. declare abstract class ByTypeGenerator extends Generator {
  834. map: Record<string, Generator>;
  835. }
  836. declare const CIRCULAR_CONNECTION: unique symbol;
  837. declare class Cache {
  838. constructor();
  839. hooks: {
  840. get: AsyncSeriesBailHook<
  841. [
  842. string,
  843. null | Etag,
  844. ((result: any, callback: (arg0?: Error) => void) => void)[]
  845. ],
  846. any
  847. >;
  848. store: AsyncParallelHook<[string, null | Etag, any]>;
  849. storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
  850. beginIdle: SyncHook<[]>;
  851. endIdle: AsyncParallelHook<[]>;
  852. shutdown: AsyncParallelHook<[]>;
  853. };
  854. get<T>(
  855. identifier: string,
  856. etag: null | Etag,
  857. callback: CallbackCacheCache<T>
  858. ): void;
  859. store<T>(
  860. identifier: string,
  861. etag: null | Etag,
  862. data: T,
  863. callback: CallbackCacheCache<void>
  864. ): void;
  865. /**
  866. * After this method has succeeded the cache can only be restored when build dependencies are
  867. */
  868. storeBuildDependencies(
  869. dependencies: Iterable<string>,
  870. callback: CallbackCacheCache<void>
  871. ): void;
  872. beginIdle(): void;
  873. endIdle(callback: CallbackCacheCache<void>): void;
  874. shutdown(callback: CallbackCacheCache<void>): void;
  875. static STAGE_MEMORY: number;
  876. static STAGE_DEFAULT: number;
  877. static STAGE_DISK: number;
  878. static STAGE_NETWORK: number;
  879. }
  880. declare abstract class CacheFacade {
  881. getChildCache(name: string): CacheFacade;
  882. getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade;
  883. getLazyHashedEtag(obj: HashableObject): Etag;
  884. mergeEtags(a: Etag, b: Etag): Etag;
  885. get<T>(
  886. identifier: string,
  887. etag: null | Etag,
  888. callback: CallbackCacheCacheFacade<T>
  889. ): void;
  890. getPromise<T>(identifier: string, etag: null | Etag): Promise<T>;
  891. store<T>(
  892. identifier: string,
  893. etag: null | Etag,
  894. data: T,
  895. callback: CallbackCacheCacheFacade<void>
  896. ): void;
  897. storePromise<T>(
  898. identifier: string,
  899. etag: null | Etag,
  900. data: T
  901. ): Promise<void>;
  902. provide<T>(
  903. identifier: string,
  904. etag: null | Etag,
  905. computer: (arg0: CallbackNormalErrorCache<T>) => void,
  906. callback: CallbackNormalErrorCache<T>
  907. ): void;
  908. providePromise<T>(
  909. identifier: string,
  910. etag: null | Etag,
  911. computer: () => T | Promise<T>
  912. ): Promise<T>;
  913. }
  914. declare interface CacheGroupSource {
  915. key?: string;
  916. priority?: number;
  917. getName?: (
  918. module?: Module,
  919. chunks?: Chunk[],
  920. key?: string
  921. ) => undefined | string;
  922. chunksFilter?: (chunk: Chunk) => undefined | boolean;
  923. enforce?: boolean;
  924. minSize: SplitChunksSizes;
  925. minSizeReduction: SplitChunksSizes;
  926. minRemainingSize: SplitChunksSizes;
  927. enforceSizeThreshold: SplitChunksSizes;
  928. maxAsyncSize: SplitChunksSizes;
  929. maxInitialSize: SplitChunksSizes;
  930. minChunks?: number;
  931. maxAsyncRequests?: number;
  932. maxInitialRequests?: number;
  933. filename?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  934. idHint?: string;
  935. automaticNameDelimiter?: string;
  936. reuseExistingChunk?: boolean;
  937. usedExports?: boolean;
  938. }
  939. declare interface CacheGroupsContext {
  940. moduleGraph: ModuleGraph;
  941. chunkGraph: ChunkGraph;
  942. }
  943. type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions;
  944. declare class CachedSource extends Source {
  945. constructor(source: Source);
  946. constructor(source: Source | (() => Source), cachedData?: any);
  947. original(): Source;
  948. originalLazy(): Source | (() => Source);
  949. getCachedData(): any;
  950. }
  951. type CallExpression = SimpleCallExpression | NewExpression;
  952. declare interface CallExpressionInfo {
  953. type: "call";
  954. call: CallExpression;
  955. calleeName: string;
  956. rootInfo: string | VariableInfo;
  957. getCalleeMembers: () => string[];
  958. name: string;
  959. getMembers: () => string[];
  960. getMembersOptionals: () => boolean[];
  961. getMemberRanges: () => [number, number][];
  962. }
  963. declare interface CallbackAsyncQueue<T> {
  964. (err?: null | WebpackError, result?: null | T): any;
  965. }
  966. declare interface CallbackCacheCache<T> {
  967. (err: null | WebpackError, result?: T): void;
  968. }
  969. declare interface CallbackCacheCacheFacade<T> {
  970. (err?: null | Error, result?: null | T): void;
  971. }
  972. declare interface CallbackFunction_1<T> {
  973. (err: null | Error, result?: T): any;
  974. }
  975. declare interface CallbackFunction_2<T> {
  976. (err?: null | Error, result?: T): any;
  977. }
  978. declare interface CallbackNormalErrorCache<T> {
  979. (err?: null | Error, result?: T): void;
  980. }
  981. declare interface CallbackNormalModuleFactory<T> {
  982. (err?: null | Error, stats?: T): void;
  983. }
  984. declare interface CallbackWebpack<T> {
  985. (err: null | Error, stats?: T): void;
  986. }
  987. type Cell<T> = undefined | T;
  988. declare class Chunk {
  989. constructor(name?: string, backCompat?: boolean);
  990. id: null | string | number;
  991. ids: null | ChunkId[];
  992. debugId: number;
  993. name?: string;
  994. idNameHints: SortableSet<string>;
  995. preventIntegration: boolean;
  996. filenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  997. cssFilenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  998. runtime: RuntimeSpec;
  999. files: Set<string>;
  1000. auxiliaryFiles: Set<string>;
  1001. rendered: boolean;
  1002. hash?: string;
  1003. contentHash: Record<string, string>;
  1004. renderedHash?: string;
  1005. chunkReason?: string;
  1006. extraAsync: boolean;
  1007. get entryModule(): Module;
  1008. hasEntryModule(): boolean;
  1009. addModule(module: Module): boolean;
  1010. removeModule(module: Module): void;
  1011. getNumberOfModules(): number;
  1012. get modulesIterable(): Iterable<Module>;
  1013. compareTo(otherChunk: Chunk): 0 | 1 | -1;
  1014. containsModule(module: Module): boolean;
  1015. getModules(): Module[];
  1016. remove(): void;
  1017. moveModule(module: Module, otherChunk: Chunk): void;
  1018. integrate(otherChunk: Chunk): boolean;
  1019. canBeIntegrated(otherChunk: Chunk): boolean;
  1020. isEmpty(): boolean;
  1021. modulesSize(): number;
  1022. size(options?: ChunkSizeOptions): number;
  1023. integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number;
  1024. getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps;
  1025. hasModuleInGraph(
  1026. filterFn: (m: Module) => boolean,
  1027. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1028. ): boolean;
  1029. getChunkMaps(realHash: boolean): ChunkMaps;
  1030. hasRuntime(): boolean;
  1031. canBeInitial(): boolean;
  1032. isOnlyInitial(): boolean;
  1033. getEntryOptions(): undefined | EntryOptions;
  1034. addGroup(chunkGroup: ChunkGroup): void;
  1035. removeGroup(chunkGroup: ChunkGroup): void;
  1036. isInGroup(chunkGroup: ChunkGroup): boolean;
  1037. getNumberOfGroups(): number;
  1038. get groupsIterable(): SortableSet<ChunkGroup>;
  1039. disconnectFromGroups(): void;
  1040. split(newChunk: Chunk): void;
  1041. updateHash(hash: Hash, chunkGraph: ChunkGraph): void;
  1042. getAllAsyncChunks(): Set<Chunk>;
  1043. getAllInitialChunks(): Set<Chunk>;
  1044. getAllReferencedChunks(): Set<Chunk>;
  1045. getAllReferencedAsyncEntrypoints(): Set<Entrypoint>;
  1046. hasAsyncChunks(): boolean;
  1047. getChildIdsByOrders(
  1048. chunkGraph: ChunkGraph,
  1049. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1050. ): Record<string, (string | number)[]>;
  1051. getChildrenOfTypeInOrder(
  1052. chunkGraph: ChunkGraph,
  1053. type: string
  1054. ): undefined | { onChunks: Chunk[]; chunks: Set<Chunk> }[];
  1055. getChildIdsByOrdersMap(
  1056. chunkGraph: ChunkGraph,
  1057. includeDirectChildren?: boolean,
  1058. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1059. ): Record<string | number, Record<string, (string | number)[]>>;
  1060. hasChildByOrder(
  1061. chunkGraph: ChunkGraph,
  1062. type: string,
  1063. includeDirectChildren?: boolean,
  1064. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1065. ): boolean;
  1066. }
  1067. declare class ChunkGraph {
  1068. constructor(moduleGraph: ModuleGraph, hashFunction?: string | typeof Hash);
  1069. moduleGraph: ModuleGraph;
  1070. connectChunkAndModule(chunk: Chunk, module: Module): void;
  1071. disconnectChunkAndModule(chunk: Chunk, module: Module): void;
  1072. disconnectChunk(chunk: Chunk): void;
  1073. attachModules(chunk: Chunk, modules: Iterable<Module>): void;
  1074. attachRuntimeModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  1075. attachFullHashModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  1076. attachDependentHashModules(
  1077. chunk: Chunk,
  1078. modules: Iterable<RuntimeModule>
  1079. ): void;
  1080. replaceModule(oldModule: Module, newModule: Module): void;
  1081. isModuleInChunk(module: Module, chunk: Chunk): boolean;
  1082. isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean;
  1083. isEntryModule(module: Module): boolean;
  1084. getModuleChunksIterable(module: Module): Iterable<Chunk>;
  1085. getOrderedModuleChunksIterable(
  1086. module: Module,
  1087. sortFn: (arg0: Chunk, arg1: Chunk) => 0 | 1 | -1
  1088. ): Iterable<Chunk>;
  1089. getModuleChunks(module: Module): Chunk[];
  1090. getNumberOfModuleChunks(module: Module): number;
  1091. getModuleRuntimes(module: Module): RuntimeSpecSet;
  1092. getNumberOfChunkModules(chunk: Chunk): number;
  1093. getNumberOfChunkFullHashModules(chunk: Chunk): number;
  1094. getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
  1095. getChunkModulesIterableBySourceType(
  1096. chunk: Chunk,
  1097. sourceType: string
  1098. ): undefined | Iterable<Module>;
  1099. setChunkModuleSourceTypes(
  1100. chunk: Chunk,
  1101. module: Module,
  1102. sourceTypes: Set<string>
  1103. ): void;
  1104. getChunkModuleSourceTypes(chunk: Chunk, module: Module): ReadonlySet<string>;
  1105. getModuleSourceTypes(module: Module): ReadonlySet<string>;
  1106. getOrderedChunkModulesIterable(
  1107. chunk: Chunk,
  1108. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  1109. ): Iterable<Module>;
  1110. getOrderedChunkModulesIterableBySourceType(
  1111. chunk: Chunk,
  1112. sourceType: string,
  1113. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  1114. ): undefined | Iterable<Module>;
  1115. getChunkModules(chunk: Chunk): Module[];
  1116. getOrderedChunkModules(
  1117. chunk: Chunk,
  1118. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  1119. ): Module[];
  1120. getChunkModuleIdMap(
  1121. chunk: Chunk,
  1122. filterFn: (m: Module) => boolean,
  1123. includeAllChunks?: boolean
  1124. ): Record<string | number, (string | number)[]>;
  1125. getChunkModuleRenderedHashMap(
  1126. chunk: Chunk,
  1127. filterFn: (m: Module) => boolean,
  1128. hashLength?: number,
  1129. includeAllChunks?: boolean
  1130. ): Record<string | number, Record<string | number, string>>;
  1131. getChunkConditionMap(
  1132. chunk: Chunk,
  1133. filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1134. ): Record<string | number, boolean>;
  1135. hasModuleInGraph(
  1136. chunk: Chunk,
  1137. filterFn: (m: Module) => boolean,
  1138. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1139. ): boolean;
  1140. compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1;
  1141. getChunkModulesSize(chunk: Chunk): number;
  1142. getChunkModulesSizes(chunk: Chunk): Record<string, number>;
  1143. getChunkRootModules(chunk: Chunk): Module[];
  1144. getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number;
  1145. getIntegratedChunksSize(
  1146. chunkA: Chunk,
  1147. chunkB: Chunk,
  1148. options?: ChunkSizeOptions
  1149. ): number;
  1150. canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean;
  1151. integrateChunks(chunkA: Chunk, chunkB: Chunk): void;
  1152. upgradeDependentToFullHashModules(chunk: Chunk): void;
  1153. isEntryModuleInChunk(module: Module, chunk: Chunk): boolean;
  1154. connectChunkAndEntryModule(
  1155. chunk: Chunk,
  1156. module: Module,
  1157. entrypoint: Entrypoint
  1158. ): void;
  1159. connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1160. addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1161. addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1162. disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void;
  1163. disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1164. disconnectEntryModule(module: Module): void;
  1165. disconnectEntries(chunk: Chunk): void;
  1166. getNumberOfEntryModules(chunk: Chunk): number;
  1167. getNumberOfRuntimeModules(chunk: Chunk): number;
  1168. getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
  1169. getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
  1170. hasChunkEntryDependentChunks(chunk: Chunk): boolean;
  1171. getChunkRuntimeModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
  1172. getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[];
  1173. getChunkFullHashModulesIterable(
  1174. chunk: Chunk
  1175. ): undefined | Iterable<RuntimeModule>;
  1176. getChunkFullHashModulesSet(
  1177. chunk: Chunk
  1178. ): undefined | ReadonlySet<RuntimeModule>;
  1179. getChunkDependentHashModulesIterable(
  1180. chunk: Chunk
  1181. ): undefined | Iterable<RuntimeModule>;
  1182. getChunkEntryModulesWithChunkGroupIterable(
  1183. chunk: Chunk
  1184. ): Iterable<[Module, undefined | Entrypoint]>;
  1185. getBlockChunkGroup(depBlock: AsyncDependenciesBlock): undefined | ChunkGroup;
  1186. connectBlockAndChunkGroup(
  1187. depBlock: AsyncDependenciesBlock,
  1188. chunkGroup: ChunkGroup
  1189. ): void;
  1190. disconnectChunkGroup(chunkGroup: ChunkGroup): void;
  1191. getModuleId(module: Module): null | string | number;
  1192. setModuleId(module: Module, id: ModuleId): void;
  1193. getRuntimeId(runtime: string): string | number;
  1194. setRuntimeId(runtime: string, id: string | number): void;
  1195. hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
  1196. getModuleHash(module: Module, runtime: RuntimeSpec): string;
  1197. getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
  1198. setModuleHashes(
  1199. module: Module,
  1200. runtime: RuntimeSpec,
  1201. hash: string,
  1202. renderedHash: string
  1203. ): void;
  1204. addModuleRuntimeRequirements(
  1205. module: Module,
  1206. runtime: RuntimeSpec,
  1207. items: Set<string>,
  1208. transferOwnership?: boolean
  1209. ): void;
  1210. addChunkRuntimeRequirements(chunk: Chunk, items: Set<string>): void;
  1211. addTreeRuntimeRequirements(chunk: Chunk, items: Iterable<string>): void;
  1212. getModuleRuntimeRequirements(
  1213. module: Module,
  1214. runtime: RuntimeSpec
  1215. ): ReadonlySet<string>;
  1216. getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1217. getModuleGraphHash(
  1218. module: Module,
  1219. runtime: RuntimeSpec,
  1220. withConnections?: boolean
  1221. ): string;
  1222. getModuleGraphHashBigInt(
  1223. module: Module,
  1224. runtime: RuntimeSpec,
  1225. withConnections?: boolean
  1226. ): bigint;
  1227. getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1228. static getChunkGraphForModule(
  1229. module: Module,
  1230. deprecateMessage: string,
  1231. deprecationCode: string
  1232. ): ChunkGraph;
  1233. static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void;
  1234. static clearChunkGraphForModule(module: Module): void;
  1235. static getChunkGraphForChunk(
  1236. chunk: Chunk,
  1237. deprecateMessage: string,
  1238. deprecationCode: string
  1239. ): ChunkGraph;
  1240. static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void;
  1241. static clearChunkGraphForChunk(chunk: Chunk): void;
  1242. }
  1243. declare abstract class ChunkGroup {
  1244. groupDebugId: number;
  1245. options: ChunkGroupOptions;
  1246. chunks: Chunk[];
  1247. origins: OriginRecord[];
  1248. index?: number;
  1249. /**
  1250. * when a new chunk is added to a chunkGroup, addingOptions will occur.
  1251. */
  1252. addOptions(options: ChunkGroupOptions): void;
  1253. /**
  1254. * returns the name of current ChunkGroup
  1255. * sets a new name for current ChunkGroup
  1256. */
  1257. name?: null | string;
  1258. /**
  1259. * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's
  1260. */
  1261. get debugId(): string;
  1262. /**
  1263. * get a unique id for ChunkGroup, made up of its member Chunk id's
  1264. */
  1265. get id(): string;
  1266. /**
  1267. * Performs an unshift of a specific chunk
  1268. */
  1269. unshiftChunk(chunk: Chunk): boolean;
  1270. /**
  1271. * inserts a chunk before another existing chunk in group
  1272. */
  1273. insertChunk(chunk: Chunk, before: Chunk): boolean;
  1274. /**
  1275. * add a chunk into ChunkGroup. Is pushed on or prepended
  1276. */
  1277. pushChunk(chunk: Chunk): boolean;
  1278. replaceChunk(oldChunk: Chunk, newChunk: Chunk): undefined | boolean;
  1279. removeChunk(chunk: Chunk): boolean;
  1280. isInitial(): boolean;
  1281. addChild(group: ChunkGroup): boolean;
  1282. getChildren(): ChunkGroup[];
  1283. getNumberOfChildren(): number;
  1284. get childrenIterable(): SortableSet<ChunkGroup>;
  1285. removeChild(group: ChunkGroup): boolean;
  1286. addParent(parentChunk: ChunkGroup): boolean;
  1287. getParents(): ChunkGroup[];
  1288. getNumberOfParents(): number;
  1289. hasParent(parent: ChunkGroup): boolean;
  1290. get parentsIterable(): SortableSet<ChunkGroup>;
  1291. removeParent(chunkGroup: ChunkGroup): boolean;
  1292. addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
  1293. get asyncEntrypointsIterable(): SortableSet<ChunkGroup>;
  1294. getBlocks(): AsyncDependenciesBlock[];
  1295. getNumberOfBlocks(): number;
  1296. hasBlock(block: AsyncDependenciesBlock): boolean;
  1297. get blocksIterable(): Iterable<AsyncDependenciesBlock>;
  1298. addBlock(block: AsyncDependenciesBlock): boolean;
  1299. addOrigin(
  1300. module: null | Module,
  1301. loc: DependencyLocation,
  1302. request: string
  1303. ): void;
  1304. getFiles(): string[];
  1305. remove(): void;
  1306. sortItems(): void;
  1307. /**
  1308. * Sorting predicate which allows current ChunkGroup to be compared against another.
  1309. * Sorting values are based off of number of chunks in ChunkGroup.
  1310. */
  1311. compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1;
  1312. getChildrenByOrders(
  1313. moduleGraph: ModuleGraph,
  1314. chunkGraph: ChunkGraph
  1315. ): Record<string, ChunkGroup[]>;
  1316. /**
  1317. * Sets the top-down index of a module in this ChunkGroup
  1318. */
  1319. setModulePreOrderIndex(module: Module, index: number): void;
  1320. /**
  1321. * Gets the top-down index of a module in this ChunkGroup
  1322. */
  1323. getModulePreOrderIndex(module: Module): undefined | number;
  1324. /**
  1325. * Sets the bottom-up index of a module in this ChunkGroup
  1326. */
  1327. setModulePostOrderIndex(module: Module, index: number): void;
  1328. /**
  1329. * Gets the bottom-up index of a module in this ChunkGroup
  1330. */
  1331. getModulePostOrderIndex(module: Module): undefined | number;
  1332. checkConstraints(): void;
  1333. getModuleIndex: (module: Module) => undefined | number;
  1334. getModuleIndex2: (module: Module) => undefined | number;
  1335. }
  1336. type ChunkGroupOptions = RawChunkGroupOptions & { name?: null | string };
  1337. declare interface ChunkHashContext {
  1338. /**
  1339. * results of code generation
  1340. */
  1341. codeGenerationResults: CodeGenerationResults;
  1342. /**
  1343. * the runtime template
  1344. */
  1345. runtimeTemplate: RuntimeTemplate;
  1346. /**
  1347. * the module graph
  1348. */
  1349. moduleGraph: ModuleGraph;
  1350. /**
  1351. * the chunk graph
  1352. */
  1353. chunkGraph: ChunkGraph;
  1354. }
  1355. type ChunkId = string | number;
  1356. declare interface ChunkMaps {
  1357. hash: Record<string | number, string>;
  1358. contentHash: Record<string | number, Record<string, string>>;
  1359. name: Record<string | number, string>;
  1360. }
  1361. declare class ChunkModuleIdRangePlugin {
  1362. constructor(options: ChunkModuleIdRangePluginOptions);
  1363. options: ChunkModuleIdRangePluginOptions;
  1364. /**
  1365. * Apply the plugin
  1366. */
  1367. apply(compiler: Compiler): void;
  1368. }
  1369. declare interface ChunkModuleIdRangePluginOptions {
  1370. /**
  1371. * the chunk name
  1372. */
  1373. name: string;
  1374. /**
  1375. * order
  1376. */
  1377. order?: "index" | "index2" | "preOrderIndex" | "postOrderIndex";
  1378. /**
  1379. * start id
  1380. */
  1381. start?: number;
  1382. /**
  1383. * end id
  1384. */
  1385. end?: number;
  1386. }
  1387. declare interface ChunkModuleMaps {
  1388. id: Record<string | number, (string | number)[]>;
  1389. hash: Record<string | number, string>;
  1390. }
  1391. declare interface ChunkPathData {
  1392. id: string | number;
  1393. name?: string;
  1394. hash: string;
  1395. hashWithLength?: (arg0: number) => string;
  1396. contentHash?: Record<string, string>;
  1397. contentHashWithLength?: Record<string, (length: number) => string>;
  1398. }
  1399. declare class ChunkPrefetchPreloadPlugin {
  1400. constructor();
  1401. apply(compiler: Compiler): void;
  1402. }
  1403. declare interface ChunkRenderContextCssModulesPlugin {
  1404. /**
  1405. * the chunk
  1406. */
  1407. chunk: Chunk;
  1408. /**
  1409. * the chunk graph
  1410. */
  1411. chunkGraph: ChunkGraph;
  1412. /**
  1413. * results of code generation
  1414. */
  1415. codeGenerationResults: CodeGenerationResults;
  1416. /**
  1417. * the runtime template
  1418. */
  1419. runtimeTemplate: RuntimeTemplate;
  1420. /**
  1421. * undo path to css file
  1422. */
  1423. undoPath: string;
  1424. }
  1425. declare interface ChunkRenderContextJavascriptModulesPlugin {
  1426. /**
  1427. * the chunk
  1428. */
  1429. chunk: Chunk;
  1430. /**
  1431. * the dependency templates
  1432. */
  1433. dependencyTemplates: DependencyTemplates;
  1434. /**
  1435. * the runtime template
  1436. */
  1437. runtimeTemplate: RuntimeTemplate;
  1438. /**
  1439. * the module graph
  1440. */
  1441. moduleGraph: ModuleGraph;
  1442. /**
  1443. * the chunk graph
  1444. */
  1445. chunkGraph: ChunkGraph;
  1446. /**
  1447. * results of code generation
  1448. */
  1449. codeGenerationResults: CodeGenerationResults;
  1450. /**
  1451. * init fragments for the chunk
  1452. */
  1453. chunkInitFragments: InitFragment<ChunkRenderContextJavascriptModulesPlugin>[];
  1454. /**
  1455. * rendering in strict context
  1456. */
  1457. strictMode?: boolean;
  1458. }
  1459. declare interface ChunkSizeOptions {
  1460. /**
  1461. * constant overhead for a chunk
  1462. */
  1463. chunkOverhead?: number;
  1464. /**
  1465. * multiplicator for initial chunks
  1466. */
  1467. entryChunkMultiplicator?: number;
  1468. }
  1469. declare abstract class ChunkTemplate {
  1470. hooks: Readonly<{
  1471. renderManifest: {
  1472. tap: <AdditionalOptions>(
  1473. options:
  1474. | string
  1475. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1476. fn: (
  1477. arg0: RenderManifestEntry[],
  1478. arg1: RenderManifestOptions
  1479. ) => RenderManifestEntry[]
  1480. ) => void;
  1481. };
  1482. modules: {
  1483. tap: <AdditionalOptions>(
  1484. options:
  1485. | string
  1486. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1487. fn: (
  1488. arg0: Source,
  1489. arg1: ModuleTemplate,
  1490. arg2: RenderContextJavascriptModulesPlugin
  1491. ) => Source
  1492. ) => void;
  1493. };
  1494. render: {
  1495. tap: <AdditionalOptions>(
  1496. options:
  1497. | string
  1498. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1499. fn: (
  1500. arg0: Source,
  1501. arg1: ModuleTemplate,
  1502. arg2: RenderContextJavascriptModulesPlugin
  1503. ) => Source
  1504. ) => void;
  1505. };
  1506. renderWithEntry: {
  1507. tap: <AdditionalOptions>(
  1508. options:
  1509. | string
  1510. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1511. fn: (arg0: Source, arg1: Chunk) => Source
  1512. ) => void;
  1513. };
  1514. hash: {
  1515. tap: <AdditionalOptions>(
  1516. options:
  1517. | string
  1518. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1519. fn: (arg0: Hash) => void
  1520. ) => void;
  1521. };
  1522. hashForChunk: {
  1523. tap: <AdditionalOptions>(
  1524. options:
  1525. | string
  1526. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1527. fn: (arg0: Hash, arg1: Chunk, arg2: ChunkHashContext) => void
  1528. ) => void;
  1529. };
  1530. }>;
  1531. get outputOptions(): Output;
  1532. }
  1533. /**
  1534. * Advanced options for cleaning assets.
  1535. */
  1536. declare interface CleanOptions {
  1537. /**
  1538. * Log the assets that should be removed instead of deleting them.
  1539. */
  1540. dry?: boolean;
  1541. /**
  1542. * Keep these assets.
  1543. */
  1544. keep?: string | RegExp | ((filename: string) => boolean);
  1545. }
  1546. declare class CleanPlugin {
  1547. constructor(options?: CleanOptions);
  1548. options: {
  1549. /**
  1550. * Log the assets that should be removed instead of deleting them.
  1551. */
  1552. dry: boolean;
  1553. /**
  1554. * Keep these assets.
  1555. */
  1556. keep?: string | RegExp | ((filename: string) => boolean);
  1557. };
  1558. /**
  1559. * Apply the plugin
  1560. */
  1561. apply(compiler: Compiler): void;
  1562. static getCompilationHooks(
  1563. compilation: Compilation
  1564. ): CleanPluginCompilationHooks;
  1565. }
  1566. declare interface CleanPluginCompilationHooks {
  1567. /**
  1568. * when returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config
  1569. */
  1570. keep: SyncBailHook<[string], boolean | void>;
  1571. }
  1572. declare interface CodeGenerationContext {
  1573. /**
  1574. * the dependency templates
  1575. */
  1576. dependencyTemplates: DependencyTemplates;
  1577. /**
  1578. * the runtime template
  1579. */
  1580. runtimeTemplate: RuntimeTemplate;
  1581. /**
  1582. * the module graph
  1583. */
  1584. moduleGraph: ModuleGraph;
  1585. /**
  1586. * the chunk graph
  1587. */
  1588. chunkGraph: ChunkGraph;
  1589. /**
  1590. * the runtimes code should be generated for
  1591. */
  1592. runtime: RuntimeSpec;
  1593. /**
  1594. * when in concatenated module, information about other concatenated modules
  1595. */
  1596. concatenationScope?: ConcatenationScope;
  1597. /**
  1598. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  1599. */
  1600. codeGenerationResults?: CodeGenerationResults;
  1601. /**
  1602. * the compilation
  1603. */
  1604. compilation?: Compilation;
  1605. /**
  1606. * source types
  1607. */
  1608. sourceTypes?: ReadonlySet<string>;
  1609. }
  1610. declare interface CodeGenerationResult {
  1611. /**
  1612. * the resulting sources for all source types
  1613. */
  1614. sources: Map<string, Source>;
  1615. /**
  1616. * the resulting data for all source types
  1617. */
  1618. data?: Map<string, any>;
  1619. /**
  1620. * the runtime requirements
  1621. */
  1622. runtimeRequirements: null | ReadonlySet<string>;
  1623. /**
  1624. * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
  1625. */
  1626. hash?: string;
  1627. }
  1628. declare abstract class CodeGenerationResults {
  1629. map: Map<Module, RuntimeSpecMap<CodeGenerationResult>>;
  1630. get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
  1631. has(module: Module, runtime: RuntimeSpec): boolean;
  1632. getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source;
  1633. getRuntimeRequirements(
  1634. module: Module,
  1635. runtime: RuntimeSpec
  1636. ): null | ReadonlySet<string>;
  1637. getData(module: Module, runtime: RuntimeSpec, key: string): any;
  1638. getHash(module: Module, runtime: RuntimeSpec): any;
  1639. add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void;
  1640. }
  1641. type CodeValue =
  1642. | undefined
  1643. | null
  1644. | string
  1645. | number
  1646. | bigint
  1647. | boolean
  1648. | Function
  1649. | RegExp
  1650. | RuntimeValue
  1651. | {
  1652. [index: string]: RecursiveArrayOrRecord<
  1653. | undefined
  1654. | null
  1655. | string
  1656. | number
  1657. | bigint
  1658. | boolean
  1659. | Function
  1660. | RegExp
  1661. | RuntimeValue
  1662. >;
  1663. }
  1664. | RecursiveArrayOrRecord<
  1665. | undefined
  1666. | null
  1667. | string
  1668. | number
  1669. | bigint
  1670. | boolean
  1671. | Function
  1672. | RegExp
  1673. | RuntimeValue
  1674. >[];
  1675. type CodeValuePrimitive =
  1676. | undefined
  1677. | null
  1678. | string
  1679. | number
  1680. | bigint
  1681. | boolean
  1682. | Function
  1683. | RegExp;
  1684. declare interface Comparator<T> {
  1685. (arg0: T, arg1: T): 0 | 1 | -1;
  1686. }
  1687. declare class CompatSource extends Source {
  1688. constructor(sourceLike: SourceLike);
  1689. static from(sourceLike: SourceLike): Source;
  1690. }
  1691. declare class Compilation {
  1692. /**
  1693. * Creates an instance of Compilation.
  1694. */
  1695. constructor(compiler: Compiler, params: CompilationParams);
  1696. hooks: Readonly<{
  1697. buildModule: SyncHook<[Module]>;
  1698. rebuildModule: SyncHook<[Module]>;
  1699. failedModule: SyncHook<[Module, WebpackError]>;
  1700. succeedModule: SyncHook<[Module]>;
  1701. stillValidModule: SyncHook<[Module]>;
  1702. addEntry: SyncHook<[Dependency, EntryOptions]>;
  1703. failedEntry: SyncHook<[Dependency, EntryOptions, Error]>;
  1704. succeedEntry: SyncHook<[Dependency, EntryOptions, Module]>;
  1705. dependencyReferencedExports: SyncWaterfallHook<
  1706. [(string[] | ReferencedExport)[], Dependency, RuntimeSpec]
  1707. >;
  1708. executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>;
  1709. prepareModuleExecution: AsyncParallelHook<
  1710. [ExecuteModuleArgument, ExecuteModuleContext]
  1711. >;
  1712. finishModules: AsyncSeriesHook<[Iterable<Module>]>;
  1713. finishRebuildingModule: AsyncSeriesHook<[Module]>;
  1714. unseal: SyncHook<[]>;
  1715. seal: SyncHook<[]>;
  1716. beforeChunks: SyncHook<[]>;
  1717. /**
  1718. * The `afterChunks` hook is called directly after the chunks and module graph have
  1719. * been created and before the chunks and modules have been optimized. This hook is useful to
  1720. * inspect, analyze, and/or modify the chunk graph.
  1721. */
  1722. afterChunks: SyncHook<[Iterable<Chunk>]>;
  1723. optimizeDependencies: SyncBailHook<[Iterable<Module>], boolean | void>;
  1724. afterOptimizeDependencies: SyncHook<[Iterable<Module>]>;
  1725. optimize: SyncHook<[]>;
  1726. optimizeModules: SyncBailHook<[Iterable<Module>], boolean | void>;
  1727. afterOptimizeModules: SyncHook<[Iterable<Module>]>;
  1728. optimizeChunks: SyncBailHook<
  1729. [Iterable<Chunk>, ChunkGroup[]],
  1730. boolean | void
  1731. >;
  1732. afterOptimizeChunks: SyncHook<[Iterable<Chunk>, ChunkGroup[]]>;
  1733. optimizeTree: AsyncSeriesHook<[Iterable<Chunk>, Iterable<Module>]>;
  1734. afterOptimizeTree: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1735. optimizeChunkModules: AsyncSeriesBailHook<
  1736. [Iterable<Chunk>, Iterable<Module>],
  1737. void
  1738. >;
  1739. afterOptimizeChunkModules: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1740. shouldRecord: SyncBailHook<[], boolean | void>;
  1741. additionalChunkRuntimeRequirements: SyncHook<
  1742. [Chunk, Set<string>, RuntimeRequirementsContext]
  1743. >;
  1744. runtimeRequirementInChunk: HookMap<
  1745. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>
  1746. >;
  1747. additionalModuleRuntimeRequirements: SyncHook<
  1748. [Module, Set<string>, RuntimeRequirementsContext]
  1749. >;
  1750. runtimeRequirementInModule: HookMap<
  1751. SyncBailHook<[Module, Set<string>, RuntimeRequirementsContext], void>
  1752. >;
  1753. additionalTreeRuntimeRequirements: SyncHook<
  1754. [Chunk, Set<string>, RuntimeRequirementsContext]
  1755. >;
  1756. runtimeRequirementInTree: HookMap<
  1757. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>
  1758. >;
  1759. runtimeModule: SyncHook<[RuntimeModule, Chunk]>;
  1760. reviveModules: SyncHook<[Iterable<Module>, any]>;
  1761. beforeModuleIds: SyncHook<[Iterable<Module>]>;
  1762. moduleIds: SyncHook<[Iterable<Module>]>;
  1763. optimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1764. afterOptimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1765. reviveChunks: SyncHook<[Iterable<Chunk>, any]>;
  1766. beforeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1767. chunkIds: SyncHook<[Iterable<Chunk>]>;
  1768. optimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1769. afterOptimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1770. recordModules: SyncHook<[Iterable<Module>, any]>;
  1771. recordChunks: SyncHook<[Iterable<Chunk>, any]>;
  1772. optimizeCodeGeneration: SyncHook<[Iterable<Module>]>;
  1773. beforeModuleHash: SyncHook<[]>;
  1774. afterModuleHash: SyncHook<[]>;
  1775. beforeCodeGeneration: SyncHook<[]>;
  1776. afterCodeGeneration: SyncHook<[]>;
  1777. beforeRuntimeRequirements: SyncHook<[]>;
  1778. afterRuntimeRequirements: SyncHook<[]>;
  1779. beforeHash: SyncHook<[]>;
  1780. contentHash: SyncHook<[Chunk]>;
  1781. afterHash: SyncHook<[]>;
  1782. recordHash: SyncHook<[any]>;
  1783. record: SyncHook<[Compilation, any]>;
  1784. beforeModuleAssets: SyncHook<[]>;
  1785. shouldGenerateChunkAssets: SyncBailHook<[], boolean | void>;
  1786. beforeChunkAssets: SyncHook<[]>;
  1787. additionalChunkAssets: FakeHook<
  1788. Pick<
  1789. AsyncSeriesHook<[Set<Chunk>]>,
  1790. "name" | "tap" | "tapAsync" | "tapPromise"
  1791. >
  1792. >;
  1793. additionalAssets: FakeHook<
  1794. Pick<AsyncSeriesHook<[]>, "name" | "tap" | "tapAsync" | "tapPromise">
  1795. >;
  1796. optimizeChunkAssets: FakeHook<
  1797. Pick<
  1798. AsyncSeriesHook<[Set<Chunk>]>,
  1799. "name" | "tap" | "tapAsync" | "tapPromise"
  1800. >
  1801. >;
  1802. afterOptimizeChunkAssets: FakeHook<
  1803. Pick<
  1804. AsyncSeriesHook<[Set<Chunk>]>,
  1805. "name" | "tap" | "tapAsync" | "tapPromise"
  1806. >
  1807. >;
  1808. optimizeAssets: AsyncSeriesHook<
  1809. [CompilationAssets],
  1810. ProcessAssetsAdditionalOptions
  1811. >;
  1812. afterOptimizeAssets: SyncHook<[CompilationAssets]>;
  1813. processAssets: AsyncSeriesHook<
  1814. [CompilationAssets],
  1815. ProcessAssetsAdditionalOptions
  1816. >;
  1817. afterProcessAssets: SyncHook<[CompilationAssets]>;
  1818. processAdditionalAssets: AsyncSeriesHook<[CompilationAssets]>;
  1819. needAdditionalSeal: SyncBailHook<[], boolean | void>;
  1820. afterSeal: AsyncSeriesHook<[]>;
  1821. renderManifest: SyncWaterfallHook<
  1822. [RenderManifestEntry[], RenderManifestOptions]
  1823. >;
  1824. fullHash: SyncHook<[Hash]>;
  1825. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  1826. moduleAsset: SyncHook<[Module, string]>;
  1827. chunkAsset: SyncHook<[Chunk, string]>;
  1828. assetPath: SyncWaterfallHook<[string, object, undefined | AssetInfo]>;
  1829. needAdditionalPass: SyncBailHook<[], boolean | void>;
  1830. childCompiler: SyncHook<[Compiler, string, number]>;
  1831. log: SyncBailHook<[string, LogEntry], boolean | void>;
  1832. processWarnings: SyncWaterfallHook<[WebpackError[]]>;
  1833. processErrors: SyncWaterfallHook<[WebpackError[]]>;
  1834. statsPreset: HookMap<
  1835. SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>
  1836. >;
  1837. statsNormalize: SyncHook<
  1838. [Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]
  1839. >;
  1840. statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
  1841. statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
  1842. get normalModuleLoader(): SyncHook<
  1843. [LoaderContextNormalModule<any>, NormalModule]
  1844. >;
  1845. }>;
  1846. name?: string;
  1847. startTime?: number;
  1848. endTime?: number;
  1849. compiler: Compiler;
  1850. resolverFactory: ResolverFactory;
  1851. inputFileSystem: InputFileSystem;
  1852. fileSystemInfo: FileSystemInfo;
  1853. valueCacheVersions: Map<string, string | Set<string>>;
  1854. requestShortener: RequestShortener;
  1855. compilerPath: string;
  1856. logger: WebpackLogger;
  1857. options: WebpackOptionsNormalized;
  1858. outputOptions: OutputNormalized;
  1859. bail: boolean;
  1860. profile: boolean;
  1861. params: CompilationParams;
  1862. mainTemplate: MainTemplate;
  1863. chunkTemplate: ChunkTemplate;
  1864. runtimeTemplate: RuntimeTemplate;
  1865. moduleTemplates: ModuleTemplates;
  1866. moduleMemCaches?: Map<Module, WeakTupleMap<any, any>>;
  1867. moduleMemCaches2?: Map<Module, WeakTupleMap<any, any>>;
  1868. moduleGraph: ModuleGraph;
  1869. chunkGraph: ChunkGraph;
  1870. codeGenerationResults: CodeGenerationResults;
  1871. processDependenciesQueue: AsyncQueue<Module, Module, Module>;
  1872. addModuleQueue: AsyncQueue<Module, string, Module>;
  1873. factorizeQueue: AsyncQueue<
  1874. FactorizeModuleOptions,
  1875. string,
  1876. Module | ModuleFactoryResult
  1877. >;
  1878. buildQueue: AsyncQueue<Module, Module, Module>;
  1879. rebuildQueue: AsyncQueue<Module, Module, Module>;
  1880. /**
  1881. * Modules in value are building during the build of Module in key.
  1882. * Means value blocking key from finishing.
  1883. * Needed to detect build cycles.
  1884. */
  1885. creatingModuleDuringBuild: WeakMap<Module, Set<Module>>;
  1886. entries: Map<string, EntryData>;
  1887. globalEntry: EntryData;
  1888. entrypoints: Map<string, Entrypoint>;
  1889. asyncEntrypoints: Entrypoint[];
  1890. chunks: Set<Chunk>;
  1891. chunkGroups: ChunkGroup[];
  1892. namedChunkGroups: Map<string, ChunkGroup>;
  1893. namedChunks: Map<string, Chunk>;
  1894. modules: Set<Module>;
  1895. records: any;
  1896. additionalChunkAssets: string[];
  1897. assets: CompilationAssets;
  1898. assetsInfo: Map<string, AssetInfo>;
  1899. errors: WebpackError[];
  1900. warnings: WebpackError[];
  1901. children: Compilation[];
  1902. logging: Map<string, LogEntry[]>;
  1903. dependencyFactories: Map<DepConstructor, ModuleFactory>;
  1904. dependencyTemplates: DependencyTemplates;
  1905. childrenCounters: Record<string, number>;
  1906. usedChunkIds: Set<string | number>;
  1907. usedModuleIds: Set<number>;
  1908. needAdditionalPass: boolean;
  1909. builtModules: WeakSet<Module>;
  1910. codeGeneratedModules: WeakSet<Module>;
  1911. buildTimeExecutedModules: WeakSet<Module>;
  1912. emittedAssets: Set<string>;
  1913. comparedForEmitAssets: Set<string>;
  1914. fileDependencies: LazySet<string>;
  1915. contextDependencies: LazySet<string>;
  1916. missingDependencies: LazySet<string>;
  1917. buildDependencies: LazySet<string>;
  1918. compilationDependencies: { add: (item: string) => LazySet<string> };
  1919. getStats(): Stats;
  1920. createStatsOptions(
  1921. optionsOrPreset?: string | boolean | StatsOptions,
  1922. context?: CreateStatsOptionsContext
  1923. ): NormalizedStatsOptions;
  1924. createStatsFactory(options: NormalizedStatsOptions): StatsFactory;
  1925. createStatsPrinter(options: NormalizedStatsOptions): StatsPrinter;
  1926. getCache(name: string): CacheFacade;
  1927. getLogger(name: string | (() => string)): WebpackLogger;
  1928. addModule(
  1929. module: Module,
  1930. callback: (err?: null | WebpackError, result?: null | Module) => void
  1931. ): void;
  1932. /**
  1933. * Fetches a module from a compilation by its identifier
  1934. */
  1935. getModule(module: Module): Module;
  1936. /**
  1937. * Attempts to search for a module by its identifier
  1938. */
  1939. findModule(identifier: string): undefined | Module;
  1940. /**
  1941. * Schedules a build of the module object
  1942. */
  1943. buildModule(
  1944. module: Module,
  1945. callback: (err?: null | WebpackError, result?: null | Module) => void
  1946. ): void;
  1947. processModuleDependencies(
  1948. module: Module,
  1949. callback: (err?: null | WebpackError, result?: null | Module) => void
  1950. ): void;
  1951. processModuleDependenciesNonRecursive(module: Module): void;
  1952. handleModuleCreation(
  1953. __0: HandleModuleCreationOptions,
  1954. callback: (err?: null | WebpackError, result?: null | Module) => void
  1955. ): void;
  1956. addModuleChain(
  1957. context: string,
  1958. dependency: Dependency,
  1959. callback: (err?: null | WebpackError, result?: null | Module) => void
  1960. ): void;
  1961. addModuleTree(
  1962. __0: {
  1963. /**
  1964. * context string path
  1965. */
  1966. context: string;
  1967. /**
  1968. * dependency used to create Module chain
  1969. */
  1970. dependency: Dependency;
  1971. /**
  1972. * additional context info for the root module
  1973. */
  1974. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  1975. },
  1976. callback: (err?: null | WebpackError, result?: null | Module) => void
  1977. ): void;
  1978. addEntry(
  1979. context: string,
  1980. entry: Dependency,
  1981. optionsOrName: string | EntryOptions,
  1982. callback: (err?: null | WebpackError, result?: null | Module) => void
  1983. ): void;
  1984. addInclude(
  1985. context: string,
  1986. dependency: Dependency,
  1987. options: EntryOptions,
  1988. callback: (err?: null | WebpackError, result?: null | Module) => void
  1989. ): void;
  1990. rebuildModule(
  1991. module: Module,
  1992. callback: (err?: null | WebpackError, result?: null | Module) => void
  1993. ): void;
  1994. finish(callback: (err?: null | WebpackError) => void): void;
  1995. unseal(): void;
  1996. seal(callback: (err?: null | WebpackError) => void): void;
  1997. reportDependencyErrorsAndWarnings(
  1998. module: Module,
  1999. blocks: DependenciesBlock[]
  2000. ): boolean;
  2001. codeGeneration(callback: (err?: null | WebpackError) => void): void;
  2002. processRuntimeRequirements(__0?: {
  2003. /**
  2004. * the chunk graph
  2005. */
  2006. chunkGraph?: ChunkGraph;
  2007. /**
  2008. * modules
  2009. */
  2010. modules?: Iterable<Module>;
  2011. /**
  2012. * chunks
  2013. */
  2014. chunks?: Iterable<Chunk>;
  2015. /**
  2016. * codeGenerationResults
  2017. */
  2018. codeGenerationResults?: CodeGenerationResults;
  2019. /**
  2020. * chunkGraphEntries
  2021. */
  2022. chunkGraphEntries?: Iterable<Chunk>;
  2023. }): void;
  2024. addRuntimeModule(
  2025. chunk: Chunk,
  2026. module: RuntimeModule,
  2027. chunkGraph?: ChunkGraph
  2028. ): void;
  2029. /**
  2030. * If `module` is passed, `loc` and `request` must also be passed.
  2031. */
  2032. addChunkInGroup(
  2033. groupOptions: string | ChunkGroupOptions,
  2034. module?: Module,
  2035. loc?: SyntheticDependencyLocation | RealDependencyLocation,
  2036. request?: string
  2037. ): ChunkGroup;
  2038. addAsyncEntrypoint(
  2039. options: EntryOptions,
  2040. module: Module,
  2041. loc: DependencyLocation,
  2042. request: string
  2043. ): Entrypoint;
  2044. /**
  2045. * This method first looks to see if a name is provided for a new chunk,
  2046. * and first looks to see if any named chunks already exist and reuse that chunk instead.
  2047. */
  2048. addChunk(name?: string): Chunk;
  2049. assignDepth(module: Module): void;
  2050. assignDepths(modules: Set<Module>): void;
  2051. getDependencyReferencedExports(
  2052. dependency: Dependency,
  2053. runtime: RuntimeSpec
  2054. ): (string[] | ReferencedExport)[];
  2055. removeReasonsOfDependencyBlock(
  2056. module: Module,
  2057. block: DependenciesBlockLike
  2058. ): void;
  2059. patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void;
  2060. removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void;
  2061. assignRuntimeIds(): void;
  2062. sortItemsWithChunkIds(): void;
  2063. summarizeDependencies(): void;
  2064. createModuleHashes(): void;
  2065. createHash(): {
  2066. module: Module;
  2067. hash: string;
  2068. runtime: RuntimeSpec;
  2069. runtimes: RuntimeSpec[];
  2070. }[];
  2071. fullHash?: string;
  2072. hash?: string;
  2073. emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
  2074. updateAsset(
  2075. file: string,
  2076. newSourceOrFunction: Source | ((arg0: Source) => Source),
  2077. assetInfoUpdateOrFunction?: AssetInfo | ((arg0?: AssetInfo) => AssetInfo)
  2078. ): void;
  2079. renameAsset(file: string, newFile: string): void;
  2080. deleteAsset(file: string): void;
  2081. getAssets(): Readonly<Asset>[];
  2082. getAsset(name: string): undefined | Readonly<Asset>;
  2083. clearAssets(): void;
  2084. createModuleAssets(): void;
  2085. getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
  2086. createChunkAssets(callback: (err?: null | WebpackError) => void): void;
  2087. getPath(filename: TemplatePath, data?: PathData): string;
  2088. getPathWithInfo(
  2089. filename: TemplatePath,
  2090. data?: PathData
  2091. ): InterpolatedPathAndAssetInfo;
  2092. getAssetPath(filename: TemplatePath, data: PathData): string;
  2093. getAssetPathWithInfo(
  2094. filename: TemplatePath,
  2095. data: PathData
  2096. ): InterpolatedPathAndAssetInfo;
  2097. getWarnings(): WebpackError[];
  2098. getErrors(): WebpackError[];
  2099. /**
  2100. * This function allows you to run another instance of webpack inside of webpack however as
  2101. * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins
  2102. * from parent (or top level compiler) and creates a child Compilation
  2103. */
  2104. createChildCompiler(
  2105. name: string,
  2106. outputOptions?: Partial<OutputNormalized>,
  2107. plugins?: (
  2108. | ((this: Compiler, compiler: Compiler) => void)
  2109. | WebpackPluginInstance
  2110. )[]
  2111. ): Compiler;
  2112. executeModule(
  2113. module: Module,
  2114. options: ExecuteModuleOptions,
  2115. callback: (err: null | WebpackError, result?: ExecuteModuleResult) => void
  2116. ): void;
  2117. checkConstraints(): void;
  2118. factorizeModule: {
  2119. (
  2120. options: FactorizeModuleOptions & { factoryResult?: false },
  2121. callback: (err?: null | WebpackError, result?: null | Module) => void
  2122. ): void;
  2123. (
  2124. options: FactorizeModuleOptions & { factoryResult: true },
  2125. callback: (
  2126. err?: null | WebpackError,
  2127. result?: ModuleFactoryResult
  2128. ) => void
  2129. ): void;
  2130. };
  2131. /**
  2132. * Add additional assets to the compilation.
  2133. */
  2134. static PROCESS_ASSETS_STAGE_ADDITIONAL: number;
  2135. /**
  2136. * Basic preprocessing of assets.
  2137. */
  2138. static PROCESS_ASSETS_STAGE_PRE_PROCESS: number;
  2139. /**
  2140. * Derive new assets from existing assets.
  2141. * Existing assets should not be treated as complete.
  2142. */
  2143. static PROCESS_ASSETS_STAGE_DERIVED: number;
  2144. /**
  2145. * Add additional sections to existing assets, like a banner or initialization code.
  2146. */
  2147. static PROCESS_ASSETS_STAGE_ADDITIONS: number;
  2148. /**
  2149. * Optimize existing assets in a general way.
  2150. */
  2151. static PROCESS_ASSETS_STAGE_OPTIMIZE: number;
  2152. /**
  2153. * Optimize the count of existing assets, e. g. by merging them.
  2154. * Only assets of the same type should be merged.
  2155. * For assets of different types see PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE.
  2156. */
  2157. static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number;
  2158. /**
  2159. * Optimize the compatibility of existing assets, e. g. add polyfills or vendor-prefixes.
  2160. */
  2161. static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number;
  2162. /**
  2163. * Optimize the size of existing assets, e. g. by minimizing or omitting whitespace.
  2164. */
  2165. static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number;
  2166. /**
  2167. * Add development tooling to assets, e. g. by extracting a SourceMap.
  2168. */
  2169. static PROCESS_ASSETS_STAGE_DEV_TOOLING: number;
  2170. /**
  2171. * Optimize the count of existing assets, e. g. by inlining assets of into other assets.
  2172. * Only assets of different types should be inlined.
  2173. * For assets of the same type see PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT.
  2174. */
  2175. static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number;
  2176. /**
  2177. * Summarize the list of existing assets
  2178. * e. g. creating an assets manifest of Service Workers.
  2179. */
  2180. static PROCESS_ASSETS_STAGE_SUMMARIZE: number;
  2181. /**
  2182. * Optimize the hashes of the assets, e. g. by generating real hashes of the asset content.
  2183. */
  2184. static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number;
  2185. /**
  2186. * Optimize the transfer of existing assets, e. g. by preparing a compressed (gzip) file as separate asset.
  2187. */
  2188. static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number;
  2189. /**
  2190. * Analyse existing assets.
  2191. */
  2192. static PROCESS_ASSETS_STAGE_ANALYSE: number;
  2193. /**
  2194. * Creating assets for reporting purposes.
  2195. */
  2196. static PROCESS_ASSETS_STAGE_REPORT: number;
  2197. }
  2198. declare interface CompilationAssets {
  2199. [index: string]: Source;
  2200. }
  2201. declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
  2202. renderModuleContent: SyncWaterfallHook<
  2203. [Source, Module, WebAssemblyRenderContext]
  2204. >;
  2205. }
  2206. declare interface CompilationHooksCssModulesPlugin {
  2207. renderModulePackage: SyncWaterfallHook<
  2208. [Source, Module, ChunkRenderContextCssModulesPlugin]
  2209. >;
  2210. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  2211. }
  2212. declare interface CompilationHooksJavascriptModulesPlugin {
  2213. renderModuleContent: SyncWaterfallHook<
  2214. [Source, Module, ChunkRenderContextJavascriptModulesPlugin]
  2215. >;
  2216. renderModuleContainer: SyncWaterfallHook<
  2217. [Source, Module, ChunkRenderContextJavascriptModulesPlugin]
  2218. >;
  2219. renderModulePackage: SyncWaterfallHook<
  2220. [Source, Module, ChunkRenderContextJavascriptModulesPlugin]
  2221. >;
  2222. renderChunk: SyncWaterfallHook<
  2223. [Source, RenderContextJavascriptModulesPlugin]
  2224. >;
  2225. renderMain: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin]>;
  2226. renderContent: SyncWaterfallHook<
  2227. [Source, RenderContextJavascriptModulesPlugin]
  2228. >;
  2229. render: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin]>;
  2230. renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
  2231. renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
  2232. inlineInRuntimeBailout: SyncBailHook<
  2233. [Module, RenderBootstrapContext],
  2234. string | void
  2235. >;
  2236. embedInRuntimeBailout: SyncBailHook<
  2237. [Module, RenderContextJavascriptModulesPlugin],
  2238. string | void
  2239. >;
  2240. strictRuntimeBailout: SyncBailHook<
  2241. [RenderContextJavascriptModulesPlugin],
  2242. string | void
  2243. >;
  2244. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  2245. useSourceMap: SyncBailHook<
  2246. [Chunk, RenderContextJavascriptModulesPlugin],
  2247. boolean | void
  2248. >;
  2249. }
  2250. declare interface CompilationHooksModuleFederationPlugin {
  2251. addContainerEntryDependency: SyncHook<Dependency>;
  2252. addFederationRuntimeDependency: SyncHook<Dependency>;
  2253. }
  2254. declare interface CompilationHooksRealContentHashPlugin {
  2255. updateHash: SyncBailHook<[Buffer[], string], string | void>;
  2256. }
  2257. declare interface CompilationParams {
  2258. normalModuleFactory: NormalModuleFactory;
  2259. contextModuleFactory: ContextModuleFactory;
  2260. }
  2261. declare class Compiler {
  2262. constructor(context: string, options?: WebpackOptionsNormalized);
  2263. hooks: Readonly<{
  2264. initialize: SyncHook<[]>;
  2265. shouldEmit: SyncBailHook<[Compilation], boolean | void>;
  2266. done: AsyncSeriesHook<[Stats]>;
  2267. afterDone: SyncHook<[Stats]>;
  2268. additionalPass: AsyncSeriesHook<[]>;
  2269. beforeRun: AsyncSeriesHook<[Compiler]>;
  2270. run: AsyncSeriesHook<[Compiler]>;
  2271. emit: AsyncSeriesHook<[Compilation]>;
  2272. assetEmitted: AsyncSeriesHook<[string, AssetEmittedInfo]>;
  2273. afterEmit: AsyncSeriesHook<[Compilation]>;
  2274. thisCompilation: SyncHook<[Compilation, CompilationParams]>;
  2275. compilation: SyncHook<[Compilation, CompilationParams]>;
  2276. normalModuleFactory: SyncHook<[NormalModuleFactory]>;
  2277. contextModuleFactory: SyncHook<[ContextModuleFactory]>;
  2278. beforeCompile: AsyncSeriesHook<[CompilationParams]>;
  2279. compile: SyncHook<[CompilationParams]>;
  2280. make: AsyncParallelHook<[Compilation]>;
  2281. finishMake: AsyncParallelHook<[Compilation]>;
  2282. afterCompile: AsyncSeriesHook<[Compilation]>;
  2283. readRecords: AsyncSeriesHook<[]>;
  2284. emitRecords: AsyncSeriesHook<[]>;
  2285. watchRun: AsyncSeriesHook<[Compiler]>;
  2286. failed: SyncHook<[Error]>;
  2287. invalid: SyncHook<[null | string, number]>;
  2288. watchClose: SyncHook<[]>;
  2289. shutdown: AsyncSeriesHook<[]>;
  2290. infrastructureLog: SyncBailHook<
  2291. [string, string, undefined | any[]],
  2292. true | void
  2293. >;
  2294. environment: SyncHook<[]>;
  2295. afterEnvironment: SyncHook<[]>;
  2296. afterPlugins: SyncHook<[Compiler]>;
  2297. afterResolvers: SyncHook<[Compiler]>;
  2298. entryOption: SyncBailHook<[string, EntryNormalized], boolean | void>;
  2299. }>;
  2300. webpack: typeof exports;
  2301. name?: string;
  2302. parentCompilation?: Compilation;
  2303. root: Compiler;
  2304. outputPath: string;
  2305. watching?: Watching;
  2306. outputFileSystem: null | OutputFileSystem;
  2307. intermediateFileSystem: null | IntermediateFileSystem;
  2308. inputFileSystem: null | InputFileSystem;
  2309. watchFileSystem: null | WatchFileSystem;
  2310. recordsInputPath: null | string;
  2311. recordsOutputPath: null | string;
  2312. records: Record<string, any>;
  2313. managedPaths: Set<string | RegExp>;
  2314. unmanagedPaths: Set<string | RegExp>;
  2315. immutablePaths: Set<string | RegExp>;
  2316. modifiedFiles?: ReadonlySet<string>;
  2317. removedFiles?: ReadonlySet<string>;
  2318. fileTimestamps?: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
  2319. contextTimestamps?: ReadonlyMap<
  2320. string,
  2321. null | FileSystemInfoEntry | "ignore"
  2322. >;
  2323. fsStartTime?: number;
  2324. resolverFactory: ResolverFactory;
  2325. infrastructureLogger?: (
  2326. arg0: string,
  2327. arg1: LogTypeEnum,
  2328. arg2?: any[]
  2329. ) => void;
  2330. platform: Readonly<PlatformTargetProperties>;
  2331. options: WebpackOptionsNormalized;
  2332. context: string;
  2333. requestShortener: RequestShortener;
  2334. cache: Cache;
  2335. moduleMemCaches?: Map<Module, ModuleMemCachesItem>;
  2336. compilerPath: string;
  2337. running: boolean;
  2338. idle: boolean;
  2339. watchMode: boolean;
  2340. getCache(name: string): CacheFacade;
  2341. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  2342. watch(watchOptions: WatchOptions, handler: RunCallback<Stats>): Watching;
  2343. run(callback: RunCallback<Stats>): void;
  2344. runAsChild(
  2345. callback: (
  2346. err: null | Error,
  2347. entries?: Chunk[],
  2348. compilation?: Compilation
  2349. ) => any
  2350. ): void;
  2351. purgeInputFileSystem(): void;
  2352. emitAssets(
  2353. compilation: Compilation,
  2354. callback: CallbackFunction_2<void>
  2355. ): void;
  2356. emitRecords(callback: CallbackFunction_2<void>): void;
  2357. readRecords(callback: CallbackFunction_2<void>): void;
  2358. createChildCompiler(
  2359. compilation: Compilation,
  2360. compilerName: string,
  2361. compilerIndex: number,
  2362. outputOptions?: Partial<OutputNormalized>,
  2363. plugins?: WebpackPluginInstance[]
  2364. ): Compiler;
  2365. isChild(): boolean;
  2366. createCompilation(params: CompilationParams): Compilation;
  2367. newCompilation(params: CompilationParams): Compilation;
  2368. createNormalModuleFactory(): NormalModuleFactory;
  2369. createContextModuleFactory(): ContextModuleFactory;
  2370. newCompilationParams(): {
  2371. normalModuleFactory: NormalModuleFactory;
  2372. contextModuleFactory: ContextModuleFactory;
  2373. };
  2374. compile(callback: RunCallback<Compilation>): void;
  2375. close(callback: RunCallback<void>): void;
  2376. }
  2377. declare class ConcatSource extends Source {
  2378. constructor(...args: (string | Source)[]);
  2379. getChildren(): Source[];
  2380. add(item: string | Source): void;
  2381. addAllSkipOptimizing(items: Source[]): void;
  2382. }
  2383. declare interface ConcatenatedModuleInfo {
  2384. type: "concatenated";
  2385. module: Module;
  2386. index: number;
  2387. ast?: Program;
  2388. internalSource?: Source;
  2389. source?: ReplaceSource;
  2390. chunkInitFragments?: InitFragment<ChunkRenderContextJavascriptModulesPlugin>[];
  2391. runtimeRequirements?: ReadonlySet<string>;
  2392. globalScope?: Scope;
  2393. moduleScope?: Scope;
  2394. internalNames: Map<string, string>;
  2395. exportMap?: Map<string, string>;
  2396. rawExportMap?: Map<string, string>;
  2397. namespaceExportSymbol?: string;
  2398. namespaceObjectName?: string;
  2399. interopNamespaceObjectUsed: boolean;
  2400. interopNamespaceObjectName?: string;
  2401. interopNamespaceObject2Used: boolean;
  2402. interopNamespaceObject2Name?: string;
  2403. interopDefaultAccessUsed: boolean;
  2404. interopDefaultAccessName?: string;
  2405. }
  2406. declare interface ConcatenationBailoutReasonContext {
  2407. /**
  2408. * the module graph
  2409. */
  2410. moduleGraph: ModuleGraph;
  2411. /**
  2412. * the chunk graph
  2413. */
  2414. chunkGraph: ChunkGraph;
  2415. }
  2416. declare class ConcatenationScope {
  2417. constructor(
  2418. modulesMap: ModuleInfo[] | Map<Module, ModuleInfo>,
  2419. currentModule: ConcatenatedModuleInfo
  2420. );
  2421. isModuleInScope(module: Module): boolean;
  2422. registerExport(exportName: string, symbol: string): void;
  2423. registerRawExport(exportName: string, expression: string): void;
  2424. registerNamespaceExport(symbol: string): void;
  2425. createModuleReference(
  2426. module: Module,
  2427. __1: Partial<ModuleReferenceOptions>
  2428. ): string;
  2429. static isModuleReference(name: string): boolean;
  2430. static matchModuleReference(
  2431. name: string
  2432. ): null | (ModuleReferenceOptions & { index: number });
  2433. static DEFAULT_EXPORT: string;
  2434. static NAMESPACE_OBJECT_EXPORT: string;
  2435. }
  2436. /**
  2437. * Options object as provided by the user.
  2438. */
  2439. declare interface Configuration {
  2440. /**
  2441. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  2442. */
  2443. amd?: false | { [index: string]: any };
  2444. /**
  2445. * Report the first error as a hard error instead of tolerating it.
  2446. */
  2447. bail?: boolean;
  2448. /**
  2449. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  2450. */
  2451. cache?: boolean | FileCacheOptions | MemoryCacheOptions;
  2452. /**
  2453. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  2454. */
  2455. context?: string;
  2456. /**
  2457. * References to other configurations to depend on.
  2458. */
  2459. dependencies?: string[];
  2460. /**
  2461. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  2462. */
  2463. devtool?: string | false;
  2464. /**
  2465. * The entry point(s) of the compilation.
  2466. */
  2467. entry?:
  2468. | string
  2469. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  2470. | EntryObject
  2471. | string[];
  2472. /**
  2473. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  2474. */
  2475. experiments?: Experiments;
  2476. /**
  2477. * Extend configuration from another configuration (only works when using webpack-cli).
  2478. */
  2479. extends?: string | string[];
  2480. /**
  2481. * 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`.
  2482. */
  2483. externals?:
  2484. | string
  2485. | RegExp
  2486. | ExternalItem[]
  2487. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  2488. | ((
  2489. data: ExternalItemFunctionData,
  2490. callback: (
  2491. err?: null | Error,
  2492. result?: string | boolean | string[] | { [index: string]: any }
  2493. ) => void
  2494. ) => void)
  2495. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  2496. /**
  2497. * Enable presets of externals for specific targets.
  2498. */
  2499. externalsPresets?: ExternalsPresets;
  2500. /**
  2501. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  2502. */
  2503. externalsType?:
  2504. | "import"
  2505. | "var"
  2506. | "module"
  2507. | "assign"
  2508. | "this"
  2509. | "window"
  2510. | "self"
  2511. | "global"
  2512. | "commonjs"
  2513. | "commonjs2"
  2514. | "commonjs-module"
  2515. | "commonjs-static"
  2516. | "amd"
  2517. | "amd-require"
  2518. | "umd"
  2519. | "umd2"
  2520. | "jsonp"
  2521. | "system"
  2522. | "promise"
  2523. | "module-import"
  2524. | "script"
  2525. | "node-commonjs";
  2526. /**
  2527. * Ignore specific warnings.
  2528. */
  2529. ignoreWarnings?: (
  2530. | RegExp
  2531. | {
  2532. /**
  2533. * A RegExp to select the origin file for the warning.
  2534. */
  2535. file?: RegExp;
  2536. /**
  2537. * A RegExp to select the warning message.
  2538. */
  2539. message?: RegExp;
  2540. /**
  2541. * A RegExp to select the origin module for the warning.
  2542. */
  2543. module?: RegExp;
  2544. }
  2545. | ((warning: WebpackError, compilation: Compilation) => boolean)
  2546. )[];
  2547. /**
  2548. * Options for infrastructure level logging.
  2549. */
  2550. infrastructureLogging?: InfrastructureLogging;
  2551. /**
  2552. * Custom values available in the loader context.
  2553. */
  2554. loader?: Loader;
  2555. /**
  2556. * Enable production optimizations or development hints.
  2557. */
  2558. mode?: "none" | "development" | "production";
  2559. /**
  2560. * Options affecting the normal modules (`NormalModuleFactory`).
  2561. */
  2562. module?: ModuleOptions;
  2563. /**
  2564. * Name of the configuration. Used when loading multiple configurations.
  2565. */
  2566. name?: string;
  2567. /**
  2568. * Include polyfills or mocks for various node stuff.
  2569. */
  2570. node?: false | NodeOptions;
  2571. /**
  2572. * Enables/Disables integrated optimizations.
  2573. */
  2574. optimization?: Optimization;
  2575. /**
  2576. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  2577. */
  2578. output?: Output;
  2579. /**
  2580. * The number of parallel processed modules in the compilation.
  2581. */
  2582. parallelism?: number;
  2583. /**
  2584. * Configuration for web performance recommendations.
  2585. */
  2586. performance?: false | PerformanceOptions;
  2587. /**
  2588. * Add additional plugins to the compiler.
  2589. */
  2590. plugins?: (
  2591. | undefined
  2592. | null
  2593. | false
  2594. | ""
  2595. | 0
  2596. | ((this: Compiler, compiler: Compiler) => void)
  2597. | WebpackPluginInstance
  2598. )[];
  2599. /**
  2600. * Capture timing information for each module.
  2601. */
  2602. profile?: boolean;
  2603. /**
  2604. * Store compiler state to a json file.
  2605. */
  2606. recordsInputPath?: string | false;
  2607. /**
  2608. * Load compiler state from a json file.
  2609. */
  2610. recordsOutputPath?: string | false;
  2611. /**
  2612. * 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.
  2613. */
  2614. recordsPath?: string | false;
  2615. /**
  2616. * Options for the resolver.
  2617. */
  2618. resolve?: ResolveOptions;
  2619. /**
  2620. * Options for the resolver when resolving loaders.
  2621. */
  2622. resolveLoader?: ResolveOptions;
  2623. /**
  2624. * Options affecting how file system snapshots are created and validated.
  2625. */
  2626. snapshot?: SnapshotOptionsWebpackOptions;
  2627. /**
  2628. * Stats options object or preset name.
  2629. */
  2630. stats?:
  2631. | boolean
  2632. | StatsOptions
  2633. | "none"
  2634. | "verbose"
  2635. | "summary"
  2636. | "errors-only"
  2637. | "errors-warnings"
  2638. | "minimal"
  2639. | "normal"
  2640. | "detailed";
  2641. /**
  2642. * Environment to build for. An array of environments to build for all of them when possible.
  2643. */
  2644. target?: string | false | string[];
  2645. /**
  2646. * Enter watch mode, which rebuilds on file change.
  2647. */
  2648. watch?: boolean;
  2649. /**
  2650. * Options for the watcher.
  2651. */
  2652. watchOptions?: WatchOptions;
  2653. }
  2654. type ConnectionState =
  2655. | boolean
  2656. | typeof TRANSITIVE_ONLY
  2657. | typeof CIRCULAR_CONNECTION;
  2658. declare class ConstDependency extends NullDependency {
  2659. constructor(
  2660. expression: string,
  2661. range: number | [number, number],
  2662. runtimeRequirements?: null | string[]
  2663. );
  2664. expression: string;
  2665. range: number | [number, number];
  2666. runtimeRequirements: null | Set<string>;
  2667. static Template: typeof ConstDependencyTemplate;
  2668. static NO_EXPORTS_REFERENCED: string[][];
  2669. static EXPORTS_OBJECT_REFERENCED: string[][];
  2670. static TRANSITIVE: typeof TRANSITIVE;
  2671. }
  2672. declare class ConstDependencyTemplate extends NullDependencyTemplate {
  2673. constructor();
  2674. }
  2675. declare interface Constructor {
  2676. new (...params: any[]): any;
  2677. }
  2678. declare class ConsumeSharedPlugin {
  2679. constructor(options: ConsumeSharedPluginOptions);
  2680. /**
  2681. * Apply the plugin
  2682. */
  2683. apply(compiler: Compiler): void;
  2684. }
  2685. /**
  2686. * Options for consuming shared modules.
  2687. */
  2688. declare interface ConsumeSharedPluginOptions {
  2689. /**
  2690. * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.
  2691. */
  2692. consumes: Consumes;
  2693. /**
  2694. * Share scope name used for all consumed modules (defaults to 'default').
  2695. */
  2696. shareScope?: string;
  2697. }
  2698. type Consumes = (string | ConsumesObject)[] | ConsumesObject;
  2699. /**
  2700. * Advanced configuration for modules that should be consumed from share scope.
  2701. */
  2702. declare interface ConsumesConfig {
  2703. /**
  2704. * 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.
  2705. */
  2706. eager?: boolean;
  2707. /**
  2708. * Fallback module if no shared module is found in share scope. Defaults to the property name.
  2709. */
  2710. import?: string | false;
  2711. /**
  2712. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  2713. */
  2714. packageName?: string;
  2715. /**
  2716. * Version requirement from module in share scope.
  2717. */
  2718. requiredVersion?: string | false;
  2719. /**
  2720. * Module is looked up under this key from the share scope.
  2721. */
  2722. shareKey?: string;
  2723. /**
  2724. * Share scope name.
  2725. */
  2726. shareScope?: string;
  2727. /**
  2728. * Allow only a single version of the shared module in share scope (disabled by default).
  2729. */
  2730. singleton?: boolean;
  2731. /**
  2732. * 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).
  2733. */
  2734. strictVersion?: boolean;
  2735. }
  2736. /**
  2737. * 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.
  2738. */
  2739. declare interface ConsumesObject {
  2740. [index: string]: string | ConsumesConfig;
  2741. }
  2742. type ContainerOptionsFormat<T> = Item<T> | (string | Item<T>)[];
  2743. declare class ContainerPlugin {
  2744. constructor(options: ContainerPluginOptions);
  2745. /**
  2746. * Apply the plugin
  2747. */
  2748. apply(compiler: Compiler): void;
  2749. }
  2750. declare interface ContainerPluginOptions {
  2751. /**
  2752. * 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.
  2753. */
  2754. exposes: Exposes;
  2755. /**
  2756. * The filename for this container relative path inside the `output.path` directory.
  2757. */
  2758. filename?: string;
  2759. /**
  2760. * Options for library.
  2761. */
  2762. library?: LibraryOptions;
  2763. /**
  2764. * The name for this container.
  2765. */
  2766. name: string;
  2767. /**
  2768. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  2769. */
  2770. runtime?: string | false;
  2771. /**
  2772. * The name of the share scope which is shared with the host (defaults to 'default').
  2773. */
  2774. shareScope?: string;
  2775. }
  2776. declare class ContainerReferencePlugin {
  2777. constructor(options: ContainerReferencePluginOptions);
  2778. /**
  2779. * Apply the plugin
  2780. */
  2781. apply(compiler: Compiler): void;
  2782. }
  2783. declare interface ContainerReferencePluginOptions {
  2784. /**
  2785. * The external type of the remote containers.
  2786. */
  2787. remoteType: ExternalsType;
  2788. /**
  2789. * 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.
  2790. */
  2791. remotes: Remotes;
  2792. /**
  2793. * The name of the share scope shared with all remotes (defaults to 'default').
  2794. */
  2795. shareScope?: string;
  2796. }
  2797. declare interface ContextAlternativeRequest {
  2798. context: string;
  2799. request: string;
  2800. }
  2801. declare abstract class ContextElementDependency extends ModuleDependency {
  2802. referencedExports?: null | string[][];
  2803. }
  2804. declare class ContextExclusionPlugin {
  2805. constructor(negativeMatcher: RegExp);
  2806. negativeMatcher: RegExp;
  2807. /**
  2808. * Apply the plugin
  2809. */
  2810. apply(compiler: Compiler): void;
  2811. }
  2812. declare interface ContextFileSystemInfoEntry {
  2813. safeTime: number;
  2814. timestampHash?: string;
  2815. resolved?: ResolvedContextFileSystemInfoEntry;
  2816. symlinks?: Set<string>;
  2817. }
  2818. declare interface ContextHash {
  2819. hash: string;
  2820. resolved?: string;
  2821. symlinks?: Set<string>;
  2822. }
  2823. type ContextMode =
  2824. | "weak"
  2825. | "eager"
  2826. | "lazy"
  2827. | "lazy-once"
  2828. | "sync"
  2829. | "async-weak";
  2830. declare abstract class ContextModuleFactory extends ModuleFactory {
  2831. hooks: Readonly<{
  2832. beforeResolve: AsyncSeriesWaterfallHook<[any]>;
  2833. afterResolve: AsyncSeriesWaterfallHook<[any]>;
  2834. contextModuleFiles: SyncWaterfallHook<[string[]]>;
  2835. alternatives: FakeHook<
  2836. Pick<
  2837. AsyncSeriesWaterfallHook<[ContextAlternativeRequest[]]>,
  2838. "name" | "tap" | "tapAsync" | "tapPromise"
  2839. >
  2840. >;
  2841. alternativeRequests: AsyncSeriesWaterfallHook<
  2842. [ContextAlternativeRequest[], ContextModuleOptions]
  2843. >;
  2844. }>;
  2845. resolverFactory: ResolverFactory;
  2846. resolveDependencies(
  2847. fs: InputFileSystem,
  2848. options: ContextModuleOptions,
  2849. callback: (
  2850. err: null | Error,
  2851. dependencies?: ContextElementDependency[]
  2852. ) => any
  2853. ): void;
  2854. }
  2855. declare interface ContextModuleOptions {
  2856. mode: ContextMode;
  2857. recursive: boolean;
  2858. regExp: RegExp;
  2859. namespaceObject?: boolean | "strict";
  2860. addon?: string;
  2861. chunkName?: null | string;
  2862. include?: null | RegExp;
  2863. exclude?: null | RegExp;
  2864. groupOptions?: RawChunkGroupOptions;
  2865. typePrefix?: string;
  2866. category?: string;
  2867. /**
  2868. * exports referenced from modules (won't be mangled)
  2869. */
  2870. referencedExports?: null | string[][];
  2871. layer?: string;
  2872. attributes?: ImportAttributes;
  2873. resource: string | false | string[];
  2874. resourceQuery?: string;
  2875. resourceFragment?: string;
  2876. resolveOptions: any;
  2877. }
  2878. declare class ContextReplacementPlugin {
  2879. constructor(
  2880. resourceRegExp: RegExp,
  2881. newContentResource?: any,
  2882. newContentRecursive?: any,
  2883. newContentRegExp?: RegExp
  2884. );
  2885. resourceRegExp: RegExp;
  2886. newContentCallback: any;
  2887. newContentResource: any;
  2888. newContentCreateContextMap: any;
  2889. newContentRecursive: any;
  2890. newContentRegExp?: RegExp;
  2891. /**
  2892. * Apply the plugin
  2893. */
  2894. apply(compiler: Compiler): void;
  2895. }
  2896. declare interface ContextTimestampAndHash {
  2897. safeTime: number;
  2898. timestampHash?: string;
  2899. hash: string;
  2900. resolved?: ResolvedContextTimestampAndHash;
  2901. symlinks?: Set<string>;
  2902. }
  2903. type CreateStatsOptionsContext = Record<string, any> &
  2904. KnownCreateStatsOptionsContext;
  2905. type CreateWriteStreamFSImplementation = FSImplementation & {
  2906. write: (...args: any[]) => any;
  2907. close?: (...args: any[]) => any;
  2908. };
  2909. /**
  2910. * Generator options for css/auto modules.
  2911. */
  2912. declare interface CssAutoGeneratorOptions {
  2913. /**
  2914. * Configure the generated JS modules that use the ES modules syntax.
  2915. */
  2916. esModule?: boolean;
  2917. /**
  2918. * Specifies the convention of exported names.
  2919. */
  2920. exportsConvention?:
  2921. | "as-is"
  2922. | "camel-case"
  2923. | "camel-case-only"
  2924. | "dashes"
  2925. | "dashes-only"
  2926. | ((name: string) => string);
  2927. /**
  2928. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2929. */
  2930. exportsOnly?: boolean;
  2931. /**
  2932. * Configure the generated local ident name.
  2933. */
  2934. localIdentName?: string;
  2935. }
  2936. /**
  2937. * Parser options for css/auto modules.
  2938. */
  2939. declare interface CssAutoParserOptions {
  2940. /**
  2941. * Enable/disable `@import` at-rules handling.
  2942. */
  2943. import?: boolean;
  2944. /**
  2945. * Use ES modules named export for css exports.
  2946. */
  2947. namedExports?: boolean;
  2948. /**
  2949. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  2950. */
  2951. url?: boolean;
  2952. }
  2953. /**
  2954. * Generator options for css modules.
  2955. */
  2956. declare interface CssGeneratorOptions {
  2957. /**
  2958. * Configure the generated JS modules that use the ES modules syntax.
  2959. */
  2960. esModule?: boolean;
  2961. /**
  2962. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2963. */
  2964. exportsOnly?: boolean;
  2965. }
  2966. /**
  2967. * Generator options for css/global modules.
  2968. */
  2969. declare interface CssGlobalGeneratorOptions {
  2970. /**
  2971. * Configure the generated JS modules that use the ES modules syntax.
  2972. */
  2973. esModule?: boolean;
  2974. /**
  2975. * Specifies the convention of exported names.
  2976. */
  2977. exportsConvention?:
  2978. | "as-is"
  2979. | "camel-case"
  2980. | "camel-case-only"
  2981. | "dashes"
  2982. | "dashes-only"
  2983. | ((name: string) => string);
  2984. /**
  2985. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2986. */
  2987. exportsOnly?: boolean;
  2988. /**
  2989. * Configure the generated local ident name.
  2990. */
  2991. localIdentName?: string;
  2992. }
  2993. /**
  2994. * Parser options for css/global modules.
  2995. */
  2996. declare interface CssGlobalParserOptions {
  2997. /**
  2998. * Enable/disable `@import` at-rules handling.
  2999. */
  3000. import?: boolean;
  3001. /**
  3002. * Use ES modules named export for css exports.
  3003. */
  3004. namedExports?: boolean;
  3005. /**
  3006. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  3007. */
  3008. url?: boolean;
  3009. }
  3010. declare interface CssImportDependencyMeta {
  3011. layer?: string;
  3012. supports?: string;
  3013. media?: string;
  3014. }
  3015. type CssLayer = undefined | string;
  3016. declare class CssLoadingRuntimeModule extends RuntimeModule {
  3017. constructor(runtimeRequirements: ReadonlySet<string>);
  3018. static getCompilationHooks(
  3019. compilation: Compilation
  3020. ): CssLoadingRuntimeModulePluginHooks;
  3021. /**
  3022. * Runtime modules without any dependencies to other runtime modules
  3023. */
  3024. static STAGE_NORMAL: number;
  3025. /**
  3026. * Runtime modules with simple dependencies on other runtime modules
  3027. */
  3028. static STAGE_BASIC: number;
  3029. /**
  3030. * Runtime modules which attach to handlers of other runtime modules
  3031. */
  3032. static STAGE_ATTACH: number;
  3033. /**
  3034. * Runtime modules which trigger actions on bootstrap
  3035. */
  3036. static STAGE_TRIGGER: number;
  3037. }
  3038. declare interface CssLoadingRuntimeModulePluginHooks {
  3039. createStylesheet: SyncWaterfallHook<[string, Chunk]>;
  3040. linkPreload: SyncWaterfallHook<[string, Chunk]>;
  3041. linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
  3042. }
  3043. declare abstract class CssModule extends NormalModule {
  3044. cssLayer: CssLayer;
  3045. supports: Supports;
  3046. media: Media;
  3047. inheritance: [CssLayer, Supports, Media][];
  3048. }
  3049. /**
  3050. * Generator options for css/module modules.
  3051. */
  3052. declare interface CssModuleGeneratorOptions {
  3053. /**
  3054. * Configure the generated JS modules that use the ES modules syntax.
  3055. */
  3056. esModule?: boolean;
  3057. /**
  3058. * Specifies the convention of exported names.
  3059. */
  3060. exportsConvention?:
  3061. | "as-is"
  3062. | "camel-case"
  3063. | "camel-case-only"
  3064. | "dashes"
  3065. | "dashes-only"
  3066. | ((name: string) => string);
  3067. /**
  3068. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  3069. */
  3070. exportsOnly?: boolean;
  3071. /**
  3072. * Configure the generated local ident name.
  3073. */
  3074. localIdentName?: string;
  3075. }
  3076. /**
  3077. * Parser options for css/module modules.
  3078. */
  3079. declare interface CssModuleParserOptions {
  3080. /**
  3081. * Enable/disable `@import` at-rules handling.
  3082. */
  3083. import?: boolean;
  3084. /**
  3085. * Use ES modules named export for css exports.
  3086. */
  3087. namedExports?: boolean;
  3088. /**
  3089. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  3090. */
  3091. url?: boolean;
  3092. }
  3093. declare class CssModulesPlugin {
  3094. constructor();
  3095. /**
  3096. * Apply the plugin
  3097. */
  3098. apply(compiler: Compiler): void;
  3099. getModulesInOrder(
  3100. chunk: Chunk,
  3101. modules: Iterable<Module>,
  3102. compilation: Compilation
  3103. ): Module[];
  3104. getOrderedChunkCssModules(
  3105. chunk: Chunk,
  3106. chunkGraph: ChunkGraph,
  3107. compilation: Compilation
  3108. ): Module[];
  3109. renderModule(
  3110. module: CssModule,
  3111. renderContext: ChunkRenderContextCssModulesPlugin,
  3112. hooks: CompilationHooksCssModulesPlugin
  3113. ): Source;
  3114. renderChunk(
  3115. __0: RenderContextCssModulesPlugin,
  3116. hooks: CompilationHooksCssModulesPlugin
  3117. ): Source;
  3118. static getCompilationHooks(
  3119. compilation: Compilation
  3120. ): CompilationHooksCssModulesPlugin;
  3121. static getChunkFilenameTemplate(
  3122. chunk: Chunk,
  3123. outputOptions: OutputNormalized
  3124. ): TemplatePath;
  3125. static chunkHasCss(chunk: Chunk, chunkGraph: ChunkGraph): boolean;
  3126. }
  3127. /**
  3128. * Parser options for css modules.
  3129. */
  3130. declare interface CssParserOptions {
  3131. /**
  3132. * Enable/disable `@import` at-rules handling.
  3133. */
  3134. import?: boolean;
  3135. /**
  3136. * Use ES modules named export for css exports.
  3137. */
  3138. namedExports?: boolean;
  3139. /**
  3140. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  3141. */
  3142. url?: boolean;
  3143. }
  3144. type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
  3145. declare class DefinePlugin {
  3146. /**
  3147. * Create a new define plugin
  3148. */
  3149. constructor(definitions: Record<string, CodeValue>);
  3150. definitions: Record<string, CodeValue>;
  3151. /**
  3152. * Apply the plugin
  3153. */
  3154. apply(compiler: Compiler): void;
  3155. static runtimeValue(
  3156. fn: (arg0: {
  3157. module: NormalModule;
  3158. key: string;
  3159. readonly version: ValueCacheVersion;
  3160. }) => CodeValuePrimitive,
  3161. options?: true | string[] | RuntimeValueOptions
  3162. ): RuntimeValue;
  3163. }
  3164. declare class DelegatedPlugin {
  3165. constructor(options: Options);
  3166. options: Options;
  3167. /**
  3168. * Apply the plugin
  3169. */
  3170. apply(compiler: Compiler): void;
  3171. }
  3172. declare interface DepConstructor {
  3173. new (...args: any[]): Dependency;
  3174. }
  3175. declare abstract class DependenciesBlock {
  3176. dependencies: Dependency[];
  3177. blocks: AsyncDependenciesBlock[];
  3178. parent?: DependenciesBlock;
  3179. getRootBlock(): DependenciesBlock;
  3180. /**
  3181. * Adds a DependencyBlock to DependencyBlock relationship.
  3182. * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)
  3183. */
  3184. addBlock(block: AsyncDependenciesBlock): void;
  3185. addDependency(dependency: Dependency): void;
  3186. removeDependency(dependency: Dependency): void;
  3187. /**
  3188. * Removes all dependencies and blocks
  3189. */
  3190. clearDependenciesAndBlocks(): void;
  3191. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  3192. serialize(__0: ObjectSerializerContext): void;
  3193. deserialize(__0: ObjectDeserializerContext): void;
  3194. }
  3195. declare interface DependenciesBlockLike {
  3196. dependencies: Dependency[];
  3197. blocks: AsyncDependenciesBlock[];
  3198. }
  3199. declare class Dependency {
  3200. constructor();
  3201. weak: boolean;
  3202. optional: boolean;
  3203. get type(): string;
  3204. get category(): string;
  3205. loc: DependencyLocation;
  3206. setLoc(
  3207. startLine: number,
  3208. startColumn: number,
  3209. endLine: number,
  3210. endColumn: number
  3211. ): void;
  3212. getContext(): undefined | string;
  3213. getResourceIdentifier(): null | string;
  3214. couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
  3215. /**
  3216. * Returns the referenced module and export
  3217. */
  3218. getReference(moduleGraph: ModuleGraph): never;
  3219. /**
  3220. * Returns list of exports referenced by this dependency
  3221. */
  3222. getReferencedExports(
  3223. moduleGraph: ModuleGraph,
  3224. runtime: RuntimeSpec
  3225. ): (string[] | ReferencedExport)[];
  3226. getCondition(
  3227. moduleGraph: ModuleGraph
  3228. ):
  3229. | null
  3230. | false
  3231. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
  3232. /**
  3233. * Returns the exported names
  3234. */
  3235. getExports(moduleGraph: ModuleGraph): undefined | ExportsSpec;
  3236. /**
  3237. * Returns warnings
  3238. */
  3239. getWarnings(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  3240. /**
  3241. * Returns errors
  3242. */
  3243. getErrors(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  3244. /**
  3245. * Update the hash
  3246. */
  3247. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  3248. /**
  3249. * implement this method to allow the occurrence order plugin to count correctly
  3250. */
  3251. getNumberOfIdOccurrences(): number;
  3252. getModuleEvaluationSideEffectsState(
  3253. moduleGraph: ModuleGraph
  3254. ): ConnectionState;
  3255. createIgnoredModule(context: string): null | Module;
  3256. serialize(__0: ObjectSerializerContext): void;
  3257. deserialize(__0: ObjectDeserializerContext): void;
  3258. module: any;
  3259. get disconnect(): any;
  3260. static NO_EXPORTS_REFERENCED: string[][];
  3261. static EXPORTS_OBJECT_REFERENCED: string[][];
  3262. static TRANSITIVE: typeof TRANSITIVE;
  3263. }
  3264. declare interface DependencyConstructor {
  3265. new (...args: any[]): Dependency;
  3266. }
  3267. type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
  3268. declare class DependencyTemplate {
  3269. constructor();
  3270. apply(
  3271. dependency: Dependency,
  3272. source: ReplaceSource,
  3273. templateContext: DependencyTemplateContext
  3274. ): void;
  3275. }
  3276. declare interface DependencyTemplateContext {
  3277. /**
  3278. * the runtime template
  3279. */
  3280. runtimeTemplate: RuntimeTemplate;
  3281. /**
  3282. * the dependency templates
  3283. */
  3284. dependencyTemplates: DependencyTemplates;
  3285. /**
  3286. * the module graph
  3287. */
  3288. moduleGraph: ModuleGraph;
  3289. /**
  3290. * the chunk graph
  3291. */
  3292. chunkGraph: ChunkGraph;
  3293. /**
  3294. * the requirements for runtime
  3295. */
  3296. runtimeRequirements: Set<string>;
  3297. /**
  3298. * current module
  3299. */
  3300. module: Module;
  3301. /**
  3302. * current runtimes, for which code is generated
  3303. */
  3304. runtime: RuntimeSpec;
  3305. /**
  3306. * mutable array of init fragments for the current module
  3307. */
  3308. initFragments: InitFragment<GenerateContext>[];
  3309. /**
  3310. * when in a concatenated module, information about other concatenated modules
  3311. */
  3312. concatenationScope?: ConcatenationScope;
  3313. /**
  3314. * the code generation results
  3315. */
  3316. codeGenerationResults: CodeGenerationResults;
  3317. /**
  3318. * chunkInitFragments
  3319. */
  3320. chunkInitFragments: InitFragment<GenerateContext>[];
  3321. }
  3322. declare abstract class DependencyTemplates {
  3323. get(dependency: DependencyConstructor): undefined | DependencyTemplate;
  3324. set(
  3325. dependency: DependencyConstructor,
  3326. dependencyTemplate: DependencyTemplate
  3327. ): void;
  3328. updateHash(part: string): void;
  3329. getHash(): string;
  3330. clone(): DependencyTemplates;
  3331. }
  3332. /**
  3333. * Helper function for joining two ranges into a single range. This is useful
  3334. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  3335. * to create the range of the _parent node_.
  3336. */
  3337. declare interface DestructuringAssignmentProperty {
  3338. id: string;
  3339. range?: [number, number];
  3340. shorthand: string | boolean;
  3341. }
  3342. declare class DeterministicChunkIdsPlugin {
  3343. constructor(options?: DeterministicChunkIdsPluginOptions);
  3344. options: DeterministicChunkIdsPluginOptions;
  3345. /**
  3346. * Apply the plugin
  3347. */
  3348. apply(compiler: Compiler): void;
  3349. }
  3350. declare interface DeterministicChunkIdsPluginOptions {
  3351. /**
  3352. * context for ids
  3353. */
  3354. context?: string;
  3355. /**
  3356. * maximum length of ids
  3357. */
  3358. maxLength?: number;
  3359. }
  3360. declare class DeterministicModuleIdsPlugin {
  3361. constructor(options?: DeterministicModuleIdsPluginOptions);
  3362. options: DeterministicModuleIdsPluginOptions;
  3363. /**
  3364. * Apply the plugin
  3365. */
  3366. apply(compiler: Compiler): void;
  3367. }
  3368. declare interface DeterministicModuleIdsPluginOptions {
  3369. /**
  3370. * context relative to which module identifiers are computed
  3371. */
  3372. context?: string;
  3373. /**
  3374. * selector function for modules
  3375. */
  3376. test?: (arg0: Module) => boolean;
  3377. /**
  3378. * maximum id length in digits (used as starting point)
  3379. */
  3380. maxLength?: number;
  3381. /**
  3382. * hash salt for ids
  3383. */
  3384. salt?: number;
  3385. /**
  3386. * do not increase the maxLength to find an optimal id space size
  3387. */
  3388. fixedLength?: boolean;
  3389. /**
  3390. * throw an error when id conflicts occur (instead of rehashing)
  3391. */
  3392. failOnConflict?: boolean;
  3393. }
  3394. type DevtoolModuleFilenameTemplate = string | Function;
  3395. declare interface Dirent {
  3396. isFile: () => boolean;
  3397. isDirectory: () => boolean;
  3398. isBlockDevice: () => boolean;
  3399. isCharacterDevice: () => boolean;
  3400. isSymbolicLink: () => boolean;
  3401. isFIFO: () => boolean;
  3402. isSocket: () => boolean;
  3403. name: string;
  3404. path: string;
  3405. }
  3406. declare class DllPlugin {
  3407. constructor(options: DllPluginOptions);
  3408. options: {
  3409. entryOnly: boolean;
  3410. /**
  3411. * Context of requests in the manifest file (defaults to the webpack context).
  3412. */
  3413. context?: string;
  3414. /**
  3415. * If true, manifest json file (output) will be formatted.
  3416. */
  3417. format?: boolean;
  3418. /**
  3419. * Name of the exposed dll function (external name, use value of 'output.library').
  3420. */
  3421. name?: string;
  3422. /**
  3423. * Absolute path to the manifest json file (output).
  3424. */
  3425. path: string;
  3426. /**
  3427. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  3428. */
  3429. type?: string;
  3430. };
  3431. /**
  3432. * Apply the plugin
  3433. */
  3434. apply(compiler: Compiler): void;
  3435. }
  3436. declare interface DllPluginOptions {
  3437. /**
  3438. * Context of requests in the manifest file (defaults to the webpack context).
  3439. */
  3440. context?: string;
  3441. /**
  3442. * If true, only entry points will be exposed (default: true).
  3443. */
  3444. entryOnly?: boolean;
  3445. /**
  3446. * If true, manifest json file (output) will be formatted.
  3447. */
  3448. format?: boolean;
  3449. /**
  3450. * Name of the exposed dll function (external name, use value of 'output.library').
  3451. */
  3452. name?: string;
  3453. /**
  3454. * Absolute path to the manifest json file (output).
  3455. */
  3456. path: string;
  3457. /**
  3458. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  3459. */
  3460. type?: string;
  3461. }
  3462. declare class DllReferencePlugin {
  3463. constructor(options: DllReferencePluginOptions);
  3464. options: DllReferencePluginOptions;
  3465. /**
  3466. * Apply the plugin
  3467. */
  3468. apply(compiler: Compiler): void;
  3469. }
  3470. type DllReferencePluginOptions =
  3471. | {
  3472. /**
  3473. * Context of requests in the manifest (or content property) as absolute path.
  3474. */
  3475. context?: string;
  3476. /**
  3477. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  3478. */
  3479. extensions?: string[];
  3480. /**
  3481. * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.
  3482. */
  3483. manifest: string | DllReferencePluginOptionsManifest;
  3484. /**
  3485. * The name where the dll is exposed (external name, defaults to manifest.name).
  3486. */
  3487. name?: string;
  3488. /**
  3489. * Prefix which is used for accessing the content of the dll.
  3490. */
  3491. scope?: string;
  3492. /**
  3493. * How the dll is exposed (libraryTarget, defaults to manifest.type).
  3494. */
  3495. sourceType?:
  3496. | "var"
  3497. | "assign"
  3498. | "this"
  3499. | "window"
  3500. | "global"
  3501. | "commonjs"
  3502. | "commonjs2"
  3503. | "commonjs-module"
  3504. | "amd"
  3505. | "amd-require"
  3506. | "umd"
  3507. | "umd2"
  3508. | "jsonp"
  3509. | "system";
  3510. /**
  3511. * The way how the export of the dll bundle is used.
  3512. */
  3513. type?: "object" | "require";
  3514. }
  3515. | {
  3516. /**
  3517. * The mappings from request to module info.
  3518. */
  3519. content: DllReferencePluginOptionsContent;
  3520. /**
  3521. * Context of requests in the manifest (or content property) as absolute path.
  3522. */
  3523. context?: string;
  3524. /**
  3525. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  3526. */
  3527. extensions?: string[];
  3528. /**
  3529. * The name where the dll is exposed (external name).
  3530. */
  3531. name: string;
  3532. /**
  3533. * Prefix which is used for accessing the content of the dll.
  3534. */
  3535. scope?: string;
  3536. /**
  3537. * How the dll is exposed (libraryTarget).
  3538. */
  3539. sourceType?:
  3540. | "var"
  3541. | "assign"
  3542. | "this"
  3543. | "window"
  3544. | "global"
  3545. | "commonjs"
  3546. | "commonjs2"
  3547. | "commonjs-module"
  3548. | "amd"
  3549. | "amd-require"
  3550. | "umd"
  3551. | "umd2"
  3552. | "jsonp"
  3553. | "system";
  3554. /**
  3555. * The way how the export of the dll bundle is used.
  3556. */
  3557. type?: "object" | "require";
  3558. };
  3559. /**
  3560. * The mappings from request to module info.
  3561. */
  3562. declare interface DllReferencePluginOptionsContent {
  3563. [index: string]: {
  3564. /**
  3565. * Meta information about the module.
  3566. */
  3567. buildMeta?: { [index: string]: any };
  3568. /**
  3569. * Information about the provided exports of the module.
  3570. */
  3571. exports?: true | string[];
  3572. /**
  3573. * Module ID.
  3574. */
  3575. id: string | number;
  3576. };
  3577. }
  3578. /**
  3579. * An object containing content, name and type.
  3580. */
  3581. declare interface DllReferencePluginOptionsManifest {
  3582. /**
  3583. * The mappings from request to module info.
  3584. */
  3585. content: DllReferencePluginOptionsContent;
  3586. /**
  3587. * The name where the dll is exposed (external name).
  3588. */
  3589. name?: string;
  3590. /**
  3591. * The type how the dll is exposed (external type).
  3592. */
  3593. type?:
  3594. | "var"
  3595. | "assign"
  3596. | "this"
  3597. | "window"
  3598. | "global"
  3599. | "commonjs"
  3600. | "commonjs2"
  3601. | "commonjs-module"
  3602. | "amd"
  3603. | "amd-require"
  3604. | "umd"
  3605. | "umd2"
  3606. | "jsonp"
  3607. | "system";
  3608. }
  3609. declare class DynamicEntryPlugin {
  3610. constructor(context: string, entry: () => Promise<EntryStaticNormalized>);
  3611. context: string;
  3612. entry: () => Promise<EntryStaticNormalized>;
  3613. /**
  3614. * Apply the plugin
  3615. */
  3616. apply(compiler: Compiler): void;
  3617. }
  3618. declare interface Effect {
  3619. type: string;
  3620. value: any;
  3621. }
  3622. declare interface EffectData {
  3623. [index: string]: any;
  3624. }
  3625. declare class ElectronTargetPlugin {
  3626. constructor(context?: "main" | "preload" | "renderer");
  3627. /**
  3628. * Apply the plugin
  3629. */
  3630. apply(compiler: Compiler): void;
  3631. }
  3632. /**
  3633. * No generator options are supported for this module type.
  3634. */
  3635. declare interface EmptyGeneratorOptions {}
  3636. /**
  3637. * No parser options are supported for this module type.
  3638. */
  3639. declare interface EmptyParserOptions {}
  3640. declare class EnableChunkLoadingPlugin {
  3641. constructor(type: string);
  3642. type: string;
  3643. /**
  3644. * Apply the plugin
  3645. */
  3646. apply(compiler: Compiler): void;
  3647. static setEnabled(compiler: Compiler, type: string): void;
  3648. static checkEnabled(compiler: Compiler, type: string): void;
  3649. }
  3650. declare class EnableLibraryPlugin {
  3651. constructor(type: string);
  3652. type: string;
  3653. /**
  3654. * Apply the plugin
  3655. */
  3656. apply(compiler: Compiler): void;
  3657. static setEnabled(compiler: Compiler, type: string): void;
  3658. static checkEnabled(compiler: Compiler, type: string): void;
  3659. }
  3660. declare class EnableWasmLoadingPlugin {
  3661. constructor(type: string);
  3662. type: string;
  3663. /**
  3664. * Apply the plugin
  3665. */
  3666. apply(compiler: Compiler): void;
  3667. static setEnabled(compiler: Compiler, type: string): void;
  3668. static checkEnabled(compiler: Compiler, type: string): void;
  3669. }
  3670. type EncodingOption =
  3671. | undefined
  3672. | null
  3673. | "ascii"
  3674. | "utf8"
  3675. | "utf-8"
  3676. | "utf16le"
  3677. | "utf-16le"
  3678. | "ucs2"
  3679. | "ucs-2"
  3680. | "latin1"
  3681. | "binary"
  3682. | "base64"
  3683. | "base64url"
  3684. | "hex"
  3685. | ObjectEncodingOptions;
  3686. type Entry =
  3687. | string
  3688. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  3689. | EntryObject
  3690. | string[];
  3691. declare interface EntryData {
  3692. /**
  3693. * dependencies of the entrypoint that should be evaluated at startup
  3694. */
  3695. dependencies: Dependency[];
  3696. /**
  3697. * dependencies of the entrypoint that should be included but not evaluated
  3698. */
  3699. includeDependencies: Dependency[];
  3700. /**
  3701. * options of the entrypoint
  3702. */
  3703. options: EntryOptions;
  3704. }
  3705. declare abstract class EntryDependency extends ModuleDependency {}
  3706. /**
  3707. * An object with entry point description.
  3708. */
  3709. declare interface EntryDescription {
  3710. /**
  3711. * Enable/disable creating async chunks that are loaded on demand.
  3712. */
  3713. asyncChunks?: boolean;
  3714. /**
  3715. * Base uri for this entry.
  3716. */
  3717. baseUri?: string;
  3718. /**
  3719. * 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).
  3720. */
  3721. chunkLoading?: string | false;
  3722. /**
  3723. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  3724. */
  3725. dependOn?: string | string[];
  3726. /**
  3727. * 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.
  3728. */
  3729. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3730. /**
  3731. * Module(s) that are loaded upon startup.
  3732. */
  3733. import: EntryItem;
  3734. /**
  3735. * Specifies the layer in which modules of this entrypoint are placed.
  3736. */
  3737. layer?: null | string;
  3738. /**
  3739. * Options for library.
  3740. */
  3741. library?: LibraryOptions;
  3742. /**
  3743. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  3744. */
  3745. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3746. /**
  3747. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3748. */
  3749. runtime?: string | false;
  3750. /**
  3751. * 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).
  3752. */
  3753. wasmLoading?: string | false;
  3754. }
  3755. /**
  3756. * An object with entry point description.
  3757. */
  3758. declare interface EntryDescriptionNormalized {
  3759. /**
  3760. * Enable/disable creating async chunks that are loaded on demand.
  3761. */
  3762. asyncChunks?: boolean;
  3763. /**
  3764. * Base uri for this entry.
  3765. */
  3766. baseUri?: string;
  3767. /**
  3768. * 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).
  3769. */
  3770. chunkLoading?: string | false;
  3771. /**
  3772. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  3773. */
  3774. dependOn?: string[];
  3775. /**
  3776. * 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.
  3777. */
  3778. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3779. /**
  3780. * Module(s) that are loaded upon startup. The last one is exported.
  3781. */
  3782. import?: string[];
  3783. /**
  3784. * Specifies the layer in which modules of this entrypoint are placed.
  3785. */
  3786. layer?: null | string;
  3787. /**
  3788. * Options for library.
  3789. */
  3790. library?: LibraryOptions;
  3791. /**
  3792. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  3793. */
  3794. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3795. /**
  3796. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3797. */
  3798. runtime?: string | false;
  3799. /**
  3800. * 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).
  3801. */
  3802. wasmLoading?: string | false;
  3803. }
  3804. type EntryItem = string | string[];
  3805. type EntryNormalized =
  3806. | (() => Promise<EntryStaticNormalized>)
  3807. | EntryStaticNormalized;
  3808. /**
  3809. * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.
  3810. */
  3811. declare interface EntryObject {
  3812. [index: string]: string | string[] | EntryDescription;
  3813. }
  3814. declare class EntryOptionPlugin {
  3815. constructor();
  3816. apply(compiler: Compiler): void;
  3817. static applyEntryOption(
  3818. compiler: Compiler,
  3819. context: string,
  3820. entry: EntryNormalized
  3821. ): void;
  3822. static entryDescriptionToOptions(
  3823. compiler: Compiler,
  3824. name: string,
  3825. desc: EntryDescriptionNormalized
  3826. ): EntryOptions;
  3827. }
  3828. type EntryOptions = { name?: string } & Omit<
  3829. EntryDescriptionNormalized,
  3830. "import"
  3831. >;
  3832. declare class EntryPlugin {
  3833. /**
  3834. * An entry plugin which will handle creation of the EntryDependency
  3835. */
  3836. constructor(context: string, entry: string, options?: string | EntryOptions);
  3837. context: string;
  3838. entry: string;
  3839. options: string | EntryOptions;
  3840. /**
  3841. * Apply the plugin
  3842. */
  3843. apply(compiler: Compiler): void;
  3844. static createDependency(
  3845. entry: string,
  3846. options: string | EntryOptions
  3847. ): EntryDependency;
  3848. }
  3849. type EntryStatic = string | EntryObject | string[];
  3850. /**
  3851. * Multiple entry bundles are created. The key is the entry name. The value is an entry description object.
  3852. */
  3853. declare interface EntryStaticNormalized {
  3854. [index: string]: EntryDescriptionNormalized;
  3855. }
  3856. declare abstract class Entrypoint extends ChunkGroup {
  3857. /**
  3858. * Sets the runtimeChunk for an entrypoint.
  3859. */
  3860. setRuntimeChunk(chunk: Chunk): void;
  3861. /**
  3862. * Fetches the chunk reference containing the webpack bootstrap code
  3863. */
  3864. getRuntimeChunk(): null | Chunk;
  3865. /**
  3866. * Sets the chunk with the entrypoint modules for an entrypoint.
  3867. */
  3868. setEntrypointChunk(chunk: Chunk): void;
  3869. /**
  3870. * Returns the chunk which contains the entrypoint modules
  3871. * (or at least the execution of them)
  3872. */
  3873. getEntrypointChunk(): Chunk;
  3874. }
  3875. /**
  3876. * The abilities of the environment where the webpack generated code should run.
  3877. */
  3878. declare interface Environment {
  3879. /**
  3880. * The environment supports arrow functions ('() => { ... }').
  3881. */
  3882. arrowFunction?: boolean;
  3883. /**
  3884. * The environment supports async function and await ('async function () { await ... }').
  3885. */
  3886. asyncFunction?: boolean;
  3887. /**
  3888. * The environment supports BigInt as literal (123n).
  3889. */
  3890. bigIntLiteral?: boolean;
  3891. /**
  3892. * The environment supports const and let for variable declarations.
  3893. */
  3894. const?: boolean;
  3895. /**
  3896. * The environment supports destructuring ('{ a, b } = obj').
  3897. */
  3898. destructuring?: boolean;
  3899. /**
  3900. * The environment supports 'document'.
  3901. */
  3902. document?: boolean;
  3903. /**
  3904. * The environment supports an async import() function to import EcmaScript modules.
  3905. */
  3906. dynamicImport?: boolean;
  3907. /**
  3908. * The environment supports an async import() is available when creating a worker.
  3909. */
  3910. dynamicImportInWorker?: boolean;
  3911. /**
  3912. * The environment supports 'for of' iteration ('for (const x of array) { ... }').
  3913. */
  3914. forOf?: boolean;
  3915. /**
  3916. * The environment supports 'globalThis'.
  3917. */
  3918. globalThis?: boolean;
  3919. /**
  3920. * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
  3921. */
  3922. module?: boolean;
  3923. /**
  3924. * The environment supports `node:` prefix for Node.js core modules.
  3925. */
  3926. nodePrefixForCoreModules?: boolean;
  3927. /**
  3928. * The environment supports optional chaining ('obj?.a' or 'obj?.()').
  3929. */
  3930. optionalChaining?: boolean;
  3931. /**
  3932. * The environment supports template literals.
  3933. */
  3934. templateLiteral?: boolean;
  3935. }
  3936. declare class EnvironmentPlugin {
  3937. constructor(...keys: (string | string[] | Record<string, any>)[]);
  3938. keys: string[];
  3939. defaultValues: Record<string, any>;
  3940. /**
  3941. * Apply the plugin
  3942. */
  3943. apply(compiler: Compiler): void;
  3944. }
  3945. type ErrorWithDetail = Error & { details?: string };
  3946. declare interface Etag {
  3947. toString: () => string;
  3948. }
  3949. declare class EvalDevToolModulePlugin {
  3950. constructor(options?: EvalDevToolModulePluginOptions);
  3951. namespace: string;
  3952. sourceUrlComment: string;
  3953. moduleFilenameTemplate: DevtoolModuleFilenameTemplate;
  3954. /**
  3955. * Apply the plugin
  3956. */
  3957. apply(compiler: Compiler): void;
  3958. }
  3959. declare interface EvalDevToolModulePluginOptions {
  3960. /**
  3961. * namespace
  3962. */
  3963. namespace?: string;
  3964. /**
  3965. * source url comment
  3966. */
  3967. sourceUrlComment?: string;
  3968. /**
  3969. * module filename template
  3970. */
  3971. moduleFilenameTemplate?: string | Function;
  3972. }
  3973. declare class EvalSourceMapDevToolPlugin {
  3974. constructor(inputOptions: string | SourceMapDevToolPluginOptions);
  3975. sourceMapComment: string;
  3976. moduleFilenameTemplate: string | Function;
  3977. namespace: string;
  3978. options: SourceMapDevToolPluginOptions;
  3979. /**
  3980. * Apply the plugin
  3981. */
  3982. apply(compiler: Compiler): void;
  3983. }
  3984. declare interface ExecuteModuleArgument {
  3985. module: Module;
  3986. moduleObject?: ModuleObject;
  3987. preparedInfo: any;
  3988. codeGenerationResult: CodeGenerationResult;
  3989. }
  3990. declare interface ExecuteModuleContext {
  3991. assets: Map<string, { source: Source; info: AssetInfo }>;
  3992. chunk: Chunk;
  3993. chunkGraph: ChunkGraph;
  3994. __webpack_require__?: (arg0: string) => any;
  3995. }
  3996. declare interface ExecuteModuleOptions {
  3997. entryOptions?: EntryOptions;
  3998. }
  3999. declare interface ExecuteModuleResult {
  4000. exports: any;
  4001. cacheable: boolean;
  4002. assets: Map<string, { source: Source; info: AssetInfo }>;
  4003. fileDependencies: LazySet<string>;
  4004. contextDependencies: LazySet<string>;
  4005. missingDependencies: LazySet<string>;
  4006. buildDependencies: LazySet<string>;
  4007. }
  4008. type Experiments = ExperimentsCommon & ExperimentsExtra;
  4009. /**
  4010. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  4011. */
  4012. declare interface ExperimentsCommon {
  4013. /**
  4014. * Support WebAssembly as asynchronous EcmaScript Module.
  4015. */
  4016. asyncWebAssembly?: boolean;
  4017. /**
  4018. * Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
  4019. */
  4020. backCompat?: boolean;
  4021. /**
  4022. * Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
  4023. */
  4024. cacheUnaffected?: boolean;
  4025. /**
  4026. * Apply defaults of next major version.
  4027. */
  4028. futureDefaults?: boolean;
  4029. /**
  4030. * Enable module layers.
  4031. */
  4032. layers?: boolean;
  4033. /**
  4034. * Allow output javascript files as module source type.
  4035. */
  4036. outputModule?: boolean;
  4037. /**
  4038. * Support WebAssembly as synchronous EcmaScript Module (outdated).
  4039. */
  4040. syncWebAssembly?: boolean;
  4041. /**
  4042. * Allow using top-level-await in EcmaScript Modules.
  4043. */
  4044. topLevelAwait?: boolean;
  4045. }
  4046. /**
  4047. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  4048. */
  4049. declare interface ExperimentsExtra {
  4050. /**
  4051. * Build http(s): urls using a lockfile and resource content cache.
  4052. */
  4053. buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
  4054. /**
  4055. * Enable css support.
  4056. */
  4057. css?: boolean;
  4058. /**
  4059. * Compile entrypoints and import()s only when they are accessed.
  4060. */
  4061. lazyCompilation?: boolean | LazyCompilationOptions;
  4062. }
  4063. type ExperimentsNormalized = ExperimentsCommon & ExperimentsNormalizedExtra;
  4064. /**
  4065. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  4066. */
  4067. declare interface ExperimentsNormalizedExtra {
  4068. /**
  4069. * Build http(s): urls using a lockfile and resource content cache.
  4070. */
  4071. buildHttp?: HttpUriOptions;
  4072. /**
  4073. * Enable css support.
  4074. */
  4075. css?: boolean;
  4076. /**
  4077. * Compile entrypoints and import()s only when they are accessed.
  4078. */
  4079. lazyCompilation?: false | LazyCompilationOptions;
  4080. }
  4081. type ExportAllDeclarationJavascriptParser = ExportAllDeclarationImport & {
  4082. attributes?: ImportAttribute[];
  4083. };
  4084. declare abstract class ExportInfo {
  4085. name: string;
  4086. /**
  4087. * true: it is provided
  4088. * false: it is not provided
  4089. * null: only the runtime knows if it is provided
  4090. * undefined: it was not determined if it is provided
  4091. */
  4092. provided?: null | boolean;
  4093. /**
  4094. * is the export a terminal binding that should be checked for export star conflicts
  4095. */
  4096. terminalBinding: boolean;
  4097. /**
  4098. * true: it can be mangled
  4099. * false: is can not be mangled
  4100. * undefined: it was not determined if it can be mangled
  4101. */
  4102. canMangleProvide?: boolean;
  4103. /**
  4104. * true: it can be mangled
  4105. * false: is can not be mangled
  4106. * undefined: it was not determined if it can be mangled
  4107. */
  4108. canMangleUse?: boolean;
  4109. exportsInfoOwned: boolean;
  4110. exportsInfo?: ExportsInfo;
  4111. get canMangle(): boolean;
  4112. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  4113. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  4114. setHasUseInfo(): void;
  4115. setUsedConditionally(
  4116. condition: (arg0: UsageStateType) => boolean,
  4117. newValue: UsageStateType,
  4118. runtime: RuntimeSpec
  4119. ): boolean;
  4120. setUsed(newValue: UsageStateType, runtime: RuntimeSpec): boolean;
  4121. unsetTarget(key?: any): boolean;
  4122. setTarget(
  4123. key: any,
  4124. connection: ModuleGraphConnection,
  4125. exportName?: null | string[],
  4126. priority?: number
  4127. ): boolean;
  4128. getUsed(runtime: RuntimeSpec): UsageStateType;
  4129. /**
  4130. * get used name
  4131. */
  4132. getUsedName(
  4133. fallbackName: undefined | string,
  4134. runtime: RuntimeSpec
  4135. ): string | false;
  4136. hasUsedName(): boolean;
  4137. /**
  4138. * Sets the mangled name of this export
  4139. */
  4140. setUsedName(name: string): void;
  4141. getTerminalBinding(
  4142. moduleGraph: ModuleGraph,
  4143. resolveTargetFilter?: (arg0: TargetItem) => boolean
  4144. ): undefined | ExportsInfo | ExportInfo;
  4145. isReexport(): undefined | boolean;
  4146. findTarget(
  4147. moduleGraph: ModuleGraph,
  4148. validTargetModuleFilter: (arg0: Module) => boolean
  4149. ): undefined | null | false | TargetItemWithoutConnection;
  4150. getTarget(
  4151. moduleGraph: ModuleGraph,
  4152. resolveTargetFilter?: (arg0: TargetItem) => boolean
  4153. ): undefined | TargetItem;
  4154. /**
  4155. * Move the target forward as long resolveTargetFilter is fulfilled
  4156. */
  4157. moveTarget(
  4158. moduleGraph: ModuleGraph,
  4159. resolveTargetFilter: (arg0: TargetItem) => boolean,
  4160. updateOriginalConnection?: (arg0: TargetItem) => ModuleGraphConnection
  4161. ): undefined | TargetItem;
  4162. createNestedExportsInfo(): ExportsInfo;
  4163. getNestedExportsInfo(): undefined | ExportsInfo;
  4164. hasInfo(baseInfo: ExportInfo, runtime: RuntimeSpec): boolean;
  4165. updateHash(hash: Hash, runtime: RuntimeSpec): void;
  4166. getUsedInfo(): string;
  4167. getProvidedInfo():
  4168. | "no provided info"
  4169. | "maybe provided (runtime-defined)"
  4170. | "provided"
  4171. | "not provided";
  4172. getRenameInfo(): string;
  4173. }
  4174. type ExportNamedDeclarationJavascriptParser = ExportNamedDeclarationImport & {
  4175. attributes?: ImportAttribute[];
  4176. };
  4177. declare interface ExportSpec {
  4178. /**
  4179. * the name of the export
  4180. */
  4181. name: string;
  4182. /**
  4183. * can the export be renamed (defaults to true)
  4184. */
  4185. canMangle?: boolean;
  4186. /**
  4187. * is the export a terminal binding that should be checked for export star conflicts
  4188. */
  4189. terminalBinding?: boolean;
  4190. /**
  4191. * nested exports
  4192. */
  4193. exports?: (string | ExportSpec)[];
  4194. /**
  4195. * when reexported: from which module
  4196. */
  4197. from?: ModuleGraphConnection;
  4198. /**
  4199. * when reexported: from which export
  4200. */
  4201. export?: null | string[];
  4202. /**
  4203. * when reexported: with which priority
  4204. */
  4205. priority?: number;
  4206. /**
  4207. * export is not visible, because another export blends over it
  4208. */
  4209. hidden?: boolean;
  4210. }
  4211. type ExportedVariableInfo = string | VariableInfo | ScopeInfo;
  4212. declare abstract class ExportsInfo {
  4213. get ownedExports(): Iterable<ExportInfo>;
  4214. get orderedOwnedExports(): Iterable<ExportInfo>;
  4215. get exports(): Iterable<ExportInfo>;
  4216. get orderedExports(): Iterable<ExportInfo>;
  4217. get otherExportsInfo(): ExportInfo;
  4218. setRedirectNamedTo(exportsInfo?: ExportsInfo): boolean;
  4219. setHasProvideInfo(): void;
  4220. setHasUseInfo(): void;
  4221. getOwnExportInfo(name: string): ExportInfo;
  4222. getExportInfo(name: string): ExportInfo;
  4223. getReadOnlyExportInfo(name: string): ExportInfo;
  4224. getReadOnlyExportInfoRecursive(name: string[]): undefined | ExportInfo;
  4225. getNestedExportsInfo(name?: string[]): undefined | ExportsInfo;
  4226. setUnknownExportsProvided(
  4227. canMangle?: boolean,
  4228. excludeExports?: Set<string>,
  4229. targetKey?: any,
  4230. targetModule?: ModuleGraphConnection,
  4231. priority?: number
  4232. ): boolean;
  4233. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  4234. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  4235. setAllKnownExportsUsed(runtime: RuntimeSpec): boolean;
  4236. setUsedForSideEffectsOnly(runtime: RuntimeSpec): boolean;
  4237. isUsed(runtime: RuntimeSpec): boolean;
  4238. isModuleUsed(runtime: RuntimeSpec): boolean;
  4239. getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
  4240. getProvidedExports(): null | true | string[];
  4241. getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
  4242. isExportProvided(name: string | string[]): undefined | null | boolean;
  4243. getUsageKey(runtime: RuntimeSpec): string;
  4244. isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
  4245. getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
  4246. getUsedName(name: string | string[], runtime: RuntimeSpec): UsedName;
  4247. updateHash(hash: Hash, runtime: RuntimeSpec): void;
  4248. getRestoreProvidedData(): RestoreProvidedData;
  4249. restoreProvided(__0: {
  4250. otherProvided: any;
  4251. otherCanMangleProvide: any;
  4252. otherTerminalBinding: any;
  4253. exports: any;
  4254. }): void;
  4255. }
  4256. declare interface ExportsSpec {
  4257. /**
  4258. * exported names, true for unknown exports or null for no exports
  4259. */
  4260. exports: null | true | (string | ExportSpec)[];
  4261. /**
  4262. * when exports = true, list of unaffected exports
  4263. */
  4264. excludeExports?: Set<string>;
  4265. /**
  4266. * list of maybe prior exposed, but now hidden exports
  4267. */
  4268. hideExports?: null | Set<string>;
  4269. /**
  4270. * when reexported: from which module
  4271. */
  4272. from?: ModuleGraphConnection;
  4273. /**
  4274. * when reexported: with which priority
  4275. */
  4276. priority?: number;
  4277. /**
  4278. * can the export be renamed (defaults to true)
  4279. */
  4280. canMangle?: boolean;
  4281. /**
  4282. * are the exports terminal bindings that should be checked for export star conflicts
  4283. */
  4284. terminalBinding?: boolean;
  4285. /**
  4286. * module on which the result depends on
  4287. */
  4288. dependencies?: Module[];
  4289. }
  4290. type Exposes = (string | ExposesObject)[] | ExposesObject;
  4291. /**
  4292. * Advanced configuration for modules that should be exposed by this container.
  4293. */
  4294. declare interface ExposesConfig {
  4295. /**
  4296. * Request to a module that should be exposed by this container.
  4297. */
  4298. import: string | string[];
  4299. /**
  4300. * Custom chunk name for the exposed module.
  4301. */
  4302. name?: string;
  4303. }
  4304. /**
  4305. * Modules that should be exposed by this container. Property names are used as public paths.
  4306. */
  4307. declare interface ExposesObject {
  4308. [index: string]: string | ExposesConfig | string[];
  4309. }
  4310. type Expression =
  4311. | ImportExpressionImport
  4312. | UnaryExpression
  4313. | ArrayExpression
  4314. | ArrowFunctionExpression
  4315. | AssignmentExpression
  4316. | AwaitExpression
  4317. | BinaryExpression
  4318. | SimpleCallExpression
  4319. | NewExpression
  4320. | ChainExpression
  4321. | ClassExpression
  4322. | ConditionalExpression
  4323. | FunctionExpression
  4324. | Identifier
  4325. | SimpleLiteral
  4326. | RegExpLiteral
  4327. | BigIntLiteral
  4328. | LogicalExpression
  4329. | MemberExpression
  4330. | MetaProperty
  4331. | ObjectExpression
  4332. | SequenceExpression
  4333. | TaggedTemplateExpression
  4334. | TemplateLiteral
  4335. | ThisExpression
  4336. | UpdateExpression
  4337. | YieldExpression;
  4338. declare interface ExpressionExpressionInfo {
  4339. type: "expression";
  4340. rootInfo: string | VariableInfo;
  4341. name: string;
  4342. getMembers: () => string[];
  4343. getMembersOptionals: () => boolean[];
  4344. getMemberRanges: () => [number, number][];
  4345. }
  4346. declare interface ExtensionAliasOption {
  4347. alias: string | string[];
  4348. extension: string;
  4349. }
  4350. declare interface ExtensionAliasOptions {
  4351. [index: string]: string | string[];
  4352. }
  4353. type ExternalItem =
  4354. | string
  4355. | RegExp
  4356. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  4357. | ((
  4358. data: ExternalItemFunctionData,
  4359. callback: (
  4360. err?: null | Error,
  4361. result?: string | boolean | string[] | { [index: string]: any }
  4362. ) => void
  4363. ) => void)
  4364. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  4365. /**
  4366. * Data object passed as argument when a function is set for 'externals'.
  4367. */
  4368. declare interface ExternalItemFunctionData {
  4369. /**
  4370. * The directory in which the request is placed.
  4371. */
  4372. context?: string;
  4373. /**
  4374. * Contextual information.
  4375. */
  4376. contextInfo?: ModuleFactoryCreateDataContextInfo;
  4377. /**
  4378. * The category of the referencing dependencies.
  4379. */
  4380. dependencyType?: string;
  4381. /**
  4382. * Get a resolve function with the current resolver options.
  4383. */
  4384. getResolve?: (
  4385. options?: ResolveOptions
  4386. ) =>
  4387. | ((
  4388. context: string,
  4389. request: string,
  4390. callback: (err?: Error, result?: string) => void
  4391. ) => void)
  4392. | ((context: string, request: string) => Promise<string>);
  4393. /**
  4394. * The request as written by the user in the require/import expression/statement.
  4395. */
  4396. request?: string;
  4397. }
  4398. /**
  4399. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  4400. */
  4401. declare interface ExternalItemObjectKnown {
  4402. /**
  4403. * Specify externals depending on the layer.
  4404. */
  4405. byLayer?:
  4406. | { [index: string]: ExternalItem }
  4407. | ((layer: null | string) => ExternalItem);
  4408. }
  4409. /**
  4410. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  4411. */
  4412. declare interface ExternalItemObjectUnknown {
  4413. [index: string]: ExternalItemValue;
  4414. }
  4415. type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
  4416. declare class ExternalModule extends Module {
  4417. constructor(
  4418. request: string | string[] | RequestRecord,
  4419. type: string,
  4420. userRequest: string,
  4421. dependencyMeta?:
  4422. | ImportDependencyMeta
  4423. | CssImportDependencyMeta
  4424. | AssetDependencyMeta
  4425. );
  4426. request: string | string[] | Record<string, string | string[]>;
  4427. externalType: string;
  4428. userRequest: string;
  4429. dependencyMeta?:
  4430. | ImportDependencyMeta
  4431. | CssImportDependencyMeta
  4432. | AssetDependencyMeta;
  4433. /**
  4434. * restore unsafe cache data
  4435. */
  4436. restoreFromUnsafeCache(
  4437. unsafeCacheData: object,
  4438. normalModuleFactory: NormalModuleFactory
  4439. ): void;
  4440. }
  4441. declare interface ExternalModuleInfo {
  4442. type: "external";
  4443. module: Module;
  4444. runtimeCondition?: string | boolean | SortableSet<string>;
  4445. index: number;
  4446. name?: string;
  4447. interopNamespaceObjectUsed: boolean;
  4448. interopNamespaceObjectName?: string;
  4449. interopNamespaceObject2Used: boolean;
  4450. interopNamespaceObject2Name?: string;
  4451. interopDefaultAccessUsed: boolean;
  4452. interopDefaultAccessName?: string;
  4453. }
  4454. type Externals =
  4455. | string
  4456. | RegExp
  4457. | ExternalItem[]
  4458. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  4459. | ((
  4460. data: ExternalItemFunctionData,
  4461. callback: (
  4462. err?: null | Error,
  4463. result?: string | boolean | string[] | { [index: string]: any }
  4464. ) => void
  4465. ) => void)
  4466. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  4467. declare class ExternalsPlugin {
  4468. constructor(type: undefined | string, externals: Externals);
  4469. type?: string;
  4470. externals: Externals;
  4471. /**
  4472. * Apply the plugin
  4473. */
  4474. apply(compiler: Compiler): void;
  4475. }
  4476. /**
  4477. * Enable presets of externals for specific targets.
  4478. */
  4479. declare interface ExternalsPresets {
  4480. /**
  4481. * 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.
  4482. */
  4483. electron?: boolean;
  4484. /**
  4485. * Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.
  4486. */
  4487. electronMain?: boolean;
  4488. /**
  4489. * 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.
  4490. */
  4491. electronPreload?: boolean;
  4492. /**
  4493. * 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.
  4494. */
  4495. electronRenderer?: boolean;
  4496. /**
  4497. * Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.
  4498. */
  4499. node?: boolean;
  4500. /**
  4501. * Treat NW.js legacy nw.gui module as external and load it via require() when used.
  4502. */
  4503. nwjs?: boolean;
  4504. /**
  4505. * 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).
  4506. */
  4507. web?: boolean;
  4508. /**
  4509. * 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).
  4510. */
  4511. webAsync?: boolean;
  4512. }
  4513. type ExternalsType =
  4514. | "import"
  4515. | "var"
  4516. | "module"
  4517. | "assign"
  4518. | "this"
  4519. | "window"
  4520. | "self"
  4521. | "global"
  4522. | "commonjs"
  4523. | "commonjs2"
  4524. | "commonjs-module"
  4525. | "commonjs-static"
  4526. | "amd"
  4527. | "amd-require"
  4528. | "umd"
  4529. | "umd2"
  4530. | "jsonp"
  4531. | "system"
  4532. | "promise"
  4533. | "module-import"
  4534. | "script"
  4535. | "node-commonjs";
  4536. declare interface FSImplementation {
  4537. open?: (...args: any[]) => any;
  4538. close?: (...args: any[]) => any;
  4539. }
  4540. declare interface FactorizeModuleOptions {
  4541. currentProfile?: ModuleProfile;
  4542. factory: ModuleFactory;
  4543. dependencies: Dependency[];
  4544. /**
  4545. * return full ModuleFactoryResult instead of only module
  4546. */
  4547. factoryResult?: boolean;
  4548. originModule: null | Module;
  4549. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  4550. context?: string;
  4551. }
  4552. declare interface FactoryMeta {
  4553. sideEffectFree?: boolean;
  4554. }
  4555. type FakeHook<T> = T & FakeHookMarker;
  4556. declare interface FakeHookMarker {}
  4557. declare interface FallbackCacheGroup {
  4558. chunksFilter: (chunk: Chunk) => undefined | boolean;
  4559. minSize: SplitChunksSizes;
  4560. maxAsyncSize: SplitChunksSizes;
  4561. maxInitialSize: SplitChunksSizes;
  4562. automaticNameDelimiter: string;
  4563. }
  4564. declare class FetchCompileAsyncWasmPlugin {
  4565. constructor();
  4566. /**
  4567. * Apply the plugin
  4568. */
  4569. apply(compiler: Compiler): void;
  4570. }
  4571. declare class FetchCompileWasmPlugin {
  4572. constructor(options?: FetchCompileWasmPluginOptions);
  4573. options: FetchCompileWasmPluginOptions;
  4574. /**
  4575. * Apply the plugin
  4576. */
  4577. apply(compiler: Compiler): void;
  4578. }
  4579. declare interface FetchCompileWasmPluginOptions {
  4580. /**
  4581. * mangle imports
  4582. */
  4583. mangleImports?: boolean;
  4584. }
  4585. /**
  4586. * Options object for persistent file-based caching.
  4587. */
  4588. declare interface FileCacheOptions {
  4589. /**
  4590. * Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.
  4591. */
  4592. allowCollectingMemory?: boolean;
  4593. /**
  4594. * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').
  4595. */
  4596. buildDependencies?: { [index: string]: string[] };
  4597. /**
  4598. * Base directory for the cache (defaults to node_modules/.cache/webpack).
  4599. */
  4600. cacheDirectory?: string;
  4601. /**
  4602. * Locations for the cache (defaults to cacheDirectory / name).
  4603. */
  4604. cacheLocation?: string;
  4605. /**
  4606. * Compression type used for the cache files.
  4607. */
  4608. compression?: false | "gzip" | "brotli";
  4609. /**
  4610. * Algorithm used for generation the hash (see node.js crypto package).
  4611. */
  4612. hashAlgorithm?: string;
  4613. /**
  4614. * Time in ms after which idle period the cache storing should happen.
  4615. */
  4616. idleTimeout?: number;
  4617. /**
  4618. * 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).
  4619. */
  4620. idleTimeoutAfterLargeChanges?: number;
  4621. /**
  4622. * Time in ms after which idle period the initial cache storing should happen.
  4623. */
  4624. idleTimeoutForInitialStore?: number;
  4625. /**
  4626. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  4627. */
  4628. immutablePaths?: (string | RegExp)[];
  4629. /**
  4630. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  4631. */
  4632. managedPaths?: (string | RegExp)[];
  4633. /**
  4634. * Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).
  4635. */
  4636. maxAge?: number;
  4637. /**
  4638. * 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.
  4639. */
  4640. maxMemoryGenerations?: number;
  4641. /**
  4642. * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
  4643. */
  4644. memoryCacheUnaffected?: boolean;
  4645. /**
  4646. * Name for the cache. Different names will lead to different coexisting caches.
  4647. */
  4648. name?: string;
  4649. /**
  4650. * Track and log detailed timing information for individual cache items.
  4651. */
  4652. profile?: boolean;
  4653. /**
  4654. * Enable/disable readonly mode.
  4655. */
  4656. readonly?: boolean;
  4657. /**
  4658. * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
  4659. */
  4660. store?: "pack";
  4661. /**
  4662. * Filesystem caching.
  4663. */
  4664. type: "filesystem";
  4665. /**
  4666. * 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.
  4667. */
  4668. version?: string;
  4669. }
  4670. declare interface FileSystem {
  4671. readFile: ReadFileTypes;
  4672. readdir: ReaddirTypes;
  4673. readJson?: (
  4674. arg0: PathOrFileDescriptorTypes,
  4675. arg1: (
  4676. arg0: null | Error | NodeJS.ErrnoException,
  4677. arg1?: JsonObjectTypes
  4678. ) => void
  4679. ) => void;
  4680. readlink: ReadlinkTypes;
  4681. lstat?: LStatTypes;
  4682. stat: StatTypes;
  4683. realpath?: RealPathTypes;
  4684. }
  4685. declare abstract class FileSystemInfo {
  4686. fs: InputFileSystem;
  4687. logger?: WebpackLogger;
  4688. fileTimestampQueue: AsyncQueue<string, string, FileSystemInfoEntry>;
  4689. fileHashQueue: AsyncQueue<string, string, string>;
  4690. contextTimestampQueue: AsyncQueue<string, string, ContextFileSystemInfoEntry>;
  4691. contextHashQueue: AsyncQueue<string, string, ContextHash>;
  4692. contextTshQueue: AsyncQueue<string, string, ContextTimestampAndHash>;
  4693. managedItemQueue: AsyncQueue<string, string, string>;
  4694. managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
  4695. unmanagedPathsWithSlash: string[];
  4696. unmanagedPathsRegExps: RegExp[];
  4697. managedPaths: (string | RegExp)[];
  4698. managedPathsWithSlash: string[];
  4699. managedPathsRegExps: RegExp[];
  4700. immutablePaths: (string | RegExp)[];
  4701. immutablePathsWithSlash: string[];
  4702. immutablePathsRegExps: RegExp[];
  4703. logStatistics(): void;
  4704. clear(): void;
  4705. addFileTimestamps(
  4706. map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
  4707. immutable?: boolean
  4708. ): void;
  4709. addContextTimestamps(
  4710. map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
  4711. immutable?: boolean
  4712. ): void;
  4713. getFileTimestamp(
  4714. path: string,
  4715. callback: (
  4716. arg0?: null | WebpackError,
  4717. arg1?: null | FileSystemInfoEntry | "ignore"
  4718. ) => void
  4719. ): void;
  4720. getContextTimestamp(
  4721. path: string,
  4722. callback: (
  4723. arg0?: null | WebpackError,
  4724. arg1?: null | "ignore" | ResolvedContextFileSystemInfoEntry
  4725. ) => void
  4726. ): void;
  4727. getFileHash(
  4728. path: string,
  4729. callback: (arg0?: null | WebpackError, arg1?: null | string) => void
  4730. ): void;
  4731. getContextHash(
  4732. path: string,
  4733. callback: (arg0?: null | WebpackError, arg1?: string) => void
  4734. ): void;
  4735. getContextTsh(
  4736. path: string,
  4737. callback: (
  4738. arg0?: null | WebpackError,
  4739. arg1?: null | ResolvedContextTimestampAndHash
  4740. ) => void
  4741. ): void;
  4742. resolveBuildDependencies(
  4743. context: string,
  4744. deps: Iterable<string>,
  4745. callback: (
  4746. arg0?: null | Error,
  4747. arg1?: ResolveBuildDependenciesResult
  4748. ) => void
  4749. ): void;
  4750. checkResolveResultsValid(
  4751. resolveResults: Map<string, string | false>,
  4752. callback: (arg0?: null | Error, arg1?: boolean) => void
  4753. ): void;
  4754. createSnapshot(
  4755. startTime: undefined | null | number,
  4756. files: null | Iterable<string>,
  4757. directories: null | Iterable<string>,
  4758. missing: null | Iterable<string>,
  4759. options: undefined | null | SnapshotOptionsFileSystemInfo,
  4760. callback: (arg0: null | WebpackError, arg1: null | Snapshot) => void
  4761. ): void;
  4762. mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
  4763. checkSnapshotValid(
  4764. snapshot: Snapshot,
  4765. callback: (arg0?: null | WebpackError, arg1?: boolean) => void
  4766. ): void;
  4767. getDeprecatedFileTimestamps(): Map<any, any>;
  4768. getDeprecatedContextTimestamps(): Map<any, any>;
  4769. }
  4770. declare interface FileSystemInfoEntry {
  4771. safeTime: number;
  4772. timestamp?: number;
  4773. }
  4774. type FilterItemTypes = string | RegExp | ((value: string) => boolean);
  4775. declare interface Flags {
  4776. [index: string]: Argument;
  4777. }
  4778. declare interface GenerateContext {
  4779. /**
  4780. * mapping from dependencies to templates
  4781. */
  4782. dependencyTemplates: DependencyTemplates;
  4783. /**
  4784. * the runtime template
  4785. */
  4786. runtimeTemplate: RuntimeTemplate;
  4787. /**
  4788. * the module graph
  4789. */
  4790. moduleGraph: ModuleGraph;
  4791. /**
  4792. * the chunk graph
  4793. */
  4794. chunkGraph: ChunkGraph;
  4795. /**
  4796. * the requirements for runtime
  4797. */
  4798. runtimeRequirements: Set<string>;
  4799. /**
  4800. * the runtime
  4801. */
  4802. runtime: RuntimeSpec;
  4803. /**
  4804. * when in concatenated module, information about other concatenated modules
  4805. */
  4806. concatenationScope?: ConcatenationScope;
  4807. /**
  4808. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  4809. */
  4810. codeGenerationResults?: CodeGenerationResults;
  4811. /**
  4812. * which kind of code should be generated
  4813. */
  4814. type: string;
  4815. /**
  4816. * get access to the code generation data
  4817. */
  4818. getData?: () => Map<string, any>;
  4819. }
  4820. declare class Generator {
  4821. constructor();
  4822. getTypes(module: NormalModule): ReadonlySet<string>;
  4823. getSize(module: NormalModule, type?: string): number;
  4824. generate(module: NormalModule, __1: GenerateContext): null | Source;
  4825. getConcatenationBailoutReason(
  4826. module: NormalModule,
  4827. context: ConcatenationBailoutReasonContext
  4828. ): undefined | string;
  4829. updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
  4830. static byType(map: Record<string, Generator>): ByTypeGenerator;
  4831. }
  4832. declare interface GeneratorOptions {
  4833. [index: string]: any;
  4834. }
  4835. type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
  4836. GeneratorOptionsByModuleTypeUnknown;
  4837. /**
  4838. * Specify options for each generator.
  4839. */
  4840. declare interface GeneratorOptionsByModuleTypeKnown {
  4841. /**
  4842. * Generator options for asset modules.
  4843. */
  4844. asset?: AssetGeneratorOptions;
  4845. /**
  4846. * Generator options for asset/inline modules.
  4847. */
  4848. "asset/inline"?: AssetInlineGeneratorOptions;
  4849. /**
  4850. * Generator options for asset/resource modules.
  4851. */
  4852. "asset/resource"?: AssetResourceGeneratorOptions;
  4853. /**
  4854. * Generator options for css modules.
  4855. */
  4856. css?: CssGeneratorOptions;
  4857. /**
  4858. * Generator options for css/auto modules.
  4859. */
  4860. "css/auto"?: CssAutoGeneratorOptions;
  4861. /**
  4862. * Generator options for css/global modules.
  4863. */
  4864. "css/global"?: CssGlobalGeneratorOptions;
  4865. /**
  4866. * Generator options for css/module modules.
  4867. */
  4868. "css/module"?: CssModuleGeneratorOptions;
  4869. /**
  4870. * No generator options are supported for this module type.
  4871. */
  4872. javascript?: EmptyGeneratorOptions;
  4873. /**
  4874. * No generator options are supported for this module type.
  4875. */
  4876. "javascript/auto"?: EmptyGeneratorOptions;
  4877. /**
  4878. * No generator options are supported for this module type.
  4879. */
  4880. "javascript/dynamic"?: EmptyGeneratorOptions;
  4881. /**
  4882. * No generator options are supported for this module type.
  4883. */
  4884. "javascript/esm"?: EmptyGeneratorOptions;
  4885. }
  4886. /**
  4887. * Specify options for each generator.
  4888. */
  4889. declare interface GeneratorOptionsByModuleTypeUnknown {
  4890. [index: string]: { [index: string]: any };
  4891. }
  4892. declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
  4893. constructor(
  4894. contentType: string,
  4895. name: string,
  4896. global: string,
  4897. getFilenameForChunk: (
  4898. arg0: Chunk
  4899. ) => string | false | ((arg0: PathData, arg1?: AssetInfo) => string),
  4900. allChunks: boolean
  4901. );
  4902. contentType: string;
  4903. global: string;
  4904. getFilenameForChunk: (
  4905. arg0: Chunk
  4906. ) => string | false | ((arg0: PathData, arg1?: AssetInfo) => string);
  4907. allChunks: boolean;
  4908. /**
  4909. * Runtime modules without any dependencies to other runtime modules
  4910. */
  4911. static STAGE_NORMAL: number;
  4912. /**
  4913. * Runtime modules with simple dependencies on other runtime modules
  4914. */
  4915. static STAGE_BASIC: number;
  4916. /**
  4917. * Runtime modules which attach to handlers of other runtime modules
  4918. */
  4919. static STAGE_ATTACH: number;
  4920. /**
  4921. * Runtime modules which trigger actions on bootstrap
  4922. */
  4923. static STAGE_TRIGGER: number;
  4924. }
  4925. declare interface GroupConfig {
  4926. getKeys: (arg0?: any) => undefined | string[];
  4927. createGroup: (arg0: string, arg1: any[], arg2: any[]) => object;
  4928. getOptions?: (arg0: string, arg1: any[]) => GroupOptions;
  4929. }
  4930. declare interface GroupOptions {
  4931. groupChildren?: boolean;
  4932. force?: boolean;
  4933. targetGroupCount?: number;
  4934. }
  4935. declare interface HMRJavascriptParserHooks {
  4936. hotAcceptCallback: SyncBailHook<
  4937. [
  4938. (
  4939. | ImportExpressionImport
  4940. | UnaryExpression
  4941. | ArrayExpression
  4942. | ArrowFunctionExpression
  4943. | AssignmentExpression
  4944. | AwaitExpression
  4945. | BinaryExpression
  4946. | SimpleCallExpression
  4947. | NewExpression
  4948. | ChainExpression
  4949. | ClassExpression
  4950. | ConditionalExpression
  4951. | FunctionExpression
  4952. | Identifier
  4953. | SimpleLiteral
  4954. | RegExpLiteral
  4955. | BigIntLiteral
  4956. | LogicalExpression
  4957. | MemberExpression
  4958. | MetaProperty
  4959. | ObjectExpression
  4960. | SequenceExpression
  4961. | TaggedTemplateExpression
  4962. | TemplateLiteral
  4963. | ThisExpression
  4964. | UpdateExpression
  4965. | YieldExpression
  4966. | SpreadElement
  4967. ),
  4968. string[]
  4969. ],
  4970. void
  4971. >;
  4972. hotAcceptWithoutCallback: SyncBailHook<[CallExpression, string[]], void>;
  4973. }
  4974. declare interface HandleModuleCreationOptions {
  4975. factory: ModuleFactory;
  4976. dependencies: Dependency[];
  4977. originModule: null | Module;
  4978. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  4979. context?: string;
  4980. /**
  4981. * recurse into dependencies of the created module
  4982. */
  4983. recursive?: boolean;
  4984. /**
  4985. * connect the resolved module with the origin module
  4986. */
  4987. connectOrigin?: boolean;
  4988. /**
  4989. * check the cycle dependencies of the created module
  4990. */
  4991. checkCycle?: boolean;
  4992. }
  4993. declare class HarmonyImportDependency extends ModuleDependency {
  4994. constructor(
  4995. request: string,
  4996. sourceOrder: number,
  4997. attributes?: ImportAttributes
  4998. );
  4999. sourceOrder: number;
  5000. getImportVar(moduleGraph: ModuleGraph): string;
  5001. getImportStatement(
  5002. update: boolean,
  5003. __1: DependencyTemplateContext
  5004. ): [string, string];
  5005. getLinkingErrors(
  5006. moduleGraph: ModuleGraph,
  5007. ids: string[],
  5008. additionalMessage: string
  5009. ): undefined | WebpackError[];
  5010. static Template: typeof HarmonyImportDependencyTemplate;
  5011. static ExportPresenceModes: {
  5012. NONE: 0;
  5013. WARN: 1;
  5014. AUTO: 2;
  5015. ERROR: 3;
  5016. fromUserOption(str: string | false): 0 | 1 | 2 | 3;
  5017. };
  5018. static NO_EXPORTS_REFERENCED: string[][];
  5019. static EXPORTS_OBJECT_REFERENCED: string[][];
  5020. static TRANSITIVE: typeof TRANSITIVE;
  5021. }
  5022. declare class HarmonyImportDependencyTemplate extends DependencyTemplate {
  5023. constructor();
  5024. static getImportEmittedRuntime(
  5025. module: Module,
  5026. referencedModule: Module
  5027. ): undefined | string | boolean | SortableSet<string>;
  5028. }
  5029. declare class Hash {
  5030. constructor();
  5031. /**
  5032. * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
  5033. */
  5034. update(data: string | Buffer, inputEncoding?: string): Hash;
  5035. /**
  5036. * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
  5037. */
  5038. digest(encoding?: string): string | Buffer;
  5039. }
  5040. type HashFunction = string | typeof Hash;
  5041. declare interface HashableObject {
  5042. updateHash: (arg0: Hash) => void;
  5043. }
  5044. declare class HashedModuleIdsPlugin {
  5045. constructor(options?: HashedModuleIdsPluginOptions);
  5046. options: HashedModuleIdsPluginOptions;
  5047. /**
  5048. * Apply the plugin
  5049. */
  5050. apply(compiler: Compiler): void;
  5051. }
  5052. declare interface HashedModuleIdsPluginOptions {
  5053. /**
  5054. * The context directory for creating names.
  5055. */
  5056. context?: string;
  5057. /**
  5058. * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
  5059. */
  5060. hashDigest?: "latin1" | "base64" | "hex";
  5061. /**
  5062. * The prefix length of the hash digest to use, defaults to 4.
  5063. */
  5064. hashDigestLength?: number;
  5065. /**
  5066. * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
  5067. */
  5068. hashFunction?: string | typeof Hash;
  5069. }
  5070. declare abstract class HelperRuntimeModule extends RuntimeModule {}
  5071. declare class HotModuleReplacementPlugin {
  5072. constructor(options?: object);
  5073. options: object;
  5074. /**
  5075. * Apply the plugin
  5076. */
  5077. apply(compiler: Compiler): void;
  5078. static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
  5079. }
  5080. /**
  5081. * These properties are added by the HotModuleReplacementPlugin
  5082. */
  5083. declare interface HotModuleReplacementPluginLoaderContext {
  5084. hot?: boolean;
  5085. }
  5086. declare class HotUpdateChunk extends Chunk {
  5087. constructor();
  5088. }
  5089. /**
  5090. * Options for building http resources.
  5091. */
  5092. declare interface HttpUriOptions {
  5093. /**
  5094. * List of allowed URIs (resp. the beginning of them).
  5095. */
  5096. allowedUris: (string | RegExp | ((uri: string) => boolean))[];
  5097. /**
  5098. * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
  5099. */
  5100. cacheLocation?: string | false;
  5101. /**
  5102. * When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
  5103. */
  5104. frozen?: boolean;
  5105. /**
  5106. * Location of the lockfile.
  5107. */
  5108. lockfileLocation?: string;
  5109. /**
  5110. * Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.
  5111. */
  5112. proxy?: string;
  5113. /**
  5114. * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
  5115. */
  5116. upgrade?: boolean;
  5117. }
  5118. declare class HttpUriPlugin {
  5119. constructor(options: HttpUriOptions);
  5120. /**
  5121. * Apply the plugin
  5122. */
  5123. apply(compiler: Compiler): void;
  5124. }
  5125. type IBigIntStats = IStatsBase<bigint> & {
  5126. atimeNs: bigint;
  5127. mtimeNs: bigint;
  5128. ctimeNs: bigint;
  5129. birthtimeNs: bigint;
  5130. };
  5131. declare interface IStats {
  5132. isFile: () => boolean;
  5133. isDirectory: () => boolean;
  5134. isBlockDevice: () => boolean;
  5135. isCharacterDevice: () => boolean;
  5136. isSymbolicLink: () => boolean;
  5137. isFIFO: () => boolean;
  5138. isSocket: () => boolean;
  5139. dev: number;
  5140. ino: number;
  5141. mode: number;
  5142. nlink: number;
  5143. uid: number;
  5144. gid: number;
  5145. rdev: number;
  5146. size: number;
  5147. blksize: number;
  5148. blocks: number;
  5149. atimeMs: number;
  5150. mtimeMs: number;
  5151. ctimeMs: number;
  5152. birthtimeMs: number;
  5153. atime: Date;
  5154. mtime: Date;
  5155. ctime: Date;
  5156. birthtime: Date;
  5157. }
  5158. declare interface IStatsBase<T> {
  5159. isFile: () => boolean;
  5160. isDirectory: () => boolean;
  5161. isBlockDevice: () => boolean;
  5162. isCharacterDevice: () => boolean;
  5163. isSymbolicLink: () => boolean;
  5164. isFIFO: () => boolean;
  5165. isSocket: () => boolean;
  5166. dev: T;
  5167. ino: T;
  5168. mode: T;
  5169. nlink: T;
  5170. uid: T;
  5171. gid: T;
  5172. rdev: T;
  5173. size: T;
  5174. blksize: T;
  5175. blocks: T;
  5176. atimeMs: T;
  5177. mtimeMs: T;
  5178. ctimeMs: T;
  5179. birthtimeMs: T;
  5180. atime: Date;
  5181. mtime: Date;
  5182. ctime: Date;
  5183. birthtime: Date;
  5184. }
  5185. declare class IgnorePlugin {
  5186. constructor(options: IgnorePluginOptions);
  5187. options: IgnorePluginOptions;
  5188. /**
  5189. * Note that if "contextRegExp" is given, both the "resourceRegExp" and "contextRegExp" have to match.
  5190. */
  5191. checkIgnore(resolveData: ResolveData): undefined | false;
  5192. /**
  5193. * Apply the plugin
  5194. */
  5195. apply(compiler: Compiler): void;
  5196. }
  5197. type IgnorePluginOptions =
  5198. | {
  5199. /**
  5200. * A RegExp to test the context (directory) against.
  5201. */
  5202. contextRegExp?: RegExp;
  5203. /**
  5204. * A RegExp to test the request against.
  5205. */
  5206. resourceRegExp: RegExp;
  5207. }
  5208. | {
  5209. /**
  5210. * A filter function for resource and context.
  5211. */
  5212. checkResource: (resource: string, context: string) => boolean;
  5213. };
  5214. type ImportAttribute = BaseNode & {
  5215. type: "ImportAttribute";
  5216. key: Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral;
  5217. value: Literal;
  5218. };
  5219. type ImportAttributes = Record<string, string> & {};
  5220. type ImportDeclarationJavascriptParser = ImportDeclarationImport & {
  5221. attributes?: ImportAttribute[];
  5222. };
  5223. declare interface ImportDependencyMeta {
  5224. attributes?: ImportAttributes;
  5225. externalType?: "import" | "module";
  5226. }
  5227. type ImportExpressionJavascriptParser = ImportExpressionImport & {
  5228. options?:
  5229. | null
  5230. | ImportExpressionImport
  5231. | UnaryExpression
  5232. | ArrayExpression
  5233. | ArrowFunctionExpression
  5234. | AssignmentExpression
  5235. | AwaitExpression
  5236. | BinaryExpression
  5237. | SimpleCallExpression
  5238. | NewExpression
  5239. | ChainExpression
  5240. | ClassExpression
  5241. | ConditionalExpression
  5242. | FunctionExpression
  5243. | Identifier
  5244. | SimpleLiteral
  5245. | RegExpLiteral
  5246. | BigIntLiteral
  5247. | LogicalExpression
  5248. | MemberExpression
  5249. | MetaProperty
  5250. | ObjectExpression
  5251. | SequenceExpression
  5252. | TaggedTemplateExpression
  5253. | TemplateLiteral
  5254. | ThisExpression
  5255. | UpdateExpression
  5256. | YieldExpression;
  5257. };
  5258. declare interface ImportModuleOptions {
  5259. /**
  5260. * the target layer
  5261. */
  5262. layer?: string;
  5263. /**
  5264. * the target public path
  5265. */
  5266. publicPath?: string;
  5267. /**
  5268. * target base uri
  5269. */
  5270. baseUri?: string;
  5271. }
  5272. type ImportSource =
  5273. | undefined
  5274. | null
  5275. | string
  5276. | SimpleLiteral
  5277. | RegExpLiteral
  5278. | BigIntLiteral;
  5279. /**
  5280. * Options for infrastructure level logging.
  5281. */
  5282. declare interface InfrastructureLogging {
  5283. /**
  5284. * 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.
  5285. */
  5286. appendOnly?: boolean;
  5287. /**
  5288. * Enables/Disables colorful output. This option is only used when no custom console is provided.
  5289. */
  5290. colors?: boolean;
  5291. /**
  5292. * Custom console used for logging.
  5293. */
  5294. console?: Console;
  5295. /**
  5296. * Enable debug logging for specific loggers.
  5297. */
  5298. debug?:
  5299. | string
  5300. | boolean
  5301. | RegExp
  5302. | FilterItemTypes[]
  5303. | ((value: string) => boolean);
  5304. /**
  5305. * Log level.
  5306. */
  5307. level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
  5308. /**
  5309. * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
  5310. */
  5311. stream?: NodeJS.WritableStream;
  5312. }
  5313. declare class InitFragment<GenerateContext> {
  5314. constructor(
  5315. content: undefined | string | Source,
  5316. stage: number,
  5317. position: number,
  5318. key?: string,
  5319. endContent?: string | Source
  5320. );
  5321. content?: string | Source;
  5322. stage: number;
  5323. position: number;
  5324. key?: string;
  5325. endContent?: string | Source;
  5326. getContent(context: GenerateContext): undefined | string | Source;
  5327. getEndContent(context: GenerateContext): undefined | string | Source;
  5328. serialize(context: ObjectSerializerContext): void;
  5329. deserialize(context: ObjectDeserializerContext): void;
  5330. merge: any;
  5331. static addToSource<Context, T>(
  5332. source: Source,
  5333. initFragments: InitFragment<T>[],
  5334. context: Context
  5335. ): Source;
  5336. static STAGE_CONSTANTS: number;
  5337. static STAGE_ASYNC_BOUNDARY: number;
  5338. static STAGE_HARMONY_EXPORTS: number;
  5339. static STAGE_HARMONY_IMPORTS: number;
  5340. static STAGE_PROVIDES: number;
  5341. static STAGE_ASYNC_DEPENDENCIES: number;
  5342. static STAGE_ASYNC_HARMONY_IMPORTS: number;
  5343. }
  5344. declare interface InputFileSystem {
  5345. readFile: ReadFileFs;
  5346. readFileSync?: ReadFileSync;
  5347. readlink: ReadlinkFs;
  5348. readlinkSync?: ReadlinkSync;
  5349. readdir: ReaddirFs;
  5350. readdirSync?: ReaddirSync;
  5351. stat: StatFs;
  5352. statSync?: StatSync;
  5353. lstat?: LStatFs;
  5354. lstatSync?: LStatSync;
  5355. realpath?: RealPathFs;
  5356. realpathSync?: RealPathSync;
  5357. readJson?: (
  5358. arg0: PathOrFileDescriptorFs,
  5359. arg1: (
  5360. arg0: null | Error | NodeJS.ErrnoException,
  5361. arg1?: JsonObjectFs
  5362. ) => void
  5363. ) => void;
  5364. readJsonSync?: (arg0: PathOrFileDescriptorFs) => JsonObjectFs;
  5365. purge?: (arg0?: string | string[] | Set<string>) => void;
  5366. join?: (arg0: string, arg1: string) => string;
  5367. relative?: (arg0: string, arg1: string) => string;
  5368. dirname?: (arg0: string) => string;
  5369. }
  5370. type IntermediateFileSystem = InputFileSystem &
  5371. OutputFileSystem &
  5372. IntermediateFileSystemExtras;
  5373. declare interface IntermediateFileSystemExtras {
  5374. mkdirSync: MkdirSync;
  5375. createWriteStream: (
  5376. arg0: PathLikeFs,
  5377. arg1?:
  5378. | "ascii"
  5379. | "utf8"
  5380. | "utf-8"
  5381. | "utf16le"
  5382. | "utf-16le"
  5383. | "ucs2"
  5384. | "ucs-2"
  5385. | "latin1"
  5386. | "binary"
  5387. | "base64"
  5388. | "base64url"
  5389. | "hex"
  5390. | WriteStreamOptions
  5391. ) => NodeJS.WritableStream;
  5392. open: Open;
  5393. read: Read<Buffer>;
  5394. close: (
  5395. arg0: number,
  5396. arg1: (arg0: null | NodeJS.ErrnoException) => void
  5397. ) => void;
  5398. rename: (
  5399. arg0: PathLikeFs,
  5400. arg1: PathLikeFs,
  5401. arg2: (arg0: null | NodeJS.ErrnoException) => void
  5402. ) => void;
  5403. }
  5404. type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
  5405. declare interface InterpolatedPathAndAssetInfo {
  5406. path: string;
  5407. info: AssetInfo;
  5408. }
  5409. declare interface Item<T> {
  5410. [index: string]: string | string[] | T;
  5411. }
  5412. declare abstract class ItemCacheFacade {
  5413. get<T>(callback: CallbackCacheCacheFacade<T>): void;
  5414. getPromise<T>(): Promise<T>;
  5415. store<T>(data: T, callback: CallbackCacheCacheFacade<void>): void;
  5416. storePromise<T>(data: T): Promise<void>;
  5417. provide<T>(
  5418. computer: (arg0: CallbackNormalErrorCache<T>) => void,
  5419. callback: CallbackNormalErrorCache<T>
  5420. ): void;
  5421. providePromise<T>(computer: () => T | Promise<T>): Promise<T>;
  5422. }
  5423. declare class JavascriptModulesPlugin {
  5424. constructor(options?: object);
  5425. options: object;
  5426. /**
  5427. * Apply the plugin
  5428. */
  5429. apply(compiler: Compiler): void;
  5430. renderModule(
  5431. module: Module,
  5432. renderContext: ChunkRenderContextJavascriptModulesPlugin,
  5433. hooks: CompilationHooksJavascriptModulesPlugin,
  5434. factory: boolean
  5435. ): null | Source;
  5436. renderChunk(
  5437. renderContext: RenderContextJavascriptModulesPlugin,
  5438. hooks: CompilationHooksJavascriptModulesPlugin
  5439. ): Source;
  5440. renderMain(
  5441. renderContext: MainRenderContext,
  5442. hooks: CompilationHooksJavascriptModulesPlugin,
  5443. compilation: Compilation
  5444. ): Source;
  5445. updateHashWithBootstrap(
  5446. hash: Hash,
  5447. renderContext: RenderBootstrapContext,
  5448. hooks: CompilationHooksJavascriptModulesPlugin
  5449. ): void;
  5450. renderBootstrap(
  5451. renderContext: RenderBootstrapContext,
  5452. hooks: CompilationHooksJavascriptModulesPlugin
  5453. ): Bootstrap;
  5454. renderRequire(
  5455. renderContext: RenderBootstrapContext,
  5456. hooks: CompilationHooksJavascriptModulesPlugin
  5457. ): string;
  5458. getRenamedInlineModule(
  5459. allModules: Module[],
  5460. renderContext: MainRenderContext,
  5461. inlinedModules: Set<Module>,
  5462. chunkRenderContext: ChunkRenderContextJavascriptModulesPlugin,
  5463. hooks: CompilationHooksJavascriptModulesPlugin,
  5464. allStrict: undefined | boolean,
  5465. hasChunkModules: boolean
  5466. ): false | Map<Module, Source>;
  5467. static getCompilationHooks(
  5468. compilation: Compilation
  5469. ): CompilationHooksJavascriptModulesPlugin;
  5470. static getChunkFilenameTemplate(
  5471. chunk: Chunk,
  5472. outputOptions: Output
  5473. ): TemplatePath;
  5474. static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
  5475. }
  5476. declare class JavascriptParser extends Parser {
  5477. constructor(sourceType?: "module" | "auto" | "script");
  5478. hooks: Readonly<{
  5479. evaluateTypeof: HookMap<
  5480. SyncBailHook<
  5481. [UnaryExpression],
  5482. undefined | null | BasicEvaluatedExpression
  5483. >
  5484. >;
  5485. evaluate: HookMap<
  5486. SyncBailHook<
  5487. [
  5488. | ImportExpressionImport
  5489. | UnaryExpression
  5490. | ArrayExpression
  5491. | ArrowFunctionExpression
  5492. | AssignmentExpression
  5493. | AwaitExpression
  5494. | BinaryExpression
  5495. | SimpleCallExpression
  5496. | NewExpression
  5497. | ChainExpression
  5498. | ClassExpression
  5499. | ConditionalExpression
  5500. | FunctionExpression
  5501. | Identifier
  5502. | SimpleLiteral
  5503. | RegExpLiteral
  5504. | BigIntLiteral
  5505. | LogicalExpression
  5506. | MemberExpression
  5507. | MetaProperty
  5508. | ObjectExpression
  5509. | SequenceExpression
  5510. | TaggedTemplateExpression
  5511. | TemplateLiteral
  5512. | ThisExpression
  5513. | UpdateExpression
  5514. | YieldExpression
  5515. | SpreadElement
  5516. | PrivateIdentifier
  5517. ],
  5518. undefined | null | BasicEvaluatedExpression
  5519. >
  5520. >;
  5521. evaluateIdentifier: HookMap<
  5522. SyncBailHook<
  5523. [Identifier | MemberExpression | MetaProperty | ThisExpression],
  5524. undefined | null | BasicEvaluatedExpression
  5525. >
  5526. >;
  5527. evaluateDefinedIdentifier: HookMap<
  5528. SyncBailHook<
  5529. [Identifier | MemberExpression | ThisExpression],
  5530. undefined | null | BasicEvaluatedExpression
  5531. >
  5532. >;
  5533. evaluateNewExpression: HookMap<
  5534. SyncBailHook<[NewExpression], undefined | null | BasicEvaluatedExpression>
  5535. >;
  5536. evaluateCallExpression: HookMap<
  5537. SyncBailHook<
  5538. [CallExpression],
  5539. undefined | null | BasicEvaluatedExpression
  5540. >
  5541. >;
  5542. evaluateCallExpressionMember: HookMap<
  5543. SyncBailHook<
  5544. [CallExpression, BasicEvaluatedExpression],
  5545. undefined | null | BasicEvaluatedExpression
  5546. >
  5547. >;
  5548. isPure: HookMap<
  5549. SyncBailHook<
  5550. [
  5551. (
  5552. | ImportExpressionImport
  5553. | UnaryExpression
  5554. | ArrayExpression
  5555. | ArrowFunctionExpression
  5556. | AssignmentExpression
  5557. | AwaitExpression
  5558. | BinaryExpression
  5559. | SimpleCallExpression
  5560. | NewExpression
  5561. | ChainExpression
  5562. | ClassExpression
  5563. | ConditionalExpression
  5564. | FunctionExpression
  5565. | Identifier
  5566. | SimpleLiteral
  5567. | RegExpLiteral
  5568. | BigIntLiteral
  5569. | LogicalExpression
  5570. | MemberExpression
  5571. | MetaProperty
  5572. | ObjectExpression
  5573. | SequenceExpression
  5574. | TaggedTemplateExpression
  5575. | TemplateLiteral
  5576. | ThisExpression
  5577. | UpdateExpression
  5578. | YieldExpression
  5579. | PrivateIdentifier
  5580. | FunctionDeclaration
  5581. | VariableDeclaration
  5582. | ClassDeclaration
  5583. ),
  5584. number
  5585. ],
  5586. boolean | void
  5587. >
  5588. >;
  5589. preStatement: SyncBailHook<
  5590. [
  5591. | ImportDeclarationJavascriptParser
  5592. | ExportNamedDeclarationJavascriptParser
  5593. | ExportAllDeclarationJavascriptParser
  5594. | FunctionDeclaration
  5595. | VariableDeclaration
  5596. | ClassDeclaration
  5597. | ExpressionStatement
  5598. | BlockStatement
  5599. | StaticBlock
  5600. | EmptyStatement
  5601. | DebuggerStatement
  5602. | WithStatement
  5603. | ReturnStatement
  5604. | LabeledStatement
  5605. | BreakStatement
  5606. | ContinueStatement
  5607. | IfStatement
  5608. | SwitchStatement
  5609. | ThrowStatement
  5610. | TryStatement
  5611. | WhileStatement
  5612. | DoWhileStatement
  5613. | ForStatement
  5614. | ForInStatement
  5615. | ForOfStatement
  5616. | ExportDefaultDeclaration
  5617. ],
  5618. boolean | void
  5619. >;
  5620. blockPreStatement: SyncBailHook<
  5621. [
  5622. | ImportDeclarationJavascriptParser
  5623. | ExportNamedDeclarationJavascriptParser
  5624. | ExportAllDeclarationJavascriptParser
  5625. | FunctionDeclaration
  5626. | VariableDeclaration
  5627. | ClassDeclaration
  5628. | ExpressionStatement
  5629. | BlockStatement
  5630. | StaticBlock
  5631. | EmptyStatement
  5632. | DebuggerStatement
  5633. | WithStatement
  5634. | ReturnStatement
  5635. | LabeledStatement
  5636. | BreakStatement
  5637. | ContinueStatement
  5638. | IfStatement
  5639. | SwitchStatement
  5640. | ThrowStatement
  5641. | TryStatement
  5642. | WhileStatement
  5643. | DoWhileStatement
  5644. | ForStatement
  5645. | ForInStatement
  5646. | ForOfStatement
  5647. | ExportDefaultDeclaration
  5648. ],
  5649. boolean | void
  5650. >;
  5651. statement: SyncBailHook<
  5652. [
  5653. | ImportDeclarationJavascriptParser
  5654. | ExportNamedDeclarationJavascriptParser
  5655. | ExportAllDeclarationJavascriptParser
  5656. | FunctionDeclaration
  5657. | VariableDeclaration
  5658. | ClassDeclaration
  5659. | ExpressionStatement
  5660. | BlockStatement
  5661. | StaticBlock
  5662. | EmptyStatement
  5663. | DebuggerStatement
  5664. | WithStatement
  5665. | ReturnStatement
  5666. | LabeledStatement
  5667. | BreakStatement
  5668. | ContinueStatement
  5669. | IfStatement
  5670. | SwitchStatement
  5671. | ThrowStatement
  5672. | TryStatement
  5673. | WhileStatement
  5674. | DoWhileStatement
  5675. | ForStatement
  5676. | ForInStatement
  5677. | ForOfStatement
  5678. | ExportDefaultDeclaration
  5679. ],
  5680. boolean | void
  5681. >;
  5682. statementIf: SyncBailHook<[IfStatement], boolean | void>;
  5683. classExtendsExpression: SyncBailHook<
  5684. [Expression, ClassExpression | ClassDeclaration],
  5685. boolean | void
  5686. >;
  5687. classBodyElement: SyncBailHook<
  5688. [
  5689. StaticBlock | MethodDefinition | PropertyDefinition,
  5690. ClassExpression | ClassDeclaration
  5691. ],
  5692. boolean | void
  5693. >;
  5694. classBodyValue: SyncBailHook<
  5695. [
  5696. Expression,
  5697. MethodDefinition | PropertyDefinition,
  5698. ClassExpression | ClassDeclaration
  5699. ],
  5700. boolean | void
  5701. >;
  5702. label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
  5703. import: SyncBailHook<
  5704. [ImportDeclarationJavascriptParser, ImportSource],
  5705. boolean | void
  5706. >;
  5707. importSpecifier: SyncBailHook<
  5708. [ImportDeclarationJavascriptParser, ImportSource, null | string, string],
  5709. boolean | void
  5710. >;
  5711. export: SyncBailHook<
  5712. [ExportNamedDeclarationJavascriptParser | ExportDefaultDeclaration],
  5713. boolean | void
  5714. >;
  5715. exportImport: SyncBailHook<
  5716. [
  5717. (
  5718. | ExportNamedDeclarationJavascriptParser
  5719. | ExportAllDeclarationJavascriptParser
  5720. ),
  5721. ImportSource
  5722. ],
  5723. boolean | void
  5724. >;
  5725. exportDeclaration: SyncBailHook<
  5726. [
  5727. (
  5728. | ExportNamedDeclarationJavascriptParser
  5729. | ExportAllDeclarationJavascriptParser
  5730. | ExportDefaultDeclaration
  5731. ),
  5732. Declaration
  5733. ],
  5734. boolean | void
  5735. >;
  5736. exportExpression: SyncBailHook<
  5737. [ExportDefaultDeclaration, FunctionDeclaration | ClassDeclaration],
  5738. boolean | void
  5739. >;
  5740. exportSpecifier: SyncBailHook<
  5741. [
  5742. (
  5743. | ExportNamedDeclarationJavascriptParser
  5744. | ExportAllDeclarationJavascriptParser
  5745. | ExportDefaultDeclaration
  5746. ),
  5747. string,
  5748. string,
  5749. undefined | number
  5750. ],
  5751. boolean | void
  5752. >;
  5753. exportImportSpecifier: SyncBailHook<
  5754. [
  5755. (
  5756. | ExportNamedDeclarationJavascriptParser
  5757. | ExportAllDeclarationJavascriptParser
  5758. ),
  5759. ImportSource,
  5760. null | string,
  5761. null | string,
  5762. undefined | number
  5763. ],
  5764. boolean | void
  5765. >;
  5766. preDeclarator: SyncBailHook<
  5767. [VariableDeclarator, Statement],
  5768. boolean | void
  5769. >;
  5770. declarator: SyncBailHook<[VariableDeclarator, Statement], boolean | void>;
  5771. varDeclaration: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5772. varDeclarationLet: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5773. varDeclarationConst: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5774. varDeclarationVar: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5775. pattern: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  5776. canRename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5777. rename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5778. assign: HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>;
  5779. assignMemberChain: HookMap<
  5780. SyncBailHook<[AssignmentExpression, string[]], boolean | void>
  5781. >;
  5782. typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5783. importCall: SyncBailHook<
  5784. [ImportExpressionJavascriptParser],
  5785. boolean | void
  5786. >;
  5787. topLevelAwait: SyncBailHook<
  5788. [
  5789. | ImportExpressionImport
  5790. | UnaryExpression
  5791. | ArrayExpression
  5792. | ArrowFunctionExpression
  5793. | AssignmentExpression
  5794. | AwaitExpression
  5795. | BinaryExpression
  5796. | SimpleCallExpression
  5797. | NewExpression
  5798. | ChainExpression
  5799. | ClassExpression
  5800. | ConditionalExpression
  5801. | FunctionExpression
  5802. | Identifier
  5803. | SimpleLiteral
  5804. | RegExpLiteral
  5805. | BigIntLiteral
  5806. | LogicalExpression
  5807. | MemberExpression
  5808. | MetaProperty
  5809. | ObjectExpression
  5810. | SequenceExpression
  5811. | TaggedTemplateExpression
  5812. | TemplateLiteral
  5813. | ThisExpression
  5814. | UpdateExpression
  5815. | YieldExpression
  5816. | ForOfStatement
  5817. ],
  5818. boolean | void
  5819. >;
  5820. call: HookMap<SyncBailHook<[CallExpression], boolean | void>>;
  5821. callMemberChain: HookMap<
  5822. SyncBailHook<
  5823. [CallExpression, string[], boolean[], [number, number][]],
  5824. boolean | void
  5825. >
  5826. >;
  5827. memberChainOfCallMemberChain: HookMap<
  5828. SyncBailHook<
  5829. [Expression, string[], CallExpression, string[], [number, number][]],
  5830. boolean | void
  5831. >
  5832. >;
  5833. callMemberChainOfCallMemberChain: HookMap<
  5834. SyncBailHook<
  5835. [
  5836. CallExpression,
  5837. string[],
  5838. CallExpression,
  5839. string[],
  5840. [number, number][]
  5841. ],
  5842. boolean | void
  5843. >
  5844. >;
  5845. optionalChaining: SyncBailHook<[ChainExpression], boolean | void>;
  5846. new: HookMap<SyncBailHook<[NewExpression], boolean | void>>;
  5847. binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
  5848. expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5849. expressionMemberChain: HookMap<
  5850. SyncBailHook<
  5851. [MemberExpression, string[], boolean[], [number, number][]],
  5852. boolean | void
  5853. >
  5854. >;
  5855. unhandledExpressionMemberChain: HookMap<
  5856. SyncBailHook<[MemberExpression, string[]], boolean | void>
  5857. >;
  5858. expressionConditionalOperator: SyncBailHook<
  5859. [ConditionalExpression],
  5860. boolean | void
  5861. >;
  5862. expressionLogicalOperator: SyncBailHook<
  5863. [LogicalExpression],
  5864. boolean | void
  5865. >;
  5866. program: SyncBailHook<[Program, Comment[]], boolean | void>;
  5867. finish: SyncBailHook<[Program, Comment[]], boolean | void>;
  5868. }>;
  5869. sourceType: "module" | "auto" | "script";
  5870. scope: ScopeInfo;
  5871. state: ParserState;
  5872. comments?: Comment[];
  5873. semicolons?: Set<number>;
  5874. statementPath?: StatementPathItem[];
  5875. prevStatement?:
  5876. | ImportDeclarationJavascriptParser
  5877. | ExportNamedDeclarationJavascriptParser
  5878. | ExportAllDeclarationJavascriptParser
  5879. | ImportExpressionImport
  5880. | UnaryExpression
  5881. | ArrayExpression
  5882. | ArrowFunctionExpression
  5883. | AssignmentExpression
  5884. | AwaitExpression
  5885. | BinaryExpression
  5886. | SimpleCallExpression
  5887. | NewExpression
  5888. | ChainExpression
  5889. | ClassExpression
  5890. | ConditionalExpression
  5891. | FunctionExpression
  5892. | Identifier
  5893. | SimpleLiteral
  5894. | RegExpLiteral
  5895. | BigIntLiteral
  5896. | LogicalExpression
  5897. | MemberExpression
  5898. | MetaProperty
  5899. | ObjectExpression
  5900. | SequenceExpression
  5901. | TaggedTemplateExpression
  5902. | TemplateLiteral
  5903. | ThisExpression
  5904. | UpdateExpression
  5905. | YieldExpression
  5906. | FunctionDeclaration
  5907. | VariableDeclaration
  5908. | ClassDeclaration
  5909. | ExpressionStatement
  5910. | BlockStatement
  5911. | StaticBlock
  5912. | EmptyStatement
  5913. | DebuggerStatement
  5914. | WithStatement
  5915. | ReturnStatement
  5916. | LabeledStatement
  5917. | BreakStatement
  5918. | ContinueStatement
  5919. | IfStatement
  5920. | SwitchStatement
  5921. | ThrowStatement
  5922. | TryStatement
  5923. | WhileStatement
  5924. | DoWhileStatement
  5925. | ForStatement
  5926. | ForInStatement
  5927. | ForOfStatement
  5928. | ExportDefaultDeclaration;
  5929. destructuringAssignmentProperties?: WeakMap<
  5930. Expression,
  5931. Set<DestructuringAssignmentProperty>
  5932. >;
  5933. currentTagData: any;
  5934. magicCommentContext: Context;
  5935. destructuringAssignmentPropertiesFor(
  5936. node: Expression
  5937. ): undefined | Set<DestructuringAssignmentProperty>;
  5938. getRenameIdentifier(
  5939. expr:
  5940. | ImportExpressionImport
  5941. | UnaryExpression
  5942. | ArrayExpression
  5943. | ArrowFunctionExpression
  5944. | AssignmentExpression
  5945. | AwaitExpression
  5946. | BinaryExpression
  5947. | SimpleCallExpression
  5948. | NewExpression
  5949. | ChainExpression
  5950. | ClassExpression
  5951. | ConditionalExpression
  5952. | FunctionExpression
  5953. | Identifier
  5954. | SimpleLiteral
  5955. | RegExpLiteral
  5956. | BigIntLiteral
  5957. | LogicalExpression
  5958. | MemberExpression
  5959. | MetaProperty
  5960. | ObjectExpression
  5961. | SequenceExpression
  5962. | TaggedTemplateExpression
  5963. | TemplateLiteral
  5964. | ThisExpression
  5965. | UpdateExpression
  5966. | YieldExpression
  5967. | SpreadElement
  5968. ): undefined | string | VariableInfoInterface;
  5969. walkClass(classy: ClassExpression | ClassDeclaration): void;
  5970. /**
  5971. * Pre walking iterates the scope for variable declarations
  5972. */
  5973. preWalkStatements(
  5974. statements: (
  5975. | ImportDeclarationJavascriptParser
  5976. | ExportNamedDeclarationJavascriptParser
  5977. | ExportAllDeclarationJavascriptParser
  5978. | FunctionDeclaration
  5979. | VariableDeclaration
  5980. | ClassDeclaration
  5981. | ExpressionStatement
  5982. | BlockStatement
  5983. | StaticBlock
  5984. | EmptyStatement
  5985. | DebuggerStatement
  5986. | WithStatement
  5987. | ReturnStatement
  5988. | LabeledStatement
  5989. | BreakStatement
  5990. | ContinueStatement
  5991. | IfStatement
  5992. | SwitchStatement
  5993. | ThrowStatement
  5994. | TryStatement
  5995. | WhileStatement
  5996. | DoWhileStatement
  5997. | ForStatement
  5998. | ForInStatement
  5999. | ForOfStatement
  6000. | ExportDefaultDeclaration
  6001. )[]
  6002. ): void;
  6003. /**
  6004. * Block pre walking iterates the scope for block variable declarations
  6005. */
  6006. blockPreWalkStatements(
  6007. statements: (
  6008. | ImportDeclarationJavascriptParser
  6009. | ExportNamedDeclarationJavascriptParser
  6010. | ExportAllDeclarationJavascriptParser
  6011. | FunctionDeclaration
  6012. | VariableDeclaration
  6013. | ClassDeclaration
  6014. | ExpressionStatement
  6015. | BlockStatement
  6016. | StaticBlock
  6017. | EmptyStatement
  6018. | DebuggerStatement
  6019. | WithStatement
  6020. | ReturnStatement
  6021. | LabeledStatement
  6022. | BreakStatement
  6023. | ContinueStatement
  6024. | IfStatement
  6025. | SwitchStatement
  6026. | ThrowStatement
  6027. | TryStatement
  6028. | WhileStatement
  6029. | DoWhileStatement
  6030. | ForStatement
  6031. | ForInStatement
  6032. | ForOfStatement
  6033. | ExportDefaultDeclaration
  6034. )[]
  6035. ): void;
  6036. /**
  6037. * Walking iterates the statements and expressions and processes them
  6038. */
  6039. walkStatements(
  6040. statements: (
  6041. | ImportDeclarationJavascriptParser
  6042. | ExportNamedDeclarationJavascriptParser
  6043. | ExportAllDeclarationJavascriptParser
  6044. | FunctionDeclaration
  6045. | VariableDeclaration
  6046. | ClassDeclaration
  6047. | ExpressionStatement
  6048. | BlockStatement
  6049. | StaticBlock
  6050. | EmptyStatement
  6051. | DebuggerStatement
  6052. | WithStatement
  6053. | ReturnStatement
  6054. | LabeledStatement
  6055. | BreakStatement
  6056. | ContinueStatement
  6057. | IfStatement
  6058. | SwitchStatement
  6059. | ThrowStatement
  6060. | TryStatement
  6061. | WhileStatement
  6062. | DoWhileStatement
  6063. | ForStatement
  6064. | ForInStatement
  6065. | ForOfStatement
  6066. | ExportDefaultDeclaration
  6067. )[]
  6068. ): void;
  6069. /**
  6070. * Walking iterates the statements and expressions and processes them
  6071. */
  6072. preWalkStatement(
  6073. statement:
  6074. | ImportDeclarationJavascriptParser
  6075. | ExportNamedDeclarationJavascriptParser
  6076. | ExportAllDeclarationJavascriptParser
  6077. | FunctionDeclaration
  6078. | VariableDeclaration
  6079. | ClassDeclaration
  6080. | ExpressionStatement
  6081. | BlockStatement
  6082. | StaticBlock
  6083. | EmptyStatement
  6084. | DebuggerStatement
  6085. | WithStatement
  6086. | ReturnStatement
  6087. | LabeledStatement
  6088. | BreakStatement
  6089. | ContinueStatement
  6090. | IfStatement
  6091. | SwitchStatement
  6092. | ThrowStatement
  6093. | TryStatement
  6094. | WhileStatement
  6095. | DoWhileStatement
  6096. | ForStatement
  6097. | ForInStatement
  6098. | ForOfStatement
  6099. | ExportDefaultDeclaration
  6100. ): void;
  6101. blockPreWalkStatement(
  6102. statement:
  6103. | ImportDeclarationJavascriptParser
  6104. | ExportNamedDeclarationJavascriptParser
  6105. | ExportAllDeclarationJavascriptParser
  6106. | FunctionDeclaration
  6107. | VariableDeclaration
  6108. | ClassDeclaration
  6109. | ExpressionStatement
  6110. | BlockStatement
  6111. | StaticBlock
  6112. | EmptyStatement
  6113. | DebuggerStatement
  6114. | WithStatement
  6115. | ReturnStatement
  6116. | LabeledStatement
  6117. | BreakStatement
  6118. | ContinueStatement
  6119. | IfStatement
  6120. | SwitchStatement
  6121. | ThrowStatement
  6122. | TryStatement
  6123. | WhileStatement
  6124. | DoWhileStatement
  6125. | ForStatement
  6126. | ForInStatement
  6127. | ForOfStatement
  6128. | ExportDefaultDeclaration
  6129. ): void;
  6130. walkStatement(
  6131. statement:
  6132. | ImportDeclarationJavascriptParser
  6133. | ExportNamedDeclarationJavascriptParser
  6134. | ExportAllDeclarationJavascriptParser
  6135. | FunctionDeclaration
  6136. | VariableDeclaration
  6137. | ClassDeclaration
  6138. | ExpressionStatement
  6139. | BlockStatement
  6140. | StaticBlock
  6141. | EmptyStatement
  6142. | DebuggerStatement
  6143. | WithStatement
  6144. | ReturnStatement
  6145. | LabeledStatement
  6146. | BreakStatement
  6147. | ContinueStatement
  6148. | IfStatement
  6149. | SwitchStatement
  6150. | ThrowStatement
  6151. | TryStatement
  6152. | WhileStatement
  6153. | DoWhileStatement
  6154. | ForStatement
  6155. | ForInStatement
  6156. | ForOfStatement
  6157. | ExportDefaultDeclaration
  6158. ): void;
  6159. /**
  6160. * Walks a statements that is nested within a parent statement
  6161. * and can potentially be a non-block statement.
  6162. * This enforces the nested statement to never be in ASI position.
  6163. */
  6164. walkNestedStatement(statement: Statement): void;
  6165. preWalkBlockStatement(statement: BlockStatement): void;
  6166. walkBlockStatement(statement: BlockStatement): void;
  6167. walkExpressionStatement(statement: ExpressionStatement): void;
  6168. preWalkIfStatement(statement: IfStatement): void;
  6169. walkIfStatement(statement: IfStatement): void;
  6170. preWalkLabeledStatement(statement: LabeledStatement): void;
  6171. walkLabeledStatement(statement: LabeledStatement): void;
  6172. preWalkWithStatement(statement: WithStatement): void;
  6173. walkWithStatement(statement: WithStatement): void;
  6174. preWalkSwitchStatement(statement: SwitchStatement): void;
  6175. walkSwitchStatement(statement: SwitchStatement): void;
  6176. walkTerminatingStatement(statement: ReturnStatement | ThrowStatement): void;
  6177. walkReturnStatement(statement: ReturnStatement): void;
  6178. walkThrowStatement(statement: ThrowStatement): void;
  6179. preWalkTryStatement(statement: TryStatement): void;
  6180. walkTryStatement(statement: TryStatement): void;
  6181. preWalkWhileStatement(statement: WhileStatement): void;
  6182. walkWhileStatement(statement: WhileStatement): void;
  6183. preWalkDoWhileStatement(statement: DoWhileStatement): void;
  6184. walkDoWhileStatement(statement: DoWhileStatement): void;
  6185. preWalkForStatement(statement: ForStatement): void;
  6186. walkForStatement(statement: ForStatement): void;
  6187. preWalkForInStatement(statement: ForInStatement): void;
  6188. walkForInStatement(statement: ForInStatement): void;
  6189. preWalkForOfStatement(statement: ForOfStatement): void;
  6190. walkForOfStatement(statement: ForOfStatement): void;
  6191. preWalkFunctionDeclaration(statement: FunctionDeclaration): void;
  6192. walkFunctionDeclaration(statement: FunctionDeclaration): void;
  6193. blockPreWalkExpressionStatement(statement: ExpressionStatement): void;
  6194. preWalkAssignmentExpression(expression: AssignmentExpression): void;
  6195. blockPreWalkImportDeclaration(
  6196. statement: ImportDeclarationJavascriptParser
  6197. ): void;
  6198. enterDeclaration(
  6199. declaration: Declaration,
  6200. onIdent: (arg0: string, arg1: Identifier) => void
  6201. ): void;
  6202. blockPreWalkExportNamedDeclaration(
  6203. statement: ExportNamedDeclarationJavascriptParser
  6204. ): void;
  6205. walkExportNamedDeclaration(
  6206. statement: ExportNamedDeclarationJavascriptParser
  6207. ): void;
  6208. blockPreWalkExportDefaultDeclaration(statement?: any): void;
  6209. walkExportDefaultDeclaration(statement: ExportDefaultDeclaration): void;
  6210. blockPreWalkExportAllDeclaration(
  6211. statement: ExportAllDeclarationJavascriptParser
  6212. ): void;
  6213. preWalkVariableDeclaration(statement: VariableDeclaration): void;
  6214. blockPreWalkVariableDeclaration(statement: VariableDeclaration): void;
  6215. preWalkVariableDeclarator(declarator: VariableDeclarator): void;
  6216. walkVariableDeclaration(statement: VariableDeclaration): void;
  6217. blockPreWalkClassDeclaration(statement: ClassDeclaration): void;
  6218. walkClassDeclaration(statement: ClassDeclaration): void;
  6219. preWalkSwitchCases(switchCases: SwitchCase[]): void;
  6220. walkSwitchCases(switchCases: SwitchCase[]): void;
  6221. preWalkCatchClause(catchClause: CatchClause): void;
  6222. walkCatchClause(catchClause: CatchClause): void;
  6223. walkPattern(pattern: Pattern): void;
  6224. walkAssignmentPattern(pattern: AssignmentPattern): void;
  6225. walkObjectPattern(pattern: ObjectPattern): void;
  6226. walkArrayPattern(pattern: ArrayPattern): void;
  6227. walkRestElement(pattern: RestElement): void;
  6228. walkExpressions(
  6229. expressions: (
  6230. | null
  6231. | ImportExpressionImport
  6232. | UnaryExpression
  6233. | ArrayExpression
  6234. | ArrowFunctionExpression
  6235. | AssignmentExpression
  6236. | AwaitExpression
  6237. | BinaryExpression
  6238. | SimpleCallExpression
  6239. | NewExpression
  6240. | ChainExpression
  6241. | ClassExpression
  6242. | ConditionalExpression
  6243. | FunctionExpression
  6244. | Identifier
  6245. | SimpleLiteral
  6246. | RegExpLiteral
  6247. | BigIntLiteral
  6248. | LogicalExpression
  6249. | MemberExpression
  6250. | MetaProperty
  6251. | ObjectExpression
  6252. | SequenceExpression
  6253. | TaggedTemplateExpression
  6254. | TemplateLiteral
  6255. | ThisExpression
  6256. | UpdateExpression
  6257. | YieldExpression
  6258. | SpreadElement
  6259. )[]
  6260. ): void;
  6261. walkExpression(expression?: any): void;
  6262. walkAwaitExpression(expression: AwaitExpression): void;
  6263. walkArrayExpression(expression: ArrayExpression): void;
  6264. walkSpreadElement(expression: SpreadElement): void;
  6265. walkObjectExpression(expression: ObjectExpression): void;
  6266. walkProperty(prop: SpreadElement | Property): void;
  6267. walkFunctionExpression(expression: FunctionExpression): void;
  6268. walkArrowFunctionExpression(expression: ArrowFunctionExpression): void;
  6269. walkSequenceExpression(expression: SequenceExpression): void;
  6270. walkUpdateExpression(expression: UpdateExpression): void;
  6271. walkUnaryExpression(expression: UnaryExpression): void;
  6272. walkLeftRightExpression(
  6273. expression: BinaryExpression | LogicalExpression
  6274. ): void;
  6275. walkBinaryExpression(expression: BinaryExpression): void;
  6276. walkLogicalExpression(expression: LogicalExpression): void;
  6277. walkAssignmentExpression(expression: AssignmentExpression): void;
  6278. walkConditionalExpression(expression: ConditionalExpression): void;
  6279. walkNewExpression(expression: NewExpression): void;
  6280. walkYieldExpression(expression: YieldExpression): void;
  6281. walkTemplateLiteral(expression: TemplateLiteral): void;
  6282. walkTaggedTemplateExpression(expression: TaggedTemplateExpression): void;
  6283. walkClassExpression(expression: ClassExpression): void;
  6284. walkChainExpression(expression: ChainExpression): void;
  6285. walkImportExpression(expression: ImportExpressionJavascriptParser): void;
  6286. walkCallExpression(expression: CallExpression): void;
  6287. walkMemberExpression(expression: MemberExpression): void;
  6288. walkMemberExpressionWithExpressionName(
  6289. expression: any,
  6290. name: string,
  6291. rootInfo: string | VariableInfo,
  6292. members: string[],
  6293. onUnhandled?: any
  6294. ): void;
  6295. walkThisExpression(expression: ThisExpression): void;
  6296. walkIdentifier(expression: Identifier): void;
  6297. walkMetaProperty(metaProperty: MetaProperty): void;
  6298. callHooksForExpression<T, R>(
  6299. hookMap: HookMap<SyncBailHook<T, R>>,
  6300. expr:
  6301. | ImportExpressionImport
  6302. | UnaryExpression
  6303. | ArrayExpression
  6304. | ArrowFunctionExpression
  6305. | AssignmentExpression
  6306. | AwaitExpression
  6307. | BinaryExpression
  6308. | SimpleCallExpression
  6309. | NewExpression
  6310. | ChainExpression
  6311. | ClassExpression
  6312. | ConditionalExpression
  6313. | FunctionExpression
  6314. | Identifier
  6315. | SimpleLiteral
  6316. | RegExpLiteral
  6317. | BigIntLiteral
  6318. | LogicalExpression
  6319. | MemberExpression
  6320. | MetaProperty
  6321. | ObjectExpression
  6322. | SequenceExpression
  6323. | TaggedTemplateExpression
  6324. | TemplateLiteral
  6325. | ThisExpression
  6326. | UpdateExpression
  6327. | YieldExpression
  6328. | Super,
  6329. ...args: AsArray<T>
  6330. ): undefined | R;
  6331. callHooksForExpressionWithFallback<T, R>(
  6332. hookMap: HookMap<SyncBailHook<T, R>>,
  6333. expr:
  6334. | ImportExpressionImport
  6335. | UnaryExpression
  6336. | ArrayExpression
  6337. | ArrowFunctionExpression
  6338. | AssignmentExpression
  6339. | AwaitExpression
  6340. | BinaryExpression
  6341. | SimpleCallExpression
  6342. | NewExpression
  6343. | ChainExpression
  6344. | ClassExpression
  6345. | ConditionalExpression
  6346. | FunctionExpression
  6347. | Identifier
  6348. | SimpleLiteral
  6349. | RegExpLiteral
  6350. | BigIntLiteral
  6351. | LogicalExpression
  6352. | MemberExpression
  6353. | MetaProperty
  6354. | ObjectExpression
  6355. | SequenceExpression
  6356. | TaggedTemplateExpression
  6357. | TemplateLiteral
  6358. | ThisExpression
  6359. | UpdateExpression
  6360. | YieldExpression
  6361. | Super,
  6362. fallback:
  6363. | undefined
  6364. | ((
  6365. arg0: string,
  6366. arg1: string | VariableInfo | ScopeInfo,
  6367. arg2: () => string[]
  6368. ) => any),
  6369. defined: undefined | ((arg0: string) => any),
  6370. ...args: AsArray<T>
  6371. ): undefined | R;
  6372. callHooksForName<T, R>(
  6373. hookMap: HookMap<SyncBailHook<T, R>>,
  6374. name: string,
  6375. ...args: AsArray<T>
  6376. ): undefined | R;
  6377. callHooksForInfo<T, R>(
  6378. hookMap: HookMap<SyncBailHook<T, R>>,
  6379. info: ExportedVariableInfo,
  6380. ...args: AsArray<T>
  6381. ): undefined | R;
  6382. callHooksForInfoWithFallback<T, R>(
  6383. hookMap: HookMap<SyncBailHook<T, R>>,
  6384. info: ExportedVariableInfo,
  6385. fallback: undefined | ((arg0: string) => any),
  6386. defined: undefined | ((arg0?: string) => any),
  6387. ...args: AsArray<T>
  6388. ): undefined | R;
  6389. callHooksForNameWithFallback<T, R>(
  6390. hookMap: HookMap<SyncBailHook<T, R>>,
  6391. name: string,
  6392. fallback: undefined | ((arg0: string) => any),
  6393. defined: undefined | (() => any),
  6394. ...args: AsArray<T>
  6395. ): undefined | R;
  6396. inScope(params: any, fn: () => void): void;
  6397. inClassScope(hasThis: boolean, params: Identifier[], fn: () => void): void;
  6398. inFunctionScope(
  6399. hasThis: boolean,
  6400. params: (
  6401. | string
  6402. | Identifier
  6403. | MemberExpression
  6404. | ObjectPattern
  6405. | ArrayPattern
  6406. | RestElement
  6407. | AssignmentPattern
  6408. )[],
  6409. fn: () => void
  6410. ): void;
  6411. inBlockScope(fn: () => void): void;
  6412. detectMode(
  6413. statements: (
  6414. | ImportDeclarationJavascriptParser
  6415. | ExportNamedDeclarationJavascriptParser
  6416. | ExportAllDeclarationJavascriptParser
  6417. | FunctionDeclaration
  6418. | VariableDeclaration
  6419. | ClassDeclaration
  6420. | ExpressionStatement
  6421. | BlockStatement
  6422. | StaticBlock
  6423. | EmptyStatement
  6424. | DebuggerStatement
  6425. | WithStatement
  6426. | ReturnStatement
  6427. | LabeledStatement
  6428. | BreakStatement
  6429. | ContinueStatement
  6430. | IfStatement
  6431. | SwitchStatement
  6432. | ThrowStatement
  6433. | TryStatement
  6434. | WhileStatement
  6435. | DoWhileStatement
  6436. | ForStatement
  6437. | ForInStatement
  6438. | ForOfStatement
  6439. | ExportDefaultDeclaration
  6440. | Directive
  6441. )[]
  6442. ): void;
  6443. enterPatterns(
  6444. patterns: (
  6445. | string
  6446. | Identifier
  6447. | MemberExpression
  6448. | ObjectPattern
  6449. | ArrayPattern
  6450. | RestElement
  6451. | AssignmentPattern
  6452. | Property
  6453. )[],
  6454. onIdent: (arg0: string) => void
  6455. ): void;
  6456. enterPattern(
  6457. pattern:
  6458. | Identifier
  6459. | MemberExpression
  6460. | ObjectPattern
  6461. | ArrayPattern
  6462. | RestElement
  6463. | AssignmentPattern
  6464. | Property,
  6465. onIdent: (arg0: string, arg1: Identifier) => void
  6466. ): void;
  6467. enterIdentifier(
  6468. pattern: Identifier,
  6469. onIdent: (arg0: string, arg1: Identifier) => void
  6470. ): void;
  6471. enterObjectPattern(
  6472. pattern: ObjectPattern,
  6473. onIdent: (arg0: string, arg1: Identifier) => void
  6474. ): void;
  6475. enterArrayPattern(
  6476. pattern: ArrayPattern,
  6477. onIdent: (arg0: string, arg1: Identifier) => void
  6478. ): void;
  6479. enterRestElement(
  6480. pattern: RestElement,
  6481. onIdent: (arg0: string, arg1: Identifier) => void
  6482. ): void;
  6483. enterAssignmentPattern(
  6484. pattern: AssignmentPattern,
  6485. onIdent: (arg0: string, arg1: Identifier) => void
  6486. ): void;
  6487. evaluateExpression(
  6488. expression:
  6489. | ImportExpressionImport
  6490. | UnaryExpression
  6491. | ArrayExpression
  6492. | ArrowFunctionExpression
  6493. | AssignmentExpression
  6494. | AwaitExpression
  6495. | BinaryExpression
  6496. | SimpleCallExpression
  6497. | NewExpression
  6498. | ChainExpression
  6499. | ClassExpression
  6500. | ConditionalExpression
  6501. | FunctionExpression
  6502. | Identifier
  6503. | SimpleLiteral
  6504. | RegExpLiteral
  6505. | BigIntLiteral
  6506. | LogicalExpression
  6507. | MemberExpression
  6508. | MetaProperty
  6509. | ObjectExpression
  6510. | SequenceExpression
  6511. | TaggedTemplateExpression
  6512. | TemplateLiteral
  6513. | ThisExpression
  6514. | UpdateExpression
  6515. | YieldExpression
  6516. | SpreadElement
  6517. | PrivateIdentifier
  6518. ): BasicEvaluatedExpression;
  6519. parseString(expression: Expression): string;
  6520. parseCalculatedString(expression: Expression): {
  6521. range?: [number, number];
  6522. value: string;
  6523. code: boolean;
  6524. conditional: any;
  6525. };
  6526. evaluate(source: string): BasicEvaluatedExpression;
  6527. isPure(
  6528. expr:
  6529. | undefined
  6530. | null
  6531. | ImportExpressionImport
  6532. | UnaryExpression
  6533. | ArrayExpression
  6534. | ArrowFunctionExpression
  6535. | AssignmentExpression
  6536. | AwaitExpression
  6537. | BinaryExpression
  6538. | SimpleCallExpression
  6539. | NewExpression
  6540. | ChainExpression
  6541. | ClassExpression
  6542. | ConditionalExpression
  6543. | FunctionExpression
  6544. | Identifier
  6545. | SimpleLiteral
  6546. | RegExpLiteral
  6547. | BigIntLiteral
  6548. | LogicalExpression
  6549. | MemberExpression
  6550. | MetaProperty
  6551. | ObjectExpression
  6552. | SequenceExpression
  6553. | TaggedTemplateExpression
  6554. | TemplateLiteral
  6555. | ThisExpression
  6556. | UpdateExpression
  6557. | YieldExpression
  6558. | PrivateIdentifier
  6559. | FunctionDeclaration
  6560. | VariableDeclaration
  6561. | ClassDeclaration,
  6562. commentsStartPos: number
  6563. ): boolean;
  6564. getComments(range: [number, number]): Comment[];
  6565. isAsiPosition(pos: number): boolean;
  6566. setAsiPosition(pos: number): void;
  6567. unsetAsiPosition(pos: number): void;
  6568. isStatementLevelExpression(expr: Expression): boolean;
  6569. getTagData(name: string, tag: symbol): any;
  6570. tagVariable(name: string, tag: symbol, data?: any): void;
  6571. defineVariable(name: string): void;
  6572. undefineVariable(name: string): void;
  6573. isVariableDefined(name: string): boolean;
  6574. getVariableInfo(name: string): ExportedVariableInfo;
  6575. setVariable(name: string, variableInfo: ExportedVariableInfo): void;
  6576. evaluatedVariable(tagInfo: TagInfo): VariableInfo;
  6577. parseCommentOptions(range: [number, number]): {
  6578. options: null | Record<string, any>;
  6579. errors: null | (Error & { comment: Comment })[];
  6580. };
  6581. extractMemberExpressionChain(
  6582. expression:
  6583. | ImportExpressionImport
  6584. | UnaryExpression
  6585. | ArrayExpression
  6586. | ArrowFunctionExpression
  6587. | AssignmentExpression
  6588. | AwaitExpression
  6589. | BinaryExpression
  6590. | SimpleCallExpression
  6591. | NewExpression
  6592. | ChainExpression
  6593. | ClassExpression
  6594. | ConditionalExpression
  6595. | FunctionExpression
  6596. | Identifier
  6597. | SimpleLiteral
  6598. | RegExpLiteral
  6599. | BigIntLiteral
  6600. | LogicalExpression
  6601. | MemberExpression
  6602. | MetaProperty
  6603. | ObjectExpression
  6604. | SequenceExpression
  6605. | TaggedTemplateExpression
  6606. | TemplateLiteral
  6607. | ThisExpression
  6608. | UpdateExpression
  6609. | YieldExpression
  6610. | Super
  6611. ): {
  6612. members: string[];
  6613. object:
  6614. | ImportExpressionImport
  6615. | UnaryExpression
  6616. | ArrayExpression
  6617. | ArrowFunctionExpression
  6618. | AssignmentExpression
  6619. | AwaitExpression
  6620. | BinaryExpression
  6621. | SimpleCallExpression
  6622. | NewExpression
  6623. | ChainExpression
  6624. | ClassExpression
  6625. | ConditionalExpression
  6626. | FunctionExpression
  6627. | Identifier
  6628. | SimpleLiteral
  6629. | RegExpLiteral
  6630. | BigIntLiteral
  6631. | LogicalExpression
  6632. | MemberExpression
  6633. | MetaProperty
  6634. | ObjectExpression
  6635. | SequenceExpression
  6636. | TaggedTemplateExpression
  6637. | TemplateLiteral
  6638. | ThisExpression
  6639. | UpdateExpression
  6640. | YieldExpression
  6641. | Super;
  6642. membersOptionals: boolean[];
  6643. memberRanges: [number, number][];
  6644. };
  6645. getFreeInfoFromVariable(
  6646. varName: string
  6647. ): undefined | { name: string; info: string | VariableInfo };
  6648. getMemberExpressionInfo(
  6649. expression:
  6650. | ImportExpressionImport
  6651. | UnaryExpression
  6652. | ArrayExpression
  6653. | ArrowFunctionExpression
  6654. | AssignmentExpression
  6655. | AwaitExpression
  6656. | BinaryExpression
  6657. | SimpleCallExpression
  6658. | NewExpression
  6659. | ChainExpression
  6660. | ClassExpression
  6661. | ConditionalExpression
  6662. | FunctionExpression
  6663. | Identifier
  6664. | SimpleLiteral
  6665. | RegExpLiteral
  6666. | BigIntLiteral
  6667. | LogicalExpression
  6668. | MemberExpression
  6669. | MetaProperty
  6670. | ObjectExpression
  6671. | SequenceExpression
  6672. | TaggedTemplateExpression
  6673. | TemplateLiteral
  6674. | ThisExpression
  6675. | UpdateExpression
  6676. | YieldExpression
  6677. | Super,
  6678. allowedTypes: number
  6679. ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
  6680. getNameForExpression(
  6681. expression: MemberExpression
  6682. ):
  6683. | undefined
  6684. | {
  6685. name: string;
  6686. rootInfo: ExportedVariableInfo;
  6687. getMembers: () => string[];
  6688. };
  6689. static ALLOWED_MEMBER_TYPES_ALL: 3;
  6690. static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
  6691. static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
  6692. static getImportAttributes: (
  6693. node:
  6694. | ImportDeclarationJavascriptParser
  6695. | ExportNamedDeclarationJavascriptParser
  6696. | ExportAllDeclarationJavascriptParser
  6697. | ImportExpressionJavascriptParser
  6698. ) => undefined | ImportAttributes;
  6699. static VariableInfo: typeof VariableInfo;
  6700. }
  6701. /**
  6702. * Parser options for javascript modules.
  6703. */
  6704. declare interface JavascriptParserOptions {
  6705. [index: string]: any;
  6706. /**
  6707. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  6708. */
  6709. amd?: false | { [index: string]: any };
  6710. /**
  6711. * Enable/disable special handling for browserify bundles.
  6712. */
  6713. browserify?: boolean;
  6714. /**
  6715. * Enable/disable parsing of CommonJs syntax.
  6716. */
  6717. commonjs?: boolean;
  6718. /**
  6719. * Enable/disable parsing of magic comments in CommonJs syntax.
  6720. */
  6721. commonjsMagicComments?: boolean;
  6722. /**
  6723. * Enable/disable parsing "import { createRequire } from "module"" and evaluating createRequire().
  6724. */
  6725. createRequire?: string | boolean;
  6726. /**
  6727. * Specifies global fetchPriority for dynamic import.
  6728. */
  6729. dynamicImportFetchPriority?: false | "auto" | "low" | "high";
  6730. /**
  6731. * Specifies global mode for dynamic import.
  6732. */
  6733. dynamicImportMode?: "weak" | "eager" | "lazy" | "lazy-once";
  6734. /**
  6735. * Specifies global prefetch for dynamic import.
  6736. */
  6737. dynamicImportPrefetch?: number | boolean;
  6738. /**
  6739. * Specifies global preload for dynamic import.
  6740. */
  6741. dynamicImportPreload?: number | boolean;
  6742. /**
  6743. * Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
  6744. */
  6745. exportsPresence?: false | "auto" | "error" | "warn";
  6746. /**
  6747. * Enable warnings for full dynamic dependencies.
  6748. */
  6749. exprContextCritical?: boolean;
  6750. /**
  6751. * Enable recursive directory lookup for full dynamic dependencies.
  6752. */
  6753. exprContextRecursive?: boolean;
  6754. /**
  6755. * Sets the default regular expression for full dynamic dependencies.
  6756. */
  6757. exprContextRegExp?: boolean | RegExp;
  6758. /**
  6759. * Set the default request for full dynamic dependencies.
  6760. */
  6761. exprContextRequest?: string;
  6762. /**
  6763. * Enable/disable parsing of EcmaScript Modules syntax.
  6764. */
  6765. harmony?: boolean;
  6766. /**
  6767. * Enable/disable parsing of import() syntax.
  6768. */
  6769. import?: boolean;
  6770. /**
  6771. * Specifies the behavior of invalid export names in "import ... from ...".
  6772. */
  6773. importExportsPresence?: false | "auto" | "error" | "warn";
  6774. /**
  6775. * Enable/disable evaluating import.meta.
  6776. */
  6777. importMeta?: boolean;
  6778. /**
  6779. * Enable/disable evaluating import.meta.webpackContext.
  6780. */
  6781. importMetaContext?: boolean;
  6782. /**
  6783. * Include polyfills or mocks for various node stuff.
  6784. */
  6785. node?: false | NodeOptions;
  6786. /**
  6787. * 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.
  6788. */
  6789. overrideStrict?: "strict" | "non-strict";
  6790. /**
  6791. * 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.
  6792. */
  6793. reexportExportsPresence?: false | "auto" | "error" | "warn";
  6794. /**
  6795. * Enable/disable parsing of require.context syntax.
  6796. */
  6797. requireContext?: boolean;
  6798. /**
  6799. * Enable/disable parsing of require.ensure syntax.
  6800. */
  6801. requireEnsure?: boolean;
  6802. /**
  6803. * Enable/disable parsing of require.include syntax.
  6804. */
  6805. requireInclude?: boolean;
  6806. /**
  6807. * Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
  6808. */
  6809. requireJs?: boolean;
  6810. /**
  6811. * Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
  6812. */
  6813. strictExportPresence?: boolean;
  6814. /**
  6815. * Handle the this context correctly according to the spec for namespace objects.
  6816. */
  6817. strictThisContextOnImports?: boolean;
  6818. /**
  6819. * Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
  6820. */
  6821. system?: boolean;
  6822. /**
  6823. * Enable warnings when using the require function in a not statically analyse-able way.
  6824. */
  6825. unknownContextCritical?: boolean;
  6826. /**
  6827. * Enable recursive directory lookup when using the require function in a not statically analyse-able way.
  6828. */
  6829. unknownContextRecursive?: boolean;
  6830. /**
  6831. * Sets the regular expression when using the require function in a not statically analyse-able way.
  6832. */
  6833. unknownContextRegExp?: boolean | RegExp;
  6834. /**
  6835. * Sets the request when using the require function in a not statically analyse-able way.
  6836. */
  6837. unknownContextRequest?: string;
  6838. /**
  6839. * Enable/disable parsing of new URL() syntax.
  6840. */
  6841. url?: boolean | "relative";
  6842. /**
  6843. * Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
  6844. */
  6845. worker?: boolean | string[];
  6846. /**
  6847. * Enable warnings for partial dynamic dependencies.
  6848. */
  6849. wrappedContextCritical?: boolean;
  6850. /**
  6851. * Enable recursive directory lookup for partial dynamic dependencies.
  6852. */
  6853. wrappedContextRecursive?: boolean;
  6854. /**
  6855. * Set the inner regular expression for partial dynamic dependencies.
  6856. */
  6857. wrappedContextRegExp?: RegExp;
  6858. }
  6859. type JsonObjectFs = { [index: string]: JsonValueFs } & {
  6860. [index: string]:
  6861. | undefined
  6862. | null
  6863. | string
  6864. | number
  6865. | boolean
  6866. | JsonObjectFs
  6867. | JsonValueFs[];
  6868. };
  6869. type JsonObjectTypes = { [index: string]: JsonValueTypes } & {
  6870. [index: string]:
  6871. | undefined
  6872. | null
  6873. | string
  6874. | number
  6875. | boolean
  6876. | JsonObjectTypes
  6877. | JsonValueTypes[];
  6878. };
  6879. type JsonValueFs =
  6880. | null
  6881. | string
  6882. | number
  6883. | boolean
  6884. | JsonObjectFs
  6885. | JsonValueFs[];
  6886. type JsonValueTypes =
  6887. | null
  6888. | string
  6889. | number
  6890. | boolean
  6891. | JsonObjectTypes
  6892. | JsonValueTypes[];
  6893. declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
  6894. constructor(runtimeRequirements: ReadonlySet<string>);
  6895. static getCompilationHooks(
  6896. compilation: Compilation
  6897. ): JsonpCompilationPluginHooks;
  6898. /**
  6899. * Runtime modules without any dependencies to other runtime modules
  6900. */
  6901. static STAGE_NORMAL: number;
  6902. /**
  6903. * Runtime modules with simple dependencies on other runtime modules
  6904. */
  6905. static STAGE_BASIC: number;
  6906. /**
  6907. * Runtime modules which attach to handlers of other runtime modules
  6908. */
  6909. static STAGE_ATTACH: number;
  6910. /**
  6911. * Runtime modules which trigger actions on bootstrap
  6912. */
  6913. static STAGE_TRIGGER: number;
  6914. }
  6915. declare interface JsonpCompilationPluginHooks {
  6916. linkPreload: SyncWaterfallHook<[string, Chunk]>;
  6917. linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
  6918. }
  6919. declare class JsonpTemplatePlugin {
  6920. constructor();
  6921. /**
  6922. * Apply the plugin
  6923. */
  6924. apply(compiler: Compiler): void;
  6925. static getCompilationHooks(
  6926. compilation: Compilation
  6927. ): JsonpCompilationPluginHooks;
  6928. }
  6929. declare interface KnownAssetInfo {
  6930. /**
  6931. * true, if the asset can be long term cached forever (contains a hash)
  6932. */
  6933. immutable?: boolean;
  6934. /**
  6935. * whether the asset is minimized
  6936. */
  6937. minimized?: boolean;
  6938. /**
  6939. * the value(s) of the full hash used for this asset
  6940. */
  6941. fullhash?: string | string[];
  6942. /**
  6943. * the value(s) of the chunk hash used for this asset
  6944. */
  6945. chunkhash?: string | string[];
  6946. /**
  6947. * the value(s) of the module hash used for this asset
  6948. */
  6949. modulehash?: string | string[];
  6950. /**
  6951. * the value(s) of the content hash used for this asset
  6952. */
  6953. contenthash?: string | string[];
  6954. /**
  6955. * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
  6956. */
  6957. sourceFilename?: string;
  6958. /**
  6959. * size in bytes, only set after asset has been emitted
  6960. */
  6961. size?: number;
  6962. /**
  6963. * true, when asset is only used for development and doesn't count towards user-facing assets
  6964. */
  6965. development?: boolean;
  6966. /**
  6967. * true, when asset ships data for updating an existing application (HMR)
  6968. */
  6969. hotModuleReplacement?: boolean;
  6970. /**
  6971. * true, when asset is javascript and an ESM
  6972. */
  6973. javascriptModule?: boolean;
  6974. /**
  6975. * object of pointers to other assets, keyed by type of relation (only points from parent to child)
  6976. */
  6977. related?: Record<string, string | string[]>;
  6978. }
  6979. declare interface KnownBuildInfo {
  6980. cacheable?: boolean;
  6981. parsed?: boolean;
  6982. moduleArgument?: string;
  6983. exportsArgument?: string;
  6984. strict?: boolean;
  6985. moduleConcatenationBailout?: string;
  6986. fileDependencies?: LazySet<string>;
  6987. contextDependencies?: LazySet<string>;
  6988. missingDependencies?: LazySet<string>;
  6989. buildDependencies?: LazySet<string>;
  6990. valueDependencies?: Map<string, string | Set<string>>;
  6991. hash?: any;
  6992. assets?: Record<string, Source>;
  6993. assetsInfo?: Map<string, undefined | AssetInfo>;
  6994. snapshot?: null | Snapshot;
  6995. }
  6996. declare interface KnownBuildMeta {
  6997. exportsType?: "namespace" | "dynamic" | "default" | "flagged";
  6998. defaultObject?: false | "redirect" | "redirect-warn";
  6999. strictHarmonyModule?: boolean;
  7000. async?: boolean;
  7001. sideEffectFree?: boolean;
  7002. exportsFinalName?: Record<string, string>;
  7003. }
  7004. declare interface KnownCreateStatsOptionsContext {
  7005. forToString?: boolean;
  7006. }
  7007. declare interface KnownHooks {
  7008. resolveStep: SyncHook<
  7009. [
  7010. AsyncSeriesBailHook<
  7011. [ResolveRequest, ResolveContext],
  7012. null | ResolveRequest
  7013. >,
  7014. ResolveRequest
  7015. ]
  7016. >;
  7017. noResolve: SyncHook<[ResolveRequest, Error]>;
  7018. resolve: AsyncSeriesBailHook<
  7019. [ResolveRequest, ResolveContext],
  7020. null | ResolveRequest
  7021. >;
  7022. result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
  7023. }
  7024. declare interface KnownNormalizedStatsOptions {
  7025. context: string;
  7026. requestShortener: RequestShortener;
  7027. chunksSort: string;
  7028. modulesSort: string;
  7029. chunkModulesSort: string;
  7030. nestedModulesSort: string;
  7031. assetsSort: string;
  7032. ids: boolean;
  7033. cachedAssets: boolean;
  7034. groupAssetsByEmitStatus: boolean;
  7035. groupAssetsByPath: boolean;
  7036. groupAssetsByExtension: boolean;
  7037. assetsSpace: number;
  7038. excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
  7039. excludeModules: ((
  7040. name: string,
  7041. module: StatsModule,
  7042. type: "module" | "chunk" | "root-of-chunk" | "nested"
  7043. ) => boolean)[];
  7044. warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
  7045. cachedModules: boolean;
  7046. orphanModules: boolean;
  7047. dependentModules: boolean;
  7048. runtimeModules: boolean;
  7049. groupModulesByCacheStatus: boolean;
  7050. groupModulesByLayer: boolean;
  7051. groupModulesByAttributes: boolean;
  7052. groupModulesByPath: boolean;
  7053. groupModulesByExtension: boolean;
  7054. groupModulesByType: boolean;
  7055. entrypoints: boolean | "auto";
  7056. chunkGroups: boolean;
  7057. chunkGroupAuxiliary: boolean;
  7058. chunkGroupChildren: boolean;
  7059. chunkGroupMaxAssets: number;
  7060. modulesSpace: number;
  7061. chunkModulesSpace: number;
  7062. nestedModulesSpace: number;
  7063. logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
  7064. loggingDebug: ((value: string) => boolean)[];
  7065. loggingTrace: boolean;
  7066. }
  7067. declare interface KnownStatsAsset {
  7068. type: string;
  7069. name: string;
  7070. info: AssetInfo;
  7071. size: number;
  7072. emitted: boolean;
  7073. comparedForEmit: boolean;
  7074. cached: boolean;
  7075. related?: StatsAsset[];
  7076. chunkNames?: (string | number)[];
  7077. chunkIdHints?: (string | number)[];
  7078. chunks?: (string | number)[];
  7079. auxiliaryChunkNames?: (string | number)[];
  7080. auxiliaryChunks?: (string | number)[];
  7081. auxiliaryChunkIdHints?: (string | number)[];
  7082. filteredRelated?: number;
  7083. isOverSizeLimit?: boolean;
  7084. }
  7085. declare interface KnownStatsChunk {
  7086. rendered: boolean;
  7087. initial: boolean;
  7088. entry: boolean;
  7089. recorded: boolean;
  7090. reason?: string;
  7091. size: number;
  7092. sizes: Record<string, number>;
  7093. names: string[];
  7094. idHints: string[];
  7095. runtime?: string[];
  7096. files: string[];
  7097. auxiliaryFiles: string[];
  7098. hash: string;
  7099. childrenByOrder: Record<string, (string | number)[]>;
  7100. id?: string | number;
  7101. siblings?: (string | number)[];
  7102. parents?: (string | number)[];
  7103. children?: (string | number)[];
  7104. modules?: StatsModule[];
  7105. filteredModules?: number;
  7106. origins?: StatsChunkOrigin[];
  7107. }
  7108. declare interface KnownStatsChunkGroup {
  7109. name?: null | string;
  7110. chunks?: (string | number)[];
  7111. assets?: { name: string; size?: number }[];
  7112. filteredAssets?: number;
  7113. assetsSize?: number;
  7114. auxiliaryAssets?: { name: string; size?: number }[];
  7115. filteredAuxiliaryAssets?: number;
  7116. auxiliaryAssetsSize?: number;
  7117. children?: { [index: string]: StatsChunkGroup[] };
  7118. childAssets?: { [index: string]: string[] };
  7119. isOverSizeLimit?: boolean;
  7120. }
  7121. declare interface KnownStatsChunkOrigin {
  7122. module: string;
  7123. moduleIdentifier: string;
  7124. moduleName: string;
  7125. loc: string;
  7126. request: string;
  7127. moduleId?: string | number;
  7128. }
  7129. declare interface KnownStatsCompilation {
  7130. env?: any;
  7131. name?: string;
  7132. hash?: string;
  7133. version?: string;
  7134. time?: number;
  7135. builtAt?: number;
  7136. needAdditionalPass?: boolean;
  7137. publicPath?: string;
  7138. outputPath?: string;
  7139. assetsByChunkName?: Record<string, string[]>;
  7140. assets?: StatsAsset[];
  7141. filteredAssets?: number;
  7142. chunks?: StatsChunk[];
  7143. modules?: StatsModule[];
  7144. filteredModules?: number;
  7145. entrypoints?: Record<string, StatsChunkGroup>;
  7146. namedChunkGroups?: Record<string, StatsChunkGroup>;
  7147. errors?: StatsError[];
  7148. errorsCount?: number;
  7149. warnings?: StatsError[];
  7150. warningsCount?: number;
  7151. children?: StatsCompilation[];
  7152. logging?: Record<string, StatsLogging>;
  7153. }
  7154. declare interface KnownStatsError {
  7155. message: string;
  7156. chunkName?: string;
  7157. chunkEntry?: boolean;
  7158. chunkInitial?: boolean;
  7159. file?: string;
  7160. moduleIdentifier?: string;
  7161. moduleName?: string;
  7162. loc?: string;
  7163. chunkId?: string | number;
  7164. moduleId?: string | number;
  7165. moduleTrace?: StatsModuleTraceItem[];
  7166. details?: any;
  7167. stack?: string;
  7168. }
  7169. declare interface KnownStatsFactoryContext {
  7170. type: string;
  7171. makePathsRelative: (arg0: string) => string;
  7172. compilation: Compilation;
  7173. rootModules: Set<Module>;
  7174. compilationFileToChunks: Map<string, Chunk[]>;
  7175. compilationAuxiliaryFileToChunks: Map<string, Chunk[]>;
  7176. runtime: RuntimeSpec;
  7177. cachedGetErrors: (arg0: Compilation) => WebpackError[];
  7178. cachedGetWarnings: (arg0: Compilation) => WebpackError[];
  7179. }
  7180. declare interface KnownStatsLogging {
  7181. entries: StatsLoggingEntry[];
  7182. filteredEntries: number;
  7183. debug: boolean;
  7184. }
  7185. declare interface KnownStatsLoggingEntry {
  7186. type: string;
  7187. message?: string;
  7188. trace?: string[];
  7189. children?: StatsLoggingEntry[];
  7190. args?: any[];
  7191. time?: number;
  7192. }
  7193. declare interface KnownStatsModule {
  7194. type?: string;
  7195. moduleType?: string;
  7196. layer?: null | string;
  7197. identifier?: string;
  7198. name?: string;
  7199. nameForCondition?: null | string;
  7200. index?: number;
  7201. preOrderIndex?: number;
  7202. index2?: number;
  7203. postOrderIndex?: number;
  7204. size?: number;
  7205. sizes?: { [index: string]: number };
  7206. cacheable?: boolean;
  7207. built?: boolean;
  7208. codeGenerated?: boolean;
  7209. buildTimeExecuted?: boolean;
  7210. cached?: boolean;
  7211. optional?: boolean;
  7212. orphan?: boolean;
  7213. id?: string | number;
  7214. issuerId?: null | string | number;
  7215. chunks?: (string | number)[];
  7216. assets?: (string | number)[];
  7217. dependent?: boolean;
  7218. issuer?: null | string;
  7219. issuerName?: null | string;
  7220. issuerPath?: StatsModuleIssuer[];
  7221. failed?: boolean;
  7222. errors?: number;
  7223. warnings?: number;
  7224. profile?: StatsProfile;
  7225. reasons?: StatsModuleReason[];
  7226. usedExports?: null | boolean | string[];
  7227. providedExports?: null | string[];
  7228. optimizationBailout?: string[];
  7229. depth?: null | number;
  7230. modules?: StatsModule[];
  7231. filteredModules?: number;
  7232. source?: string | Buffer;
  7233. }
  7234. declare interface KnownStatsModuleIssuer {
  7235. identifier: string;
  7236. name: string;
  7237. id?: string | number;
  7238. profile: StatsProfile;
  7239. }
  7240. declare interface KnownStatsModuleReason {
  7241. moduleIdentifier: null | string;
  7242. module: null | string;
  7243. moduleName: null | string;
  7244. resolvedModuleIdentifier: null | string;
  7245. resolvedModule: null | string;
  7246. type: null | string;
  7247. active: boolean;
  7248. explanation: null | string;
  7249. userRequest: null | string;
  7250. loc?: null | string;
  7251. moduleId?: null | string | number;
  7252. resolvedModuleId?: null | string | number;
  7253. }
  7254. declare interface KnownStatsModuleTraceDependency {
  7255. loc?: string;
  7256. }
  7257. declare interface KnownStatsModuleTraceItem {
  7258. originIdentifier?: string;
  7259. originName?: string;
  7260. moduleIdentifier?: string;
  7261. moduleName?: string;
  7262. dependencies?: StatsModuleTraceDependency[];
  7263. originId?: string | number;
  7264. moduleId?: string | number;
  7265. }
  7266. declare interface KnownStatsPrinterColorFn {
  7267. bold?: (str: string) => string;
  7268. yellow?: (str: string) => string;
  7269. red?: (str: string) => string;
  7270. green?: (str: string) => string;
  7271. magenta?: (str: string) => string;
  7272. cyan?: (str: string) => string;
  7273. }
  7274. declare interface KnownStatsPrinterContext {
  7275. type?: string;
  7276. compilation?: StatsCompilation;
  7277. chunkGroup?: StatsChunkGroup;
  7278. chunkGroupKind?: string;
  7279. asset?: StatsAsset;
  7280. module?: StatsModule;
  7281. chunk?: StatsChunk;
  7282. moduleReason?: StatsModuleReason;
  7283. moduleIssuer?: StatsModuleIssuer;
  7284. error?: StatsError;
  7285. profile?: StatsProfile;
  7286. logging?: StatsLogging;
  7287. moduleTraceItem?: StatsModuleTraceItem;
  7288. moduleTraceDependency?: StatsModuleTraceDependency;
  7289. }
  7290. declare interface KnownStatsPrinterFormaters {
  7291. formatFilename?: (file: string, oversize?: boolean) => string;
  7292. formatModuleId?: (id: string) => string;
  7293. formatChunkId?: (
  7294. id: string,
  7295. direction?: "parent" | "child" | "sibling"
  7296. ) => string;
  7297. formatSize?: (size: number) => string;
  7298. formatLayer?: (size: string) => string;
  7299. formatDateTime?: (dateTime: number) => string;
  7300. formatFlag?: (flag: string) => string;
  7301. formatTime?: (time: number, boldQuantity?: boolean) => string;
  7302. formatError?: (message: string) => string;
  7303. }
  7304. declare interface KnownStatsProfile {
  7305. total: number;
  7306. resolving: number;
  7307. restoring: number;
  7308. building: number;
  7309. integration: number;
  7310. storing: number;
  7311. additionalResolving: number;
  7312. additionalIntegration: number;
  7313. factory: number;
  7314. dependencies: number;
  7315. }
  7316. declare interface LStatFs {
  7317. (
  7318. path: PathLikeFs,
  7319. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  7320. ): void;
  7321. (
  7322. path: PathLikeFs,
  7323. options: undefined | (StatOptions & { bigint?: false }),
  7324. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  7325. ): void;
  7326. (
  7327. path: PathLikeFs,
  7328. options: StatOptions & { bigint: true },
  7329. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  7330. ): void;
  7331. (
  7332. path: PathLikeFs,
  7333. options: undefined | StatOptions,
  7334. callback: (
  7335. arg0: null | NodeJS.ErrnoException,
  7336. arg1?: IStats | IBigIntStats
  7337. ) => void
  7338. ): void;
  7339. }
  7340. declare interface LStatSync {
  7341. (path: PathLikeFs, options?: undefined): IStats;
  7342. (
  7343. path: PathLikeFs,
  7344. options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
  7345. ): undefined | IStats;
  7346. (
  7347. path: PathLikeFs,
  7348. options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
  7349. ): undefined | IBigIntStats;
  7350. (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
  7351. (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
  7352. (
  7353. path: PathLikeFs,
  7354. options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
  7355. ): IStats | IBigIntStats;
  7356. (
  7357. path: PathLikeFs,
  7358. options?: StatSyncOptions
  7359. ): undefined | IStats | IBigIntStats;
  7360. }
  7361. declare interface LStatTypes {
  7362. (
  7363. path: PathLikeTypes,
  7364. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  7365. ): void;
  7366. (
  7367. path: PathLikeTypes,
  7368. options: undefined | (StatOptions & { bigint?: false }),
  7369. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  7370. ): void;
  7371. (
  7372. path: PathLikeTypes,
  7373. options: StatOptions & { bigint: true },
  7374. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  7375. ): void;
  7376. (
  7377. path: PathLikeTypes,
  7378. options: undefined | StatOptions,
  7379. callback: (
  7380. arg0: null | NodeJS.ErrnoException,
  7381. arg1?: IStats | IBigIntStats
  7382. ) => void
  7383. ): void;
  7384. }
  7385. /**
  7386. * Options for the default backend.
  7387. */
  7388. declare interface LazyCompilationDefaultBackendOptions {
  7389. /**
  7390. * A custom client.
  7391. */
  7392. client?: string;
  7393. /**
  7394. * Specifies where to listen to from the server.
  7395. */
  7396. listen?: number | ListenOptions | ((server: Server) => void);
  7397. /**
  7398. * Specifies the protocol the client should use to connect to the server.
  7399. */
  7400. protocol?: "http" | "https";
  7401. /**
  7402. * Specifies how to create the server handling the EventSource requests.
  7403. */
  7404. server?:
  7405. | ServerOptionsImport<typeof IncomingMessage>
  7406. | ServerOptionsHttps<typeof IncomingMessage, typeof ServerResponse>
  7407. | (() => Server);
  7408. }
  7409. /**
  7410. * Options for compiling entrypoints and import()s only when they are accessed.
  7411. */
  7412. declare interface LazyCompilationOptions {
  7413. /**
  7414. * Specifies the backend that should be used for handling client keep alive.
  7415. */
  7416. backend?:
  7417. | ((
  7418. compiler: Compiler,
  7419. callback: (err: null | Error, api?: BackendApi) => void
  7420. ) => void)
  7421. | ((compiler: Compiler) => Promise<BackendApi>)
  7422. | LazyCompilationDefaultBackendOptions;
  7423. /**
  7424. * Enable/disable lazy compilation for entries.
  7425. */
  7426. entries?: boolean;
  7427. /**
  7428. * Enable/disable lazy compilation for import() modules.
  7429. */
  7430. imports?: boolean;
  7431. /**
  7432. * Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.
  7433. */
  7434. test?: string | RegExp | ((module: Module) => boolean);
  7435. }
  7436. declare class LazySet<T> {
  7437. constructor(iterable?: Iterable<T>);
  7438. get size(): number;
  7439. add(item: T): LazySet<T>;
  7440. addAll(iterable: LazySet<T> | Iterable<T>): LazySet<T>;
  7441. clear(): void;
  7442. delete(value: T): boolean;
  7443. entries(): IterableIterator<[T, T]>;
  7444. forEach(
  7445. callbackFn: (arg0: T, arg1: T, arg2: Set<T>) => void,
  7446. thisArg?: any
  7447. ): void;
  7448. has(item: T): boolean;
  7449. keys(): IterableIterator<T>;
  7450. values(): IterableIterator<T>;
  7451. serialize(__0: ObjectSerializerContext): void;
  7452. [Symbol.iterator](): IterableIterator<T>;
  7453. static deserialize<T>(__0: ObjectDeserializerContext): LazySet<T>;
  7454. }
  7455. declare interface LibIdentOptions {
  7456. /**
  7457. * absolute context path to which lib ident is relative to
  7458. */
  7459. context: string;
  7460. /**
  7461. * object for caching
  7462. */
  7463. associatedObjectForCache?: object;
  7464. }
  7465. declare class LibManifestPlugin {
  7466. constructor(options: LibManifestPluginOptions);
  7467. options: LibManifestPluginOptions;
  7468. /**
  7469. * Apply the plugin
  7470. */
  7471. apply(compiler: Compiler): void;
  7472. }
  7473. declare interface LibManifestPluginOptions {
  7474. /**
  7475. * Context of requests in the manifest file (defaults to the webpack context).
  7476. */
  7477. context?: string;
  7478. /**
  7479. * If true, only entry points will be exposed (default: true).
  7480. */
  7481. entryOnly?: boolean;
  7482. /**
  7483. * If true, manifest json file (output) will be formatted.
  7484. */
  7485. format?: boolean;
  7486. /**
  7487. * Name of the exposed dll function (external name, use value of 'output.library').
  7488. */
  7489. name?: string;
  7490. /**
  7491. * Absolute path to the manifest json file (output).
  7492. */
  7493. path: string;
  7494. /**
  7495. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  7496. */
  7497. type?: string;
  7498. }
  7499. declare interface LibraryContext<T> {
  7500. compilation: Compilation;
  7501. chunkGraph: ChunkGraph;
  7502. options: T;
  7503. }
  7504. /**
  7505. * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
  7506. */
  7507. declare interface LibraryCustomUmdCommentObject {
  7508. /**
  7509. * Set comment for `amd` section in UMD.
  7510. */
  7511. amd?: string;
  7512. /**
  7513. * Set comment for `commonjs` (exports) section in UMD.
  7514. */
  7515. commonjs?: string;
  7516. /**
  7517. * Set comment for `commonjs2` (module.exports) section in UMD.
  7518. */
  7519. commonjs2?: string;
  7520. /**
  7521. * Set comment for `root` (global variable) section in UMD.
  7522. */
  7523. root?: string;
  7524. }
  7525. /**
  7526. * Description object for all UMD variants of the library name.
  7527. */
  7528. declare interface LibraryCustomUmdObject {
  7529. /**
  7530. * Name of the exposed AMD library in the UMD.
  7531. */
  7532. amd?: string;
  7533. /**
  7534. * Name of the exposed commonjs export in the UMD.
  7535. */
  7536. commonjs?: string;
  7537. /**
  7538. * Name of the property exposed globally by a UMD library.
  7539. */
  7540. root?: string | string[];
  7541. }
  7542. type LibraryExport = string | string[];
  7543. type LibraryName = string | string[] | LibraryCustomUmdObject;
  7544. /**
  7545. * Options for library.
  7546. */
  7547. declare interface LibraryOptions {
  7548. /**
  7549. * Add a container for define/require functions in the AMD module.
  7550. */
  7551. amdContainer?: string;
  7552. /**
  7553. * Add a comment in the UMD wrapper.
  7554. */
  7555. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  7556. /**
  7557. * Specify which export should be exposed as library.
  7558. */
  7559. export?: string | string[];
  7560. /**
  7561. * The name of the library (some types allow unnamed libraries too).
  7562. */
  7563. name?: string | string[] | LibraryCustomUmdObject;
  7564. /**
  7565. * 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).
  7566. */
  7567. type: string;
  7568. /**
  7569. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  7570. */
  7571. umdNamedDefine?: boolean;
  7572. }
  7573. declare class LibraryTemplatePlugin {
  7574. constructor(
  7575. name: LibraryName,
  7576. target: string,
  7577. umdNamedDefine: boolean,
  7578. auxiliaryComment: AuxiliaryComment,
  7579. exportProperty: LibraryExport
  7580. );
  7581. library: {
  7582. type: string;
  7583. name: LibraryName;
  7584. umdNamedDefine: boolean;
  7585. auxiliaryComment: AuxiliaryComment;
  7586. export: LibraryExport;
  7587. };
  7588. /**
  7589. * Apply the plugin
  7590. */
  7591. apply(compiler: Compiler): void;
  7592. }
  7593. declare class LimitChunkCountPlugin {
  7594. constructor(options?: LimitChunkCountPluginOptions);
  7595. options: LimitChunkCountPluginOptions;
  7596. apply(compiler: Compiler): void;
  7597. }
  7598. declare interface LimitChunkCountPluginOptions {
  7599. /**
  7600. * Constant overhead for a chunk.
  7601. */
  7602. chunkOverhead?: number;
  7603. /**
  7604. * Multiplicator for initial chunks.
  7605. */
  7606. entryChunkMultiplicator?: number;
  7607. /**
  7608. * Limit the maximum number of chunks using a value greater greater than or equal to 1.
  7609. */
  7610. maxChunks: number;
  7611. }
  7612. type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
  7613. declare interface LoadScriptCompilationHooks {
  7614. createScript: SyncWaterfallHook<[string, Chunk]>;
  7615. }
  7616. declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
  7617. constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
  7618. static getCompilationHooks(
  7619. compilation: Compilation
  7620. ): LoadScriptCompilationHooks;
  7621. /**
  7622. * Runtime modules without any dependencies to other runtime modules
  7623. */
  7624. static STAGE_NORMAL: number;
  7625. /**
  7626. * Runtime modules with simple dependencies on other runtime modules
  7627. */
  7628. static STAGE_BASIC: number;
  7629. /**
  7630. * Runtime modules which attach to handlers of other runtime modules
  7631. */
  7632. static STAGE_ATTACH: number;
  7633. /**
  7634. * Runtime modules which trigger actions on bootstrap
  7635. */
  7636. static STAGE_TRIGGER: number;
  7637. }
  7638. /**
  7639. * Custom values available in the loader context.
  7640. */
  7641. declare interface Loader {
  7642. [index: string]: any;
  7643. }
  7644. type LoaderContextDeclarationsIndex<OptionsType> =
  7645. NormalModuleLoaderContext<OptionsType> &
  7646. LoaderRunnerLoaderContext<OptionsType> &
  7647. LoaderPluginLoaderContext &
  7648. HotModuleReplacementPluginLoaderContext;
  7649. type LoaderContextNormalModule<T> = NormalModuleLoaderContext<T> &
  7650. LoaderRunnerLoaderContext<T> &
  7651. LoaderPluginLoaderContext &
  7652. HotModuleReplacementPluginLoaderContext;
  7653. type LoaderDefinition<
  7654. OptionsType = {},
  7655. ContextAdditions = {}
  7656. > = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  7657. raw?: false;
  7658. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  7659. };
  7660. declare interface LoaderDefinitionFunction<
  7661. OptionsType = {},
  7662. ContextAdditions = {}
  7663. > {
  7664. (
  7665. this: NormalModuleLoaderContext<OptionsType> &
  7666. LoaderRunnerLoaderContext<OptionsType> &
  7667. LoaderPluginLoaderContext &
  7668. HotModuleReplacementPluginLoaderContext &
  7669. ContextAdditions,
  7670. content: string,
  7671. sourceMap?: string | SourceMap,
  7672. additionalData?: AdditionalData
  7673. ): string | void | Buffer | Promise<string | Buffer>;
  7674. }
  7675. declare interface LoaderItem {
  7676. loader: string;
  7677. options: any;
  7678. ident: null | string;
  7679. type: null | string;
  7680. }
  7681. declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
  7682. default?:
  7683. | RawLoaderDefinitionFunction<OptionsType, ContextAdditions>
  7684. | LoaderDefinitionFunction<OptionsType, ContextAdditions>;
  7685. raw?: false;
  7686. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  7687. }
  7688. declare class LoaderOptionsPlugin {
  7689. constructor(options?: LoaderOptionsPluginOptions & MatchObject);
  7690. options: LoaderOptionsPluginOptions & MatchObject;
  7691. /**
  7692. * Apply the plugin
  7693. */
  7694. apply(compiler: Compiler): void;
  7695. }
  7696. declare interface LoaderOptionsPluginOptions {
  7697. [index: string]: any;
  7698. /**
  7699. * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3.
  7700. */
  7701. debug?: boolean;
  7702. /**
  7703. * Where loaders can be switched to minimize mode.
  7704. */
  7705. minimize?: boolean;
  7706. /**
  7707. * A configuration object that can be used to configure older loaders.
  7708. */
  7709. options?: {
  7710. [index: string]: any;
  7711. /**
  7712. * The context that can be used to configure older loaders.
  7713. */
  7714. context?: string;
  7715. };
  7716. }
  7717. /**
  7718. * These properties are added by the LoaderPlugin
  7719. */
  7720. declare interface LoaderPluginLoaderContext {
  7721. /**
  7722. * Resolves the given request to a module, applies all configured loaders and calls
  7723. * back with the generated source, the sourceMap and the module instance (usually an
  7724. * instance of NormalModule). Use this function if you need to know the source code
  7725. * of another module to generate the result.
  7726. */
  7727. loadModule(
  7728. request: string,
  7729. callback: (
  7730. err: null | Error,
  7731. source?: string | Buffer,
  7732. sourceMap?: null | object,
  7733. module?: Module
  7734. ) => void
  7735. ): void;
  7736. importModule(
  7737. request: string,
  7738. options: undefined | ImportModuleOptions,
  7739. callback: (err?: null | Error, exports?: any) => any
  7740. ): void;
  7741. importModule(request: string, options?: ImportModuleOptions): Promise<any>;
  7742. }
  7743. /**
  7744. * The properties are added by https://github.com/webpack/loader-runner
  7745. */
  7746. declare interface LoaderRunnerLoaderContext<OptionsType> {
  7747. /**
  7748. * Add a directory as dependency of the loader result.
  7749. */
  7750. addContextDependency(context: string): void;
  7751. /**
  7752. * Adds a file as dependency of the loader result in order to make them watchable.
  7753. * For example, html-loader uses this technique as it finds src and src-set attributes.
  7754. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  7755. */
  7756. addDependency(file: string): void;
  7757. addMissingDependency(context: string): void;
  7758. /**
  7759. * Make this loader async.
  7760. */
  7761. async(): (
  7762. err?: null | Error,
  7763. content?: string | Buffer,
  7764. sourceMap?: string | SourceMap,
  7765. additionalData?: AdditionalData
  7766. ) => void;
  7767. /**
  7768. * Make this loader result cacheable. By default it's cacheable.
  7769. * A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed.
  7770. * This means the loader shouldn't have other dependencies than specified with this.addDependency.
  7771. * Most loaders are deterministic and cacheable.
  7772. */
  7773. cacheable(flag?: boolean): void;
  7774. callback: (
  7775. err?: null | Error,
  7776. content?: string | Buffer,
  7777. sourceMap?: string | SourceMap,
  7778. additionalData?: AdditionalData
  7779. ) => void;
  7780. /**
  7781. * Remove all dependencies of the loader result. Even initial dependencies and these of other loaders.
  7782. */
  7783. clearDependencies(): void;
  7784. /**
  7785. * The directory of the module. Can be used as context for resolving other stuff.
  7786. * eg '/workspaces/ts-loader/examples/vanilla/src'
  7787. */
  7788. context: string;
  7789. readonly currentRequest: string;
  7790. readonly data: any;
  7791. /**
  7792. * alias of addDependency
  7793. * Adds a file as dependency of the loader result in order to make them watchable.
  7794. * For example, html-loader uses this technique as it finds src and src-set attributes.
  7795. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  7796. */
  7797. dependency(file: string): void;
  7798. getContextDependencies(): string[];
  7799. getDependencies(): string[];
  7800. getMissingDependencies(): string[];
  7801. /**
  7802. * The index in the loaders array of the current loader.
  7803. * In the example: in loader1: 0, in loader2: 1
  7804. */
  7805. loaderIndex: number;
  7806. readonly previousRequest: string;
  7807. readonly query: string | OptionsType;
  7808. readonly remainingRequest: string;
  7809. readonly request: string;
  7810. /**
  7811. * An array of all the loaders. It is writeable in the pitch phase.
  7812. * loaders = [{request: string, path: string, query: string, module: function}]
  7813. * In the example:
  7814. * [
  7815. * { request: "/abc/loader1.js?xyz",
  7816. * path: "/abc/loader1.js",
  7817. * query: "?xyz",
  7818. * module: [Function]
  7819. * },
  7820. * { request: "/abc/node_modules/loader2/index.js",
  7821. * path: "/abc/node_modules/loader2/index.js",
  7822. * query: "",
  7823. * module: [Function]
  7824. * }
  7825. * ]
  7826. */
  7827. loaders: {
  7828. request: string;
  7829. path: string;
  7830. query: string;
  7831. fragment: string;
  7832. options?: string | object;
  7833. ident: string;
  7834. normal?: Function;
  7835. pitch?: Function;
  7836. raw?: boolean;
  7837. data?: object;
  7838. pitchExecuted: boolean;
  7839. normalExecuted: boolean;
  7840. type?: "module" | "commonjs";
  7841. }[];
  7842. /**
  7843. * The resource path.
  7844. * In the example: "/abc/resource.js"
  7845. */
  7846. resourcePath: string;
  7847. /**
  7848. * The resource query string.
  7849. * Example: "?query"
  7850. */
  7851. resourceQuery: string;
  7852. /**
  7853. * The resource fragment.
  7854. * Example: "#frag"
  7855. */
  7856. resourceFragment: string;
  7857. /**
  7858. * The resource inclusive query and fragment.
  7859. * Example: "/abc/resource.js?query#frag"
  7860. */
  7861. resource: string;
  7862. /**
  7863. * Target of compilation.
  7864. * Example: "web"
  7865. */
  7866. target: string;
  7867. /**
  7868. * Tell what kind of ES-features may be used in the generated runtime-code.
  7869. * Example: { arrowFunction: true }
  7870. */
  7871. environment: Environment;
  7872. }
  7873. declare class LoaderTargetPlugin {
  7874. constructor(target: string);
  7875. target: string;
  7876. /**
  7877. * Apply the plugin
  7878. */
  7879. apply(compiler: Compiler): void;
  7880. }
  7881. declare interface LogEntry {
  7882. type: string;
  7883. args?: any[];
  7884. time: number;
  7885. trace?: string[];
  7886. }
  7887. type LogTypeEnum =
  7888. | "error"
  7889. | "warn"
  7890. | "info"
  7891. | "log"
  7892. | "debug"
  7893. | "profile"
  7894. | "trace"
  7895. | "group"
  7896. | "groupCollapsed"
  7897. | "groupEnd"
  7898. | "profileEnd"
  7899. | "time"
  7900. | "clear"
  7901. | "status";
  7902. declare const MEASURE_END_OPERATION: unique symbol;
  7903. declare const MEASURE_START_OPERATION: unique symbol;
  7904. declare interface MainRenderContext {
  7905. /**
  7906. * the chunk
  7907. */
  7908. chunk: Chunk;
  7909. /**
  7910. * the dependency templates
  7911. */
  7912. dependencyTemplates: DependencyTemplates;
  7913. /**
  7914. * the runtime template
  7915. */
  7916. runtimeTemplate: RuntimeTemplate;
  7917. /**
  7918. * the module graph
  7919. */
  7920. moduleGraph: ModuleGraph;
  7921. /**
  7922. * the chunk graph
  7923. */
  7924. chunkGraph: ChunkGraph;
  7925. /**
  7926. * results of code generation
  7927. */
  7928. codeGenerationResults: CodeGenerationResults;
  7929. /**
  7930. * hash to be used for render call
  7931. */
  7932. hash: string;
  7933. /**
  7934. * rendering in strict context
  7935. */
  7936. strictMode?: boolean;
  7937. }
  7938. declare abstract class MainTemplate {
  7939. hooks: Readonly<{
  7940. renderManifest: {
  7941. tap: <AdditionalOptions>(
  7942. options:
  7943. | string
  7944. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  7945. fn: (
  7946. arg0: RenderManifestEntry[],
  7947. arg1: RenderManifestOptions
  7948. ) => RenderManifestEntry[]
  7949. ) => void;
  7950. };
  7951. modules: { tap: () => never };
  7952. moduleObj: { tap: () => never };
  7953. require: {
  7954. tap: <AdditionalOptions>(
  7955. options:
  7956. | string
  7957. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  7958. fn: (arg0: string, arg1: RenderBootstrapContext) => string
  7959. ) => void;
  7960. };
  7961. beforeStartup: { tap: () => never };
  7962. startup: { tap: () => never };
  7963. afterStartup: { tap: () => never };
  7964. render: {
  7965. tap: <AdditionalOptions>(
  7966. options:
  7967. | string
  7968. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  7969. fn: (
  7970. arg0: Source,
  7971. arg1: Chunk,
  7972. arg2: undefined | string,
  7973. arg3: ModuleTemplate,
  7974. arg4: DependencyTemplates
  7975. ) => Source
  7976. ) => void;
  7977. };
  7978. renderWithEntry: {
  7979. tap: <AdditionalOptions>(
  7980. options:
  7981. | string
  7982. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  7983. fn: (arg0: Source, arg1: Chunk, arg2?: string) => Source
  7984. ) => void;
  7985. };
  7986. assetPath: {
  7987. tap: <AdditionalOptions>(
  7988. options:
  7989. | string
  7990. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  7991. fn: (arg0: string, arg1: object, arg2?: AssetInfo) => string
  7992. ) => void;
  7993. call: (filename: TemplatePath, options: PathData) => string;
  7994. };
  7995. hash: {
  7996. tap: <AdditionalOptions>(
  7997. options:
  7998. | string
  7999. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8000. fn: (arg0: Hash) => void
  8001. ) => void;
  8002. };
  8003. hashForChunk: {
  8004. tap: <AdditionalOptions>(
  8005. options:
  8006. | string
  8007. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8008. fn: (arg0: Hash, arg1: Chunk) => void
  8009. ) => void;
  8010. };
  8011. globalHashPaths: { tap: () => void };
  8012. globalHash: { tap: () => void };
  8013. hotBootstrap: { tap: () => never };
  8014. bootstrap: SyncWaterfallHook<
  8015. [string, Chunk, string, ModuleTemplate, DependencyTemplates]
  8016. >;
  8017. localVars: SyncWaterfallHook<[string, Chunk, string]>;
  8018. requireExtensions: SyncWaterfallHook<[string, Chunk, string]>;
  8019. requireEnsure: SyncWaterfallHook<[string, Chunk, string, string]>;
  8020. get jsonpScript(): SyncWaterfallHook<[string, Chunk]>;
  8021. get linkPrefetch(): SyncWaterfallHook<[string, Chunk]>;
  8022. get linkPreload(): SyncWaterfallHook<[string, Chunk]>;
  8023. }>;
  8024. renderCurrentHashCode: (hash: string, length?: number) => string;
  8025. getPublicPath: (options: PathData) => string;
  8026. getAssetPath: (path: TemplatePath, options: PathData) => string;
  8027. getAssetPathWithInfo: (
  8028. path: TemplatePath,
  8029. options: PathData
  8030. ) => InterpolatedPathAndAssetInfo;
  8031. get requireFn(): "__webpack_require__";
  8032. get outputOptions(): Output;
  8033. }
  8034. declare interface MakeDirectoryOptions {
  8035. recursive?: boolean;
  8036. mode?: string | number;
  8037. }
  8038. declare interface MapOptions {
  8039. columns?: boolean;
  8040. module?: boolean;
  8041. }
  8042. declare interface MatchObject {
  8043. test?: string | RegExp | (string | RegExp)[];
  8044. include?: string | RegExp | (string | RegExp)[];
  8045. exclude?: string | RegExp | (string | RegExp)[];
  8046. }
  8047. type Matcher = string | RegExp | (string | RegExp)[];
  8048. type Media = undefined | string;
  8049. /**
  8050. * Options object for in-memory caching.
  8051. */
  8052. declare interface MemoryCacheOptions {
  8053. /**
  8054. * Additionally cache computation of modules that are unchanged and reference only unchanged modules.
  8055. */
  8056. cacheUnaffected?: boolean;
  8057. /**
  8058. * 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).
  8059. */
  8060. maxGenerations?: number;
  8061. /**
  8062. * In memory caching.
  8063. */
  8064. type: "memory";
  8065. }
  8066. declare class MemoryCachePlugin {
  8067. constructor();
  8068. /**
  8069. * Apply the plugin
  8070. */
  8071. apply(compiler: Compiler): void;
  8072. }
  8073. declare class MergeDuplicateChunksPlugin {
  8074. constructor(options?: MergeDuplicateChunksPluginOptions);
  8075. options: MergeDuplicateChunksPluginOptions;
  8076. apply(compiler: Compiler): void;
  8077. }
  8078. declare interface MergeDuplicateChunksPluginOptions {
  8079. /**
  8080. * Specifies the stage for merging duplicate chunks.
  8081. */
  8082. stage?: number;
  8083. }
  8084. declare class MinChunkSizePlugin {
  8085. constructor(options: MinChunkSizePluginOptions);
  8086. options: MinChunkSizePluginOptions;
  8087. /**
  8088. * Apply the plugin
  8089. */
  8090. apply(compiler: Compiler): void;
  8091. }
  8092. declare interface MinChunkSizePluginOptions {
  8093. /**
  8094. * Constant overhead for a chunk.
  8095. */
  8096. chunkOverhead?: number;
  8097. /**
  8098. * Multiplicator for initial chunks.
  8099. */
  8100. entryChunkMultiplicator?: number;
  8101. /**
  8102. * Minimum number of characters.
  8103. */
  8104. minChunkSize: number;
  8105. }
  8106. declare interface Mkdir {
  8107. (
  8108. file: PathLikeFs,
  8109. options: MakeDirectoryOptions & { recursive: true },
  8110. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  8111. ): void;
  8112. (
  8113. file: PathLikeFs,
  8114. options:
  8115. | undefined
  8116. | null
  8117. | string
  8118. | number
  8119. | (MakeDirectoryOptions & { recursive?: false }),
  8120. callback: (arg0: null | NodeJS.ErrnoException) => void
  8121. ): void;
  8122. (
  8123. file: PathLikeFs,
  8124. options: undefined | null | string | number | MakeDirectoryOptions,
  8125. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  8126. ): void;
  8127. (
  8128. file: PathLikeFs,
  8129. callback: (arg0: null | NodeJS.ErrnoException) => void
  8130. ): void;
  8131. }
  8132. declare interface MkdirSync {
  8133. (
  8134. path: PathLikeFs,
  8135. options: MakeDirectoryOptions & { recursive: true }
  8136. ): undefined | string;
  8137. (
  8138. path: PathLikeFs,
  8139. options?:
  8140. | null
  8141. | string
  8142. | number
  8143. | (MakeDirectoryOptions & { recursive?: false })
  8144. ): void;
  8145. (
  8146. path: PathLikeFs,
  8147. options?: null | string | number | MakeDirectoryOptions
  8148. ): undefined | string;
  8149. }
  8150. declare class Module extends DependenciesBlock {
  8151. constructor(type: string, context?: null | string, layer?: null | string);
  8152. type: string;
  8153. context: null | string;
  8154. layer: null | string;
  8155. needId: boolean;
  8156. debugId: number;
  8157. resolveOptions?: ResolveOptions;
  8158. factoryMeta?: FactoryMeta;
  8159. useSourceMap: boolean;
  8160. useSimpleSourceMap: boolean;
  8161. hot: boolean;
  8162. buildMeta?: BuildMeta;
  8163. buildInfo?: BuildInfo;
  8164. presentationalDependencies?: Dependency[];
  8165. codeGenerationDependencies?: Dependency[];
  8166. id: null | string | number;
  8167. get hash(): string;
  8168. get renderedHash(): string;
  8169. profile?: ModuleProfile;
  8170. index: null | number;
  8171. index2: null | number;
  8172. depth: null | number;
  8173. issuer?: null | Module;
  8174. get usedExports(): null | boolean | SortableSet<string>;
  8175. get optimizationBailout(): (
  8176. | string
  8177. | ((requestShortener: RequestShortener) => string)
  8178. )[];
  8179. get optional(): boolean;
  8180. addChunk(chunk: Chunk): boolean;
  8181. removeChunk(chunk: Chunk): void;
  8182. isInChunk(chunk: Chunk): boolean;
  8183. isEntryModule(): boolean;
  8184. getChunks(): Chunk[];
  8185. getNumberOfChunks(): number;
  8186. get chunksIterable(): Iterable<Chunk>;
  8187. isProvided(exportName: string): null | boolean;
  8188. get exportsArgument(): string;
  8189. get moduleArgument(): string;
  8190. getExportsType(
  8191. moduleGraph: ModuleGraph,
  8192. strict?: boolean
  8193. ): "namespace" | "default-only" | "default-with-named" | "dynamic";
  8194. addPresentationalDependency(presentationalDependency: Dependency): void;
  8195. addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
  8196. addWarning(warning: WebpackError): void;
  8197. getWarnings(): undefined | Iterable<WebpackError>;
  8198. getNumberOfWarnings(): number;
  8199. addError(error: WebpackError): void;
  8200. getErrors(): undefined | Iterable<WebpackError>;
  8201. getNumberOfErrors(): number;
  8202. /**
  8203. * removes all warnings and errors
  8204. */
  8205. clearWarningsAndErrors(): void;
  8206. isOptional(moduleGraph: ModuleGraph): boolean;
  8207. isAccessibleInChunk(
  8208. chunkGraph: ChunkGraph,
  8209. chunk: Chunk,
  8210. ignoreChunk?: Chunk
  8211. ): boolean;
  8212. isAccessibleInChunkGroup(
  8213. chunkGraph: ChunkGraph,
  8214. chunkGroup: ChunkGroup,
  8215. ignoreChunk?: Chunk
  8216. ): boolean;
  8217. hasReasonForChunk(
  8218. chunk: Chunk,
  8219. moduleGraph: ModuleGraph,
  8220. chunkGraph: ChunkGraph
  8221. ): boolean;
  8222. hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
  8223. needBuild(
  8224. context: NeedBuildContext,
  8225. callback: (arg0?: null | WebpackError, arg1?: boolean) => void
  8226. ): void;
  8227. needRebuild(
  8228. fileTimestamps: Map<string, null | number>,
  8229. contextTimestamps: Map<string, null | number>
  8230. ): boolean;
  8231. invalidateBuild(): void;
  8232. identifier(): string;
  8233. readableIdentifier(requestShortener: RequestShortener): string;
  8234. build(
  8235. options: WebpackOptionsNormalized,
  8236. compilation: Compilation,
  8237. resolver: ResolverWithOptions,
  8238. fs: InputFileSystem,
  8239. callback: (arg0?: WebpackError) => void
  8240. ): void;
  8241. getSourceTypes(): ReadonlySet<string>;
  8242. source(
  8243. dependencyTemplates: DependencyTemplates,
  8244. runtimeTemplate: RuntimeTemplate,
  8245. type?: string
  8246. ): Source;
  8247. size(type?: string): number;
  8248. libIdent(options: LibIdentOptions): null | string;
  8249. nameForCondition(): null | string;
  8250. getConcatenationBailoutReason(
  8251. context: ConcatenationBailoutReasonContext
  8252. ): undefined | string;
  8253. getSideEffectsConnectionState(moduleGraph: ModuleGraph): ConnectionState;
  8254. codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
  8255. chunkCondition(chunk: Chunk, compilation: Compilation): boolean;
  8256. hasChunkCondition(): boolean;
  8257. /**
  8258. * Assuming this module is in the cache. Update the (cached) module with
  8259. * the fresh module from the factory. Usually updates internal references
  8260. * and properties.
  8261. */
  8262. updateCacheModule(module: Module): void;
  8263. /**
  8264. * Module should be unsafe cached. Get data that's needed for that.
  8265. * This data will be passed to restoreFromUnsafeCache later.
  8266. */
  8267. getUnsafeCacheData(): UnsafeCacheData;
  8268. /**
  8269. * Assuming this module is in the cache. Remove internal references to allow freeing some memory.
  8270. */
  8271. cleanupForCache(): void;
  8272. originalSource(): null | Source;
  8273. addCacheDependencies(
  8274. fileDependencies: LazySet<string>,
  8275. contextDependencies: LazySet<string>,
  8276. missingDependencies: LazySet<string>,
  8277. buildDependencies: LazySet<string>
  8278. ): void;
  8279. get hasEqualsChunks(): any;
  8280. get isUsed(): any;
  8281. get errors(): any;
  8282. get warnings(): any;
  8283. used: any;
  8284. }
  8285. declare class ModuleChunkLoadingRuntimeModule extends RuntimeModule {
  8286. constructor(runtimeRequirements: ReadonlySet<string>);
  8287. static getCompilationHooks(
  8288. compilation: Compilation
  8289. ): JsonpCompilationPluginHooks;
  8290. /**
  8291. * Runtime modules without any dependencies to other runtime modules
  8292. */
  8293. static STAGE_NORMAL: number;
  8294. /**
  8295. * Runtime modules with simple dependencies on other runtime modules
  8296. */
  8297. static STAGE_BASIC: number;
  8298. /**
  8299. * Runtime modules which attach to handlers of other runtime modules
  8300. */
  8301. static STAGE_ATTACH: number;
  8302. /**
  8303. * Runtime modules which trigger actions on bootstrap
  8304. */
  8305. static STAGE_TRIGGER: number;
  8306. }
  8307. declare class ModuleConcatenationPlugin {
  8308. constructor();
  8309. /**
  8310. * Apply the plugin
  8311. */
  8312. apply(compiler: Compiler): void;
  8313. }
  8314. declare class ModuleDependency extends Dependency {
  8315. constructor(request: string);
  8316. request: string;
  8317. userRequest: string;
  8318. range: any;
  8319. assertions?: ImportAttributes;
  8320. static Template: typeof DependencyTemplate;
  8321. static NO_EXPORTS_REFERENCED: string[][];
  8322. static EXPORTS_OBJECT_REFERENCED: string[][];
  8323. static TRANSITIVE: typeof TRANSITIVE;
  8324. }
  8325. declare abstract class ModuleFactory {
  8326. create(
  8327. data: ModuleFactoryCreateData,
  8328. callback: (arg0?: null | Error, arg1?: ModuleFactoryResult) => void
  8329. ): void;
  8330. }
  8331. declare interface ModuleFactoryCreateData {
  8332. contextInfo: ModuleFactoryCreateDataContextInfo;
  8333. resolveOptions?: ResolveOptions;
  8334. context: string;
  8335. dependencies: Dependency[];
  8336. }
  8337. declare interface ModuleFactoryCreateDataContextInfo {
  8338. issuer: string;
  8339. issuerLayer?: null | string;
  8340. compiler: string;
  8341. }
  8342. declare interface ModuleFactoryResult {
  8343. /**
  8344. * the created module or unset if no module was created
  8345. */
  8346. module?: Module;
  8347. fileDependencies?: Set<string>;
  8348. contextDependencies?: Set<string>;
  8349. missingDependencies?: Set<string>;
  8350. /**
  8351. * allow to use the unsafe cache
  8352. */
  8353. cacheable?: boolean;
  8354. }
  8355. declare class ModuleFederationPlugin {
  8356. constructor(options: ModuleFederationPluginOptions);
  8357. /**
  8358. * Apply the plugin
  8359. */
  8360. apply(compiler: Compiler): void;
  8361. /**
  8362. * Get the compilation hooks associated with this plugin.
  8363. */
  8364. static getCompilationHooks(
  8365. compilation: Compilation
  8366. ): CompilationHooksModuleFederationPlugin;
  8367. }
  8368. declare interface ModuleFederationPluginOptions {
  8369. /**
  8370. * 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.
  8371. */
  8372. exposes?: (string | ExposesObject)[] | ExposesObject;
  8373. /**
  8374. * The filename of the container as relative path inside the `output.path` directory.
  8375. */
  8376. filename?: string;
  8377. /**
  8378. * Options for library.
  8379. */
  8380. library?: LibraryOptions;
  8381. /**
  8382. * The name of the container.
  8383. */
  8384. name?: string;
  8385. /**
  8386. * The external type of the remote containers.
  8387. */
  8388. remoteType?:
  8389. | "import"
  8390. | "var"
  8391. | "module"
  8392. | "assign"
  8393. | "this"
  8394. | "window"
  8395. | "self"
  8396. | "global"
  8397. | "commonjs"
  8398. | "commonjs2"
  8399. | "commonjs-module"
  8400. | "commonjs-static"
  8401. | "amd"
  8402. | "amd-require"
  8403. | "umd"
  8404. | "umd2"
  8405. | "jsonp"
  8406. | "system"
  8407. | "promise"
  8408. | "module-import"
  8409. | "script"
  8410. | "node-commonjs";
  8411. /**
  8412. * 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.
  8413. */
  8414. remotes?: (string | RemotesObject)[] | RemotesObject;
  8415. /**
  8416. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  8417. */
  8418. runtime?: string | false;
  8419. /**
  8420. * Share scope name used for all shared modules (defaults to 'default').
  8421. */
  8422. shareScope?: string;
  8423. /**
  8424. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  8425. */
  8426. shared?: (string | SharedObject)[] | SharedObject;
  8427. }
  8428. type ModuleFilterItemTypes =
  8429. | string
  8430. | RegExp
  8431. | ((
  8432. name: string,
  8433. module: StatsModule,
  8434. type: "module" | "chunk" | "root-of-chunk" | "nested"
  8435. ) => boolean);
  8436. declare class ModuleGraph {
  8437. constructor();
  8438. setParents(
  8439. dependency: Dependency,
  8440. block: DependenciesBlock,
  8441. module: Module,
  8442. indexInBlock?: number
  8443. ): void;
  8444. getParentModule(dependency: Dependency): undefined | Module;
  8445. getParentBlock(dependency: Dependency): undefined | DependenciesBlock;
  8446. getParentBlockIndex(dependency: Dependency): number;
  8447. setResolvedModule(
  8448. originModule: null | Module,
  8449. dependency: Dependency,
  8450. module: Module
  8451. ): void;
  8452. updateModule(dependency: Dependency, module: Module): void;
  8453. removeConnection(dependency: Dependency): void;
  8454. addExplanation(dependency: Dependency, explanation: string): void;
  8455. cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
  8456. removeModuleAttributes(module: Module): void;
  8457. removeAllModuleAttributes(): void;
  8458. moveModuleConnections(
  8459. oldModule: Module,
  8460. newModule: Module,
  8461. filterConnection: (arg0: ModuleGraphConnection) => boolean
  8462. ): void;
  8463. copyOutgoingModuleConnections(
  8464. oldModule: Module,
  8465. newModule: Module,
  8466. filterConnection: (arg0: ModuleGraphConnection) => boolean
  8467. ): void;
  8468. addExtraReason(module: Module, explanation: string): void;
  8469. getResolvedModule(dependency: Dependency): null | Module;
  8470. getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
  8471. getModule(dependency: Dependency): null | Module;
  8472. getOrigin(dependency: Dependency): null | Module;
  8473. getResolvedOrigin(dependency: Dependency): null | Module;
  8474. getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
  8475. getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
  8476. getIncomingConnectionsByOriginModule(
  8477. module: Module
  8478. ): Map<undefined | null | Module, ReadonlyArray<ModuleGraphConnection>>;
  8479. getOutgoingConnectionsByModule(
  8480. module: Module
  8481. ): undefined | Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
  8482. getProfile(module: Module): undefined | ModuleProfile;
  8483. setProfile(module: Module, profile?: ModuleProfile): void;
  8484. getIssuer(module: Module): undefined | null | Module;
  8485. setIssuer(module: Module, issuer: null | Module): void;
  8486. setIssuerIfUnset(module: Module, issuer: null | Module): void;
  8487. getOptimizationBailout(
  8488. module: Module
  8489. ): (string | ((requestShortener: RequestShortener) => string))[];
  8490. getProvidedExports(module: Module): null | true | string[];
  8491. isExportProvided(
  8492. module: Module,
  8493. exportName: string | string[]
  8494. ): null | boolean;
  8495. getExportsInfo(module: Module): ExportsInfo;
  8496. getExportInfo(module: Module, exportName: string): ExportInfo;
  8497. getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
  8498. getUsedExports(
  8499. module: Module,
  8500. runtime: RuntimeSpec
  8501. ): null | boolean | SortableSet<string>;
  8502. getPreOrderIndex(module: Module): null | number;
  8503. getPostOrderIndex(module: Module): null | number;
  8504. setPreOrderIndex(module: Module, index: number): void;
  8505. setPreOrderIndexIfUnset(module: Module, index: number): boolean;
  8506. setPostOrderIndex(module: Module, index: number): void;
  8507. setPostOrderIndexIfUnset(module: Module, index: number): boolean;
  8508. getDepth(module: Module): null | number;
  8509. setDepth(module: Module, depth: number): void;
  8510. setDepthIfLower(module: Module, depth: number): boolean;
  8511. isAsync(module: Module): boolean;
  8512. setAsync(module: Module): void;
  8513. getMeta(thing?: any): object;
  8514. getMetaIfExisting(thing?: any): undefined | object;
  8515. freeze(cacheStage?: string): void;
  8516. unfreeze(): void;
  8517. cached<T extends any[], V>(
  8518. fn: (moduleGraph: ModuleGraph, ...args: T) => V,
  8519. ...args: T
  8520. ): V;
  8521. setModuleMemCaches(
  8522. moduleMemCaches: Map<Module, WeakTupleMap<any, any>>
  8523. ): void;
  8524. dependencyCacheProvide(dependency: Dependency, ...args: any[]): any;
  8525. static getModuleGraphForModule(
  8526. module: Module,
  8527. deprecateMessage: string,
  8528. deprecationCode: string
  8529. ): ModuleGraph;
  8530. static setModuleGraphForModule(
  8531. module: Module,
  8532. moduleGraph: ModuleGraph
  8533. ): void;
  8534. static clearModuleGraphForModule(module: Module): void;
  8535. static ModuleGraphConnection: typeof ModuleGraphConnection;
  8536. }
  8537. declare class ModuleGraphConnection {
  8538. constructor(
  8539. originModule: null | Module,
  8540. dependency: null | Dependency,
  8541. module: Module,
  8542. explanation?: string,
  8543. weak?: boolean,
  8544. condition?:
  8545. | null
  8546. | false
  8547. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState)
  8548. );
  8549. originModule: null | Module;
  8550. resolvedOriginModule: null | Module;
  8551. dependency: null | Dependency;
  8552. resolvedModule: Module;
  8553. module: Module;
  8554. weak: boolean;
  8555. conditional: boolean;
  8556. condition?: (
  8557. arg0: ModuleGraphConnection,
  8558. arg1: RuntimeSpec
  8559. ) => ConnectionState;
  8560. explanations?: Set<string>;
  8561. clone(): ModuleGraphConnection;
  8562. addCondition(
  8563. condition: (
  8564. arg0: ModuleGraphConnection,
  8565. arg1: RuntimeSpec
  8566. ) => ConnectionState
  8567. ): void;
  8568. addExplanation(explanation: string): void;
  8569. get explanation(): string;
  8570. isActive(runtime: RuntimeSpec): boolean;
  8571. isTargetActive(runtime: RuntimeSpec): boolean;
  8572. getActiveState(runtime: RuntimeSpec): ConnectionState;
  8573. setActive(value: boolean): void;
  8574. active: void;
  8575. static addConnectionStates: (
  8576. a: ConnectionState,
  8577. b: ConnectionState
  8578. ) => ConnectionState;
  8579. static TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY;
  8580. static CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION;
  8581. }
  8582. type ModuleId = string | number;
  8583. type ModuleInfo = ConcatenatedModuleInfo | ExternalModuleInfo;
  8584. declare interface ModuleMemCachesItem {
  8585. buildInfo: BuildInfo;
  8586. references?: WeakMap<Dependency, Module>;
  8587. memCache: WeakTupleMap<any, any>;
  8588. }
  8589. declare interface ModuleObject {
  8590. id: string;
  8591. exports: any;
  8592. loaded: boolean;
  8593. }
  8594. /**
  8595. * Options affecting the normal modules (`NormalModuleFactory`).
  8596. */
  8597. declare interface ModuleOptions {
  8598. /**
  8599. * An array of rules applied by default for modules.
  8600. */
  8601. defaultRules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  8602. /**
  8603. * Enable warnings for full dynamic dependencies.
  8604. */
  8605. exprContextCritical?: boolean;
  8606. /**
  8607. * Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.
  8608. */
  8609. exprContextRecursive?: boolean;
  8610. /**
  8611. * Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.
  8612. */
  8613. exprContextRegExp?: boolean | RegExp;
  8614. /**
  8615. * Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.
  8616. */
  8617. exprContextRequest?: string;
  8618. /**
  8619. * Specify options for each generator.
  8620. */
  8621. generator?: GeneratorOptionsByModuleType;
  8622. /**
  8623. * Don't parse files matching. It's matched against the full resolved request.
  8624. */
  8625. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  8626. /**
  8627. * Specify options for each parser.
  8628. */
  8629. parser?: ParserOptionsByModuleType;
  8630. /**
  8631. * An array of rules applied for modules.
  8632. */
  8633. rules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  8634. /**
  8635. * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
  8636. */
  8637. strictExportPresence?: boolean;
  8638. /**
  8639. * Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.
  8640. */
  8641. strictThisContextOnImports?: boolean;
  8642. /**
  8643. * Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.
  8644. */
  8645. unknownContextCritical?: boolean;
  8646. /**
  8647. * 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'.
  8648. */
  8649. unknownContextRecursive?: boolean;
  8650. /**
  8651. * 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'.
  8652. */
  8653. unknownContextRegExp?: boolean | RegExp;
  8654. /**
  8655. * 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'.
  8656. */
  8657. unknownContextRequest?: string;
  8658. /**
  8659. * Cache the resolving of module requests.
  8660. */
  8661. unsafeCache?: boolean | Function;
  8662. /**
  8663. * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
  8664. */
  8665. wrappedContextCritical?: boolean;
  8666. /**
  8667. * Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.
  8668. */
  8669. wrappedContextRecursive?: boolean;
  8670. /**
  8671. * Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.
  8672. */
  8673. wrappedContextRegExp?: RegExp;
  8674. }
  8675. /**
  8676. * Options affecting the normal modules (`NormalModuleFactory`).
  8677. */
  8678. declare interface ModuleOptionsNormalized {
  8679. /**
  8680. * An array of rules applied by default for modules.
  8681. */
  8682. defaultRules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  8683. /**
  8684. * Specify options for each generator.
  8685. */
  8686. generator: GeneratorOptionsByModuleType;
  8687. /**
  8688. * Don't parse files matching. It's matched against the full resolved request.
  8689. */
  8690. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  8691. /**
  8692. * Specify options for each parser.
  8693. */
  8694. parser: ParserOptionsByModuleType;
  8695. /**
  8696. * An array of rules applied for modules.
  8697. */
  8698. rules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  8699. /**
  8700. * Cache the resolving of module requests.
  8701. */
  8702. unsafeCache?: boolean | Function;
  8703. }
  8704. declare interface ModulePathData {
  8705. id: string | number;
  8706. hash: string;
  8707. hashWithLength?: (arg0: number) => string;
  8708. }
  8709. declare abstract class ModuleProfile {
  8710. startTime: number;
  8711. factoryStartTime: number;
  8712. factoryEndTime: number;
  8713. factory: number;
  8714. factoryParallelismFactor: number;
  8715. restoringStartTime: number;
  8716. restoringEndTime: number;
  8717. restoring: number;
  8718. restoringParallelismFactor: number;
  8719. integrationStartTime: number;
  8720. integrationEndTime: number;
  8721. integration: number;
  8722. integrationParallelismFactor: number;
  8723. buildingStartTime: number;
  8724. buildingEndTime: number;
  8725. building: number;
  8726. buildingParallelismFactor: number;
  8727. storingStartTime: number;
  8728. storingEndTime: number;
  8729. storing: number;
  8730. storingParallelismFactor: number;
  8731. additionalFactoryTimes?: { start: number; end: number }[];
  8732. additionalFactories: number;
  8733. additionalFactoriesParallelismFactor: number;
  8734. additionalIntegration: number;
  8735. markFactoryStart(): void;
  8736. markFactoryEnd(): void;
  8737. markRestoringStart(): void;
  8738. markRestoringEnd(): void;
  8739. markIntegrationStart(): void;
  8740. markIntegrationEnd(): void;
  8741. markBuildingStart(): void;
  8742. markBuildingEnd(): void;
  8743. markStoringStart(): void;
  8744. markStoringEnd(): void;
  8745. /**
  8746. * Merge this profile into another one
  8747. */
  8748. mergeInto(realProfile: ModuleProfile): void;
  8749. }
  8750. declare interface ModuleReferenceOptions {
  8751. /**
  8752. * the properties/exports of the module
  8753. */
  8754. ids: string[];
  8755. /**
  8756. * true, when this referenced export is called
  8757. */
  8758. call: boolean;
  8759. /**
  8760. * true, when this referenced export is directly imported (not via property access)
  8761. */
  8762. directImport: boolean;
  8763. /**
  8764. * if the position is ASI safe or unknown
  8765. */
  8766. asiSafe?: boolean;
  8767. }
  8768. declare interface ModuleResult {
  8769. client: string;
  8770. data: string;
  8771. active: boolean;
  8772. }
  8773. declare interface ModuleSettings {
  8774. /**
  8775. * Specifies the layer in which the module should be placed in.
  8776. */
  8777. layer?: string;
  8778. /**
  8779. * Module type to use for the module.
  8780. */
  8781. type?: string;
  8782. /**
  8783. * Options for the resolver.
  8784. */
  8785. resolve?: ResolveOptions;
  8786. /**
  8787. * Options for parsing.
  8788. */
  8789. parser?: { [index: string]: any };
  8790. /**
  8791. * The options for the module generator.
  8792. */
  8793. generator?: { [index: string]: any };
  8794. /**
  8795. * Flags a module as with or without side effects.
  8796. */
  8797. sideEffects?: boolean;
  8798. }
  8799. declare abstract class ModuleTemplate {
  8800. type: string;
  8801. hooks: Readonly<{
  8802. content: {
  8803. tap: <AdditionalOptions>(
  8804. options:
  8805. | string
  8806. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8807. fn: (
  8808. arg0: Source,
  8809. arg1: Module,
  8810. arg2: ChunkRenderContextJavascriptModulesPlugin,
  8811. arg3: DependencyTemplates
  8812. ) => Source
  8813. ) => void;
  8814. };
  8815. module: {
  8816. tap: <AdditionalOptions>(
  8817. options:
  8818. | string
  8819. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8820. fn: (
  8821. arg0: Source,
  8822. arg1: Module,
  8823. arg2: ChunkRenderContextJavascriptModulesPlugin,
  8824. arg3: DependencyTemplates
  8825. ) => Source
  8826. ) => void;
  8827. };
  8828. render: {
  8829. tap: <AdditionalOptions>(
  8830. options:
  8831. | string
  8832. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8833. fn: (
  8834. arg0: Source,
  8835. arg1: Module,
  8836. arg2: ChunkRenderContextJavascriptModulesPlugin,
  8837. arg3: DependencyTemplates
  8838. ) => Source
  8839. ) => void;
  8840. };
  8841. package: {
  8842. tap: <AdditionalOptions>(
  8843. options:
  8844. | string
  8845. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8846. fn: (
  8847. arg0: Source,
  8848. arg1: Module,
  8849. arg2: ChunkRenderContextJavascriptModulesPlugin,
  8850. arg3: DependencyTemplates
  8851. ) => Source
  8852. ) => void;
  8853. };
  8854. hash: {
  8855. tap: <AdditionalOptions>(
  8856. options:
  8857. | string
  8858. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8859. fn: (arg0: Hash) => void
  8860. ) => void;
  8861. };
  8862. }>;
  8863. get runtimeTemplate(): RuntimeTemplate;
  8864. }
  8865. declare interface ModuleTemplates {
  8866. javascript: ModuleTemplate;
  8867. }
  8868. declare class MultiCompiler {
  8869. constructor(
  8870. compilers: Compiler[] | Record<string, Compiler>,
  8871. options: MultiCompilerOptions
  8872. );
  8873. hooks: Readonly<{
  8874. done: SyncHook<[MultiStats]>;
  8875. invalid: MultiHook<SyncHook<[null | string, number]>>;
  8876. run: MultiHook<AsyncSeriesHook<[Compiler]>>;
  8877. watchClose: SyncHook<[]>;
  8878. watchRun: MultiHook<AsyncSeriesHook<[Compiler]>>;
  8879. infrastructureLog: MultiHook<SyncBailHook<[string, string, any[]], true>>;
  8880. }>;
  8881. compilers: Compiler[];
  8882. dependencies: WeakMap<Compiler, string[]>;
  8883. running: boolean;
  8884. get options(): WebpackOptionsNormalized[] & MultiCompilerOptions;
  8885. get outputPath(): string;
  8886. inputFileSystem: InputFileSystem;
  8887. outputFileSystem: OutputFileSystem;
  8888. watchFileSystem: WatchFileSystem;
  8889. intermediateFileSystem: IntermediateFileSystem;
  8890. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  8891. setDependencies(compiler: Compiler, dependencies: string[]): void;
  8892. validateDependencies(callback: CallbackFunction_1<MultiStats>): boolean;
  8893. runWithDependencies(
  8894. compilers: Compiler[],
  8895. fn: (compiler: Compiler, callback: CallbackFunction_1<MultiStats>) => any,
  8896. callback: CallbackFunction_1<MultiStats>
  8897. ): void;
  8898. watch(
  8899. watchOptions: WatchOptions | WatchOptions[],
  8900. handler: CallbackFunction_1<MultiStats>
  8901. ): MultiWatching;
  8902. run(callback: CallbackFunction_1<MultiStats>): void;
  8903. purgeInputFileSystem(): void;
  8904. close(callback: CallbackFunction_1<void>): void;
  8905. }
  8906. declare interface MultiCompilerOptions {
  8907. /**
  8908. * how many Compilers are allows to run at the same time in parallel
  8909. */
  8910. parallelism?: number;
  8911. }
  8912. declare abstract class MultiStats {
  8913. stats: Stats[];
  8914. get hash(): string;
  8915. hasErrors(): boolean;
  8916. hasWarnings(): boolean;
  8917. toJson(options?: string | boolean | StatsOptions): StatsCompilation;
  8918. toString(options?: string | boolean | StatsOptions): string;
  8919. }
  8920. declare abstract class MultiWatching {
  8921. watchings: Watching[];
  8922. compiler: MultiCompiler;
  8923. invalidate(callback?: CallbackFunction_2<void>): void;
  8924. suspend(): void;
  8925. resume(): void;
  8926. close(callback: CallbackFunction_2<void>): void;
  8927. }
  8928. declare class NamedChunkIdsPlugin {
  8929. constructor(options?: NamedChunkIdsPluginOptions);
  8930. delimiter: string;
  8931. context?: string;
  8932. /**
  8933. * Apply the plugin
  8934. */
  8935. apply(compiler: Compiler): void;
  8936. }
  8937. declare interface NamedChunkIdsPluginOptions {
  8938. /**
  8939. * context
  8940. */
  8941. context?: string;
  8942. /**
  8943. * delimiter
  8944. */
  8945. delimiter?: string;
  8946. }
  8947. declare class NamedModuleIdsPlugin {
  8948. constructor(options?: NamedModuleIdsPluginOptions);
  8949. options: NamedModuleIdsPluginOptions;
  8950. /**
  8951. * Apply the plugin
  8952. */
  8953. apply(compiler: Compiler): void;
  8954. }
  8955. declare interface NamedModuleIdsPluginOptions {
  8956. /**
  8957. * context
  8958. */
  8959. context?: string;
  8960. }
  8961. declare class NaturalModuleIdsPlugin {
  8962. constructor();
  8963. /**
  8964. * Apply the plugin
  8965. */
  8966. apply(compiler: Compiler): void;
  8967. }
  8968. declare interface NeedBuildContext {
  8969. compilation: Compilation;
  8970. fileSystemInfo: FileSystemInfo;
  8971. valueCacheVersions: Map<string, string | Set<string>>;
  8972. }
  8973. declare class NoEmitOnErrorsPlugin {
  8974. constructor();
  8975. /**
  8976. * Apply the plugin
  8977. */
  8978. apply(compiler: Compiler): void;
  8979. }
  8980. type Node = false | NodeOptions;
  8981. declare class NodeEnvironmentPlugin {
  8982. constructor(options: {
  8983. /**
  8984. * infrastructure logging options
  8985. */
  8986. infrastructureLogging: InfrastructureLogging;
  8987. });
  8988. options: {
  8989. /**
  8990. * infrastructure logging options
  8991. */
  8992. infrastructureLogging: InfrastructureLogging;
  8993. };
  8994. /**
  8995. * Apply the plugin
  8996. */
  8997. apply(compiler: Compiler): void;
  8998. }
  8999. /**
  9000. * Options object for node compatibility features.
  9001. */
  9002. declare interface NodeOptions {
  9003. /**
  9004. * Include a polyfill for the '__dirname' variable.
  9005. */
  9006. __dirname?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
  9007. /**
  9008. * Include a polyfill for the '__filename' variable.
  9009. */
  9010. __filename?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
  9011. /**
  9012. * Include a polyfill for the 'global' variable.
  9013. */
  9014. global?: boolean | "warn";
  9015. }
  9016. declare class NodeSourcePlugin {
  9017. constructor();
  9018. /**
  9019. * Apply the plugin
  9020. */
  9021. apply(compiler: Compiler): void;
  9022. }
  9023. declare class NodeTargetPlugin {
  9024. constructor();
  9025. /**
  9026. * Apply the plugin
  9027. */
  9028. apply(compiler: Compiler): void;
  9029. }
  9030. declare class NodeTemplatePlugin {
  9031. constructor(options?: NodeTemplatePluginOptions);
  9032. /**
  9033. * Apply the plugin
  9034. */
  9035. apply(compiler: Compiler): void;
  9036. }
  9037. declare interface NodeTemplatePluginOptions {
  9038. /**
  9039. * enable async chunk loading
  9040. */
  9041. asyncChunkLoading?: boolean;
  9042. }
  9043. declare class NormalModule extends Module {
  9044. constructor(__0: NormalModuleCreateData);
  9045. request: string;
  9046. userRequest: string;
  9047. rawRequest: string;
  9048. binary: boolean;
  9049. parser?: Parser;
  9050. parserOptions?: ParserOptions;
  9051. generator?: Generator;
  9052. generatorOptions?: GeneratorOptions;
  9053. resource: string;
  9054. resourceResolveData?: Record<string, any>;
  9055. matchResource?: string;
  9056. loaders: LoaderItem[];
  9057. error: null | WebpackError;
  9058. /**
  9059. * restore unsafe cache data
  9060. */
  9061. restoreFromUnsafeCache(
  9062. unsafeCacheData: NormalModuleUnsafeCacheData,
  9063. normalModuleFactory: NormalModuleFactory
  9064. ): void;
  9065. createSourceForAsset(
  9066. context: string,
  9067. name: string,
  9068. content: string | Buffer,
  9069. sourceMap?: string | SourceMap,
  9070. associatedObjectForCache?: object
  9071. ): Source;
  9072. getCurrentLoader(loaderContext?: any, index?: number): null | LoaderItem;
  9073. createSource(
  9074. context: string,
  9075. content: string | Buffer,
  9076. sourceMap?: null | string | SourceMapSource,
  9077. associatedObjectForCache?: object
  9078. ): Source;
  9079. markModuleAsErrored(error: WebpackError): void;
  9080. applyNoParseRule(rule: any, content: string): boolean;
  9081. shouldPreventParsing(noParseRule: any, request: string): boolean;
  9082. static getCompilationHooks(
  9083. compilation: Compilation
  9084. ): NormalModuleCompilationHooks;
  9085. static deserialize(context: ObjectDeserializerContext): any;
  9086. }
  9087. declare interface NormalModuleCompilationHooks {
  9088. loader: SyncHook<[LoaderContextNormalModule<any>, NormalModule]>;
  9089. beforeLoaders: SyncHook<
  9090. [LoaderItem[], NormalModule, LoaderContextNormalModule<any>]
  9091. >;
  9092. beforeParse: SyncHook<[NormalModule]>;
  9093. beforeSnapshot: SyncHook<[NormalModule]>;
  9094. readResourceForScheme: HookMap<
  9095. FakeHook<
  9096. AsyncSeriesBailHook<[string, NormalModule], null | string | Buffer>
  9097. >
  9098. >;
  9099. readResource: HookMap<
  9100. AsyncSeriesBailHook<
  9101. [LoaderContextNormalModule<any>],
  9102. null | string | Buffer
  9103. >
  9104. >;
  9105. needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
  9106. }
  9107. declare interface NormalModuleCreateData {
  9108. /**
  9109. * an optional layer in which the module is
  9110. */
  9111. layer?: string;
  9112. /**
  9113. * module type. When deserializing, this is set to an empty string "".
  9114. */
  9115. type: "" | "javascript/auto" | "javascript/dynamic" | "javascript/esm";
  9116. /**
  9117. * request string
  9118. */
  9119. request: string;
  9120. /**
  9121. * request intended by user (without loaders from config)
  9122. */
  9123. userRequest: string;
  9124. /**
  9125. * request without resolving
  9126. */
  9127. rawRequest: string;
  9128. /**
  9129. * list of loaders
  9130. */
  9131. loaders: LoaderItem[];
  9132. /**
  9133. * path + query of the real resource
  9134. */
  9135. resource: string;
  9136. /**
  9137. * resource resolve data
  9138. */
  9139. resourceResolveData?: Record<string, any>;
  9140. /**
  9141. * context directory for resolving
  9142. */
  9143. context: string;
  9144. /**
  9145. * path + query of the matched resource (virtual)
  9146. */
  9147. matchResource?: string;
  9148. /**
  9149. * the parser used
  9150. */
  9151. parser: Parser;
  9152. /**
  9153. * the options of the parser used
  9154. */
  9155. parserOptions?: ParserOptions;
  9156. /**
  9157. * the generator used
  9158. */
  9159. generator: Generator;
  9160. /**
  9161. * the options of the generator used
  9162. */
  9163. generatorOptions?: GeneratorOptions;
  9164. /**
  9165. * options used for resolving requests from this module
  9166. */
  9167. resolveOptions?: ResolveOptions;
  9168. }
  9169. declare abstract class NormalModuleFactory extends ModuleFactory {
  9170. hooks: Readonly<{
  9171. resolve: AsyncSeriesBailHook<[ResolveData], false | void | Module>;
  9172. resolveForScheme: HookMap<
  9173. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  9174. >;
  9175. resolveInScheme: HookMap<
  9176. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  9177. >;
  9178. factorize: AsyncSeriesBailHook<[ResolveData], undefined | Module>;
  9179. beforeResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  9180. afterResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  9181. createModule: AsyncSeriesBailHook<
  9182. [
  9183. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  9184. ResolveData
  9185. ],
  9186. void | Module
  9187. >;
  9188. module: SyncWaterfallHook<
  9189. [
  9190. Module,
  9191. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  9192. ResolveData
  9193. ]
  9194. >;
  9195. createParser: HookMap<SyncBailHook<[ParserOptions], void | Parser>>;
  9196. parser: HookMap<SyncBailHook<[any, ParserOptions], void>>;
  9197. createGenerator: HookMap<
  9198. SyncBailHook<[GeneratorOptions], void | Generator>
  9199. >;
  9200. generator: HookMap<SyncBailHook<[any, GeneratorOptions], void>>;
  9201. createModuleClass: HookMap<SyncBailHook<[any, ResolveData], void | Module>>;
  9202. }>;
  9203. resolverFactory: ResolverFactory;
  9204. ruleSet: RuleSet;
  9205. context: string;
  9206. fs: InputFileSystem;
  9207. parserCache: Map<string, WeakMap<object, Parser>>;
  9208. generatorCache: Map<string, WeakMap<object, Generator>>;
  9209. cleanupForCache(): void;
  9210. resolveResource(
  9211. contextInfo: ModuleFactoryCreateDataContextInfo,
  9212. context: string,
  9213. unresolvedResource: string,
  9214. resolver: ResolverWithOptions,
  9215. resolveContext: ResolveContext,
  9216. callback: (
  9217. err: null | Error,
  9218. res?: string | false,
  9219. req?: ResolveRequest
  9220. ) => void
  9221. ): void;
  9222. resolveRequestArray(
  9223. contextInfo: ModuleFactoryCreateDataContextInfo,
  9224. context: string,
  9225. array: LoaderItem[],
  9226. resolver: ResolverWithOptions,
  9227. resolveContext: ResolveContext,
  9228. callback: CallbackNormalModuleFactory<LoaderItem[]>
  9229. ): void;
  9230. getParser(type: string, parserOptions?: ParserOptions): Parser;
  9231. createParser(type: string, parserOptions?: ParserOptions): Parser;
  9232. getGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
  9233. createGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
  9234. getResolver(
  9235. type: string,
  9236. resolveOptions?: ResolveOptionsWithDependencyType
  9237. ): ResolverWithOptions;
  9238. }
  9239. /**
  9240. * These properties are added by the NormalModule
  9241. */
  9242. declare interface NormalModuleLoaderContext<OptionsType> {
  9243. version: number;
  9244. getOptions(): OptionsType;
  9245. getOptions(schema: Parameters<typeof validateFunction>[0]): OptionsType;
  9246. emitWarning(warning: Error): void;
  9247. emitError(error: Error): void;
  9248. getLogger(name?: string): WebpackLogger;
  9249. resolve(
  9250. context: string,
  9251. request: string,
  9252. callback: (
  9253. err: null | ErrorWithDetail,
  9254. res?: string | false,
  9255. req?: ResolveRequest
  9256. ) => void
  9257. ): any;
  9258. getResolve(options?: ResolveOptionsWithDependencyType): {
  9259. (
  9260. context: string,
  9261. request: string,
  9262. callback: (
  9263. err: null | ErrorWithDetail,
  9264. res?: string | false,
  9265. req?: ResolveRequest
  9266. ) => void
  9267. ): void;
  9268. (context: string, request: string): Promise<string>;
  9269. };
  9270. emitFile(
  9271. name: string,
  9272. content: string | Buffer,
  9273. sourceMap?: string,
  9274. assetInfo?: AssetInfo
  9275. ): void;
  9276. addBuildDependency(dep: string): void;
  9277. utils: {
  9278. absolutify: (context: string, request: string) => string;
  9279. contextify: (context: string, request: string) => string;
  9280. createHash: (algorithm?: string | typeof Hash) => Hash;
  9281. };
  9282. rootContext: string;
  9283. fs: InputFileSystem;
  9284. sourceMap?: boolean;
  9285. mode: "none" | "development" | "production";
  9286. webpack?: boolean;
  9287. hashFunction: HashFunction;
  9288. hashDigest: string;
  9289. hashDigestLength: number;
  9290. hashSalt: string;
  9291. _module?: NormalModule;
  9292. _compilation?: Compilation;
  9293. _compiler?: Compiler;
  9294. }
  9295. declare class NormalModuleReplacementPlugin {
  9296. /**
  9297. * Create an instance of the plugin
  9298. */
  9299. constructor(
  9300. resourceRegExp: RegExp,
  9301. newResource: string | ((arg0: ResolveData) => void)
  9302. );
  9303. resourceRegExp: RegExp;
  9304. newResource: string | ((arg0: ResolveData) => void);
  9305. /**
  9306. * Apply the plugin
  9307. */
  9308. apply(compiler: Compiler): void;
  9309. }
  9310. type NormalModuleUnsafeCacheData = UnsafeCacheData & {
  9311. parser?: Parser;
  9312. parserOptions?: ParserOptions;
  9313. generator?: Generator;
  9314. generatorOptions?: GeneratorOptions;
  9315. };
  9316. type NormalizedStatsOptions = KnownNormalizedStatsOptions &
  9317. Omit<
  9318. StatsOptions,
  9319. | "context"
  9320. | "chunkGroups"
  9321. | "requestShortener"
  9322. | "chunksSort"
  9323. | "modulesSort"
  9324. | "chunkModulesSort"
  9325. | "nestedModulesSort"
  9326. | "assetsSort"
  9327. | "ids"
  9328. | "cachedAssets"
  9329. | "groupAssetsByEmitStatus"
  9330. | "groupAssetsByPath"
  9331. | "groupAssetsByExtension"
  9332. | "assetsSpace"
  9333. | "excludeAssets"
  9334. | "excludeModules"
  9335. | "warningsFilter"
  9336. | "cachedModules"
  9337. | "orphanModules"
  9338. | "dependentModules"
  9339. | "runtimeModules"
  9340. | "groupModulesByCacheStatus"
  9341. | "groupModulesByLayer"
  9342. | "groupModulesByAttributes"
  9343. | "groupModulesByPath"
  9344. | "groupModulesByExtension"
  9345. | "groupModulesByType"
  9346. | "entrypoints"
  9347. | "chunkGroupAuxiliary"
  9348. | "chunkGroupChildren"
  9349. | "chunkGroupMaxAssets"
  9350. | "modulesSpace"
  9351. | "chunkModulesSpace"
  9352. | "nestedModulesSpace"
  9353. | "logging"
  9354. | "loggingDebug"
  9355. | "loggingTrace"
  9356. | "_env"
  9357. > &
  9358. Record<string, any>;
  9359. declare class NullDependency extends Dependency {
  9360. constructor();
  9361. static Template: typeof NullDependencyTemplate;
  9362. static NO_EXPORTS_REFERENCED: string[][];
  9363. static EXPORTS_OBJECT_REFERENCED: string[][];
  9364. static TRANSITIVE: typeof TRANSITIVE;
  9365. }
  9366. declare class NullDependencyTemplate extends DependencyTemplate {
  9367. constructor();
  9368. }
  9369. declare interface ObjectDeserializerContext {
  9370. read: () => any;
  9371. setCircularReference: (arg0?: any) => void;
  9372. }
  9373. declare interface ObjectEncodingOptions {
  9374. encoding?:
  9375. | null
  9376. | "ascii"
  9377. | "utf8"
  9378. | "utf-8"
  9379. | "utf16le"
  9380. | "utf-16le"
  9381. | "ucs2"
  9382. | "ucs-2"
  9383. | "latin1"
  9384. | "binary"
  9385. | "base64"
  9386. | "base64url"
  9387. | "hex";
  9388. }
  9389. declare interface ObjectForExtract {
  9390. [index: string]: any;
  9391. }
  9392. declare interface ObjectSerializer {
  9393. serialize: (arg0: any, arg1: ObjectSerializerContext) => void;
  9394. deserialize: (arg0: ObjectDeserializerContext) => any;
  9395. }
  9396. declare interface ObjectSerializerContext {
  9397. write: (arg0?: any) => void;
  9398. writeLazy?: (arg0?: any) => void;
  9399. writeSeparate?: (arg0: any, arg1?: object) => () => any;
  9400. setCircularReference: (arg0?: any) => void;
  9401. }
  9402. declare class OccurrenceChunkIdsPlugin {
  9403. constructor(options?: OccurrenceChunkIdsPluginOptions);
  9404. options: OccurrenceChunkIdsPluginOptions;
  9405. /**
  9406. * Apply the plugin
  9407. */
  9408. apply(compiler: Compiler): void;
  9409. }
  9410. declare interface OccurrenceChunkIdsPluginOptions {
  9411. /**
  9412. * Prioritise initial size over total size.
  9413. */
  9414. prioritiseInitial?: boolean;
  9415. }
  9416. declare class OccurrenceModuleIdsPlugin {
  9417. constructor(options?: OccurrenceModuleIdsPluginOptions);
  9418. options: OccurrenceModuleIdsPluginOptions;
  9419. /**
  9420. * Apply the plugin
  9421. */
  9422. apply(compiler: Compiler): void;
  9423. }
  9424. declare interface OccurrenceModuleIdsPluginOptions {
  9425. /**
  9426. * Prioritise initial size over total size.
  9427. */
  9428. prioritiseInitial?: boolean;
  9429. }
  9430. declare interface Open {
  9431. (
  9432. file: PathLikeFs,
  9433. flags: undefined | string | number,
  9434. mode: undefined | null | string | number,
  9435. callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void
  9436. ): void;
  9437. (
  9438. file: PathLikeFs,
  9439. flags: undefined | string | number,
  9440. callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void
  9441. ): void;
  9442. (
  9443. file: PathLikeFs,
  9444. callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void
  9445. ): void;
  9446. }
  9447. /**
  9448. * Enables/Disables integrated optimizations.
  9449. */
  9450. declare interface Optimization {
  9451. /**
  9452. * Avoid wrapping the entry module in an IIFE.
  9453. */
  9454. avoidEntryIife?: boolean;
  9455. /**
  9456. * Check for incompatible wasm types when importing/exporting from/to ESM.
  9457. */
  9458. checkWasmTypes?: boolean;
  9459. /**
  9460. * 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).
  9461. */
  9462. chunkIds?:
  9463. | false
  9464. | "natural"
  9465. | "named"
  9466. | "deterministic"
  9467. | "size"
  9468. | "total-size";
  9469. /**
  9470. * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
  9471. */
  9472. concatenateModules?: boolean;
  9473. /**
  9474. * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
  9475. */
  9476. emitOnErrors?: boolean;
  9477. /**
  9478. * Also flag chunks as loaded which contain a subset of the modules.
  9479. */
  9480. flagIncludedChunks?: boolean;
  9481. /**
  9482. * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
  9483. */
  9484. innerGraph?: boolean;
  9485. /**
  9486. * 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).
  9487. */
  9488. mangleExports?: boolean | "deterministic" | "size";
  9489. /**
  9490. * Reduce size of WASM by changing imports to shorter strings.
  9491. */
  9492. mangleWasmImports?: boolean;
  9493. /**
  9494. * Merge chunks which contain the same modules.
  9495. */
  9496. mergeDuplicateChunks?: boolean;
  9497. /**
  9498. * Enable minimizing the output. Uses optimization.minimizer.
  9499. */
  9500. minimize?: boolean;
  9501. /**
  9502. * Minimizer(s) to use for minimizing the output.
  9503. */
  9504. minimizer?: (
  9505. | undefined
  9506. | null
  9507. | false
  9508. | ""
  9509. | 0
  9510. | ((this: Compiler, compiler: Compiler) => void)
  9511. | WebpackPluginInstance
  9512. | "..."
  9513. )[];
  9514. /**
  9515. * 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).
  9516. */
  9517. moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
  9518. /**
  9519. * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
  9520. */
  9521. noEmitOnErrors?: boolean;
  9522. /**
  9523. * Set process.env.NODE_ENV to a specific value.
  9524. */
  9525. nodeEnv?: string | false;
  9526. /**
  9527. * Generate records with relative paths to be able to move the context folder.
  9528. */
  9529. portableRecords?: boolean;
  9530. /**
  9531. * Figure out which exports are provided by modules to generate more efficient code.
  9532. */
  9533. providedExports?: boolean;
  9534. /**
  9535. * Use real [contenthash] based on final content of the assets.
  9536. */
  9537. realContentHash?: boolean;
  9538. /**
  9539. * Removes modules from chunks when these modules are already included in all parents.
  9540. */
  9541. removeAvailableModules?: boolean;
  9542. /**
  9543. * Remove chunks which are empty.
  9544. */
  9545. removeEmptyChunks?: boolean;
  9546. /**
  9547. * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
  9548. */
  9549. runtimeChunk?:
  9550. | boolean
  9551. | "single"
  9552. | "multiple"
  9553. | {
  9554. /**
  9555. * The name or name factory for the runtime chunks.
  9556. */
  9557. name?: string | Function;
  9558. };
  9559. /**
  9560. * 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).
  9561. */
  9562. sideEffects?: boolean | "flag";
  9563. /**
  9564. * Optimize duplication and caching by splitting chunks by shared modules and cache group.
  9565. */
  9566. splitChunks?: false | OptimizationSplitChunksOptions;
  9567. /**
  9568. * 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).
  9569. */
  9570. usedExports?: boolean | "global";
  9571. }
  9572. /**
  9573. * Options object for describing behavior of a cache group selecting modules that should be cached together.
  9574. */
  9575. declare interface OptimizationSplitChunksCacheGroup {
  9576. /**
  9577. * Sets the name delimiter for created chunks.
  9578. */
  9579. automaticNameDelimiter?: string;
  9580. /**
  9581. * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
  9582. */
  9583. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  9584. /**
  9585. * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
  9586. */
  9587. enforce?: boolean;
  9588. /**
  9589. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  9590. */
  9591. enforceSizeThreshold?: number | { [index: string]: number };
  9592. /**
  9593. * Sets the template for the filename for created chunks.
  9594. */
  9595. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9596. /**
  9597. * Sets the hint for chunk id.
  9598. */
  9599. idHint?: string;
  9600. /**
  9601. * Assign modules to a cache group by module layer.
  9602. */
  9603. layer?: string | Function | RegExp;
  9604. /**
  9605. * Maximum number of requests which are accepted for on-demand loading.
  9606. */
  9607. maxAsyncRequests?: number;
  9608. /**
  9609. * Maximal size hint for the on-demand chunks.
  9610. */
  9611. maxAsyncSize?: number | { [index: string]: number };
  9612. /**
  9613. * Maximum number of initial chunks which are accepted for an entry point.
  9614. */
  9615. maxInitialRequests?: number;
  9616. /**
  9617. * Maximal size hint for the initial chunks.
  9618. */
  9619. maxInitialSize?: number | { [index: string]: number };
  9620. /**
  9621. * Maximal size hint for the created chunks.
  9622. */
  9623. maxSize?: number | { [index: string]: number };
  9624. /**
  9625. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  9626. */
  9627. minChunks?: number;
  9628. /**
  9629. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  9630. */
  9631. minRemainingSize?: number | { [index: string]: number };
  9632. /**
  9633. * Minimal size for the created chunk.
  9634. */
  9635. minSize?: number | { [index: string]: number };
  9636. /**
  9637. * Minimum size reduction due to the created chunk.
  9638. */
  9639. minSizeReduction?: number | { [index: string]: number };
  9640. /**
  9641. * Give chunks for this cache group a name (chunks with equal name are merged).
  9642. */
  9643. name?: string | false | Function;
  9644. /**
  9645. * Priority of this cache group.
  9646. */
  9647. priority?: number;
  9648. /**
  9649. * Try to reuse existing chunk (with name) when it has matching modules.
  9650. */
  9651. reuseExistingChunk?: boolean;
  9652. /**
  9653. * Assign modules to a cache group by module name.
  9654. */
  9655. test?: string | Function | RegExp;
  9656. /**
  9657. * Assign modules to a cache group by module type.
  9658. */
  9659. type?: string | Function | RegExp;
  9660. /**
  9661. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  9662. */
  9663. usedExports?: boolean;
  9664. }
  9665. /**
  9666. * Options object for splitting chunks into smaller chunks.
  9667. */
  9668. declare interface OptimizationSplitChunksOptions {
  9669. /**
  9670. * Sets the name delimiter for created chunks.
  9671. */
  9672. automaticNameDelimiter?: string;
  9673. /**
  9674. * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').
  9675. */
  9676. cacheGroups?: {
  9677. [index: string]:
  9678. | string
  9679. | false
  9680. | Function
  9681. | RegExp
  9682. | OptimizationSplitChunksCacheGroup;
  9683. };
  9684. /**
  9685. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  9686. */
  9687. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  9688. /**
  9689. * Sets the size types which are used when a number is used for sizes.
  9690. */
  9691. defaultSizeTypes?: string[];
  9692. /**
  9693. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  9694. */
  9695. enforceSizeThreshold?: number | { [index: string]: number };
  9696. /**
  9697. * Options for modules not selected by any other cache group.
  9698. */
  9699. fallbackCacheGroup?: {
  9700. /**
  9701. * Sets the name delimiter for created chunks.
  9702. */
  9703. automaticNameDelimiter?: string;
  9704. /**
  9705. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  9706. */
  9707. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  9708. /**
  9709. * Maximal size hint for the on-demand chunks.
  9710. */
  9711. maxAsyncSize?: number | { [index: string]: number };
  9712. /**
  9713. * Maximal size hint for the initial chunks.
  9714. */
  9715. maxInitialSize?: number | { [index: string]: number };
  9716. /**
  9717. * Maximal size hint for the created chunks.
  9718. */
  9719. maxSize?: number | { [index: string]: number };
  9720. /**
  9721. * Minimal size for the created chunk.
  9722. */
  9723. minSize?: number | { [index: string]: number };
  9724. /**
  9725. * Minimum size reduction due to the created chunk.
  9726. */
  9727. minSizeReduction?: number | { [index: string]: number };
  9728. };
  9729. /**
  9730. * Sets the template for the filename for created chunks.
  9731. */
  9732. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9733. /**
  9734. * Prevents exposing path info when creating names for parts splitted by maxSize.
  9735. */
  9736. hidePathInfo?: boolean;
  9737. /**
  9738. * Maximum number of requests which are accepted for on-demand loading.
  9739. */
  9740. maxAsyncRequests?: number;
  9741. /**
  9742. * Maximal size hint for the on-demand chunks.
  9743. */
  9744. maxAsyncSize?: number | { [index: string]: number };
  9745. /**
  9746. * Maximum number of initial chunks which are accepted for an entry point.
  9747. */
  9748. maxInitialRequests?: number;
  9749. /**
  9750. * Maximal size hint for the initial chunks.
  9751. */
  9752. maxInitialSize?: number | { [index: string]: number };
  9753. /**
  9754. * Maximal size hint for the created chunks.
  9755. */
  9756. maxSize?: number | { [index: string]: number };
  9757. /**
  9758. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  9759. */
  9760. minChunks?: number;
  9761. /**
  9762. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  9763. */
  9764. minRemainingSize?: number | { [index: string]: number };
  9765. /**
  9766. * Minimal size for the created chunks.
  9767. */
  9768. minSize?: number | { [index: string]: number };
  9769. /**
  9770. * Minimum size reduction due to the created chunk.
  9771. */
  9772. minSizeReduction?: number | { [index: string]: number };
  9773. /**
  9774. * Give chunks created a name (chunks with equal name are merged).
  9775. */
  9776. name?: string | false | Function;
  9777. /**
  9778. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  9779. */
  9780. usedExports?: boolean;
  9781. }
  9782. declare interface Options {
  9783. /**
  9784. * source
  9785. */
  9786. source: string;
  9787. /**
  9788. * absolute context path to which lib ident is relative to
  9789. */
  9790. context: string;
  9791. /**
  9792. * content
  9793. */
  9794. content: DllReferencePluginOptionsContent;
  9795. /**
  9796. * type
  9797. */
  9798. type?: "object" | "require";
  9799. /**
  9800. * extensions
  9801. */
  9802. extensions?: string[];
  9803. /**
  9804. * scope
  9805. */
  9806. scope?: string;
  9807. /**
  9808. * object for caching
  9809. */
  9810. associatedObjectForCache?: object;
  9811. }
  9812. declare abstract class OptionsApply {
  9813. process(
  9814. options: WebpackOptionsNormalized,
  9815. compiler: Compiler
  9816. ): WebpackOptionsNormalized;
  9817. }
  9818. declare interface OriginRecord {
  9819. module: null | Module;
  9820. loc: DependencyLocation;
  9821. request: string;
  9822. }
  9823. declare class OriginalSource extends Source {
  9824. constructor(source: string | Buffer, name: string);
  9825. getName(): string;
  9826. }
  9827. /**
  9828. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  9829. */
  9830. declare interface Output {
  9831. /**
  9832. * Add a container for define/require functions in the AMD module.
  9833. */
  9834. amdContainer?: string;
  9835. /**
  9836. * The filename of asset modules as relative path inside the 'output.path' directory.
  9837. */
  9838. assetModuleFilename?:
  9839. | string
  9840. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9841. /**
  9842. * Enable/disable creating async chunks that are loaded on demand.
  9843. */
  9844. asyncChunks?: boolean;
  9845. /**
  9846. * Add a comment in the UMD wrapper.
  9847. */
  9848. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  9849. /**
  9850. * Add charset attribute for script tag.
  9851. */
  9852. charset?: boolean;
  9853. /**
  9854. * 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.
  9855. */
  9856. chunkFilename?:
  9857. | string
  9858. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9859. /**
  9860. * 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).
  9861. */
  9862. chunkFormat?: string | false;
  9863. /**
  9864. * Number of milliseconds before chunk request expires.
  9865. */
  9866. chunkLoadTimeout?: number;
  9867. /**
  9868. * 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).
  9869. */
  9870. chunkLoading?: string | false;
  9871. /**
  9872. * The global variable used by webpack for loading of chunks.
  9873. */
  9874. chunkLoadingGlobal?: string;
  9875. /**
  9876. * Clean the output directory before emit.
  9877. */
  9878. clean?: boolean | CleanOptions;
  9879. /**
  9880. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  9881. */
  9882. compareBeforeEmit?: boolean;
  9883. /**
  9884. * This option enables cross-origin loading of chunks.
  9885. */
  9886. crossOriginLoading?: false | "anonymous" | "use-credentials";
  9887. /**
  9888. * 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.
  9889. */
  9890. cssChunkFilename?:
  9891. | string
  9892. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9893. /**
  9894. * 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.
  9895. */
  9896. cssFilename?:
  9897. | string
  9898. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9899. /**
  9900. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  9901. */
  9902. devtoolFallbackModuleFilenameTemplate?: string | Function;
  9903. /**
  9904. * Filename template string of function for the sources array in a generated SourceMap.
  9905. */
  9906. devtoolModuleFilenameTemplate?: string | Function;
  9907. /**
  9908. * 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.
  9909. */
  9910. devtoolNamespace?: string;
  9911. /**
  9912. * List of chunk loading types enabled for use by entry points.
  9913. */
  9914. enabledChunkLoadingTypes?: string[];
  9915. /**
  9916. * List of library types enabled for use by entry points.
  9917. */
  9918. enabledLibraryTypes?: string[];
  9919. /**
  9920. * List of wasm loading types enabled for use by entry points.
  9921. */
  9922. enabledWasmLoadingTypes?: string[];
  9923. /**
  9924. * The abilities of the environment where the webpack generated code should run.
  9925. */
  9926. environment?: Environment;
  9927. /**
  9928. * 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.
  9929. */
  9930. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9931. /**
  9932. * An expression which is used to address the global object/scope in runtime code.
  9933. */
  9934. globalObject?: string;
  9935. /**
  9936. * Digest type used for the hash.
  9937. */
  9938. hashDigest?: string;
  9939. /**
  9940. * Number of chars which are used for the hash.
  9941. */
  9942. hashDigestLength?: number;
  9943. /**
  9944. * Algorithm used for generation the hash (see node.js crypto package).
  9945. */
  9946. hashFunction?: string | typeof Hash;
  9947. /**
  9948. * Any string which is added to the hash to salt it.
  9949. */
  9950. hashSalt?: string;
  9951. /**
  9952. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  9953. */
  9954. hotUpdateChunkFilename?: string;
  9955. /**
  9956. * The global variable used by webpack for loading of hot update chunks.
  9957. */
  9958. hotUpdateGlobal?: string;
  9959. /**
  9960. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  9961. */
  9962. hotUpdateMainFilename?: string;
  9963. /**
  9964. * Ignore warnings in the browser.
  9965. */
  9966. ignoreBrowserWarnings?: boolean;
  9967. /**
  9968. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  9969. */
  9970. iife?: boolean;
  9971. /**
  9972. * The name of the native import() function (can be exchanged for a polyfill).
  9973. */
  9974. importFunctionName?: string;
  9975. /**
  9976. * The name of the native import.meta object (can be exchanged for a polyfill).
  9977. */
  9978. importMetaName?: string;
  9979. /**
  9980. * Make the output files a library, exporting the exports of the entry point.
  9981. */
  9982. library?: string | string[] | LibraryOptions | LibraryCustomUmdObject;
  9983. /**
  9984. * Specify which export should be exposed as library.
  9985. */
  9986. libraryExport?: string | string[];
  9987. /**
  9988. * 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).
  9989. */
  9990. libraryTarget?: string;
  9991. /**
  9992. * Output javascript files as module source type.
  9993. */
  9994. module?: boolean;
  9995. /**
  9996. * The output directory as **absolute path** (required).
  9997. */
  9998. path?: string;
  9999. /**
  10000. * Include comments with information about the modules.
  10001. */
  10002. pathinfo?: boolean | "verbose";
  10003. /**
  10004. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  10005. */
  10006. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10007. /**
  10008. * This option enables loading async chunks via a custom script type, such as script type="module".
  10009. */
  10010. scriptType?: false | "module" | "text/javascript";
  10011. /**
  10012. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  10013. */
  10014. sourceMapFilename?: string;
  10015. /**
  10016. * Prefixes every line of the source in the bundle with this string.
  10017. */
  10018. sourcePrefix?: string;
  10019. /**
  10020. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  10021. */
  10022. strictModuleErrorHandling?: boolean;
  10023. /**
  10024. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  10025. */
  10026. strictModuleExceptionHandling?: boolean;
  10027. /**
  10028. * 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.
  10029. */
  10030. trustedTypes?: string | true | TrustedTypes;
  10031. /**
  10032. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  10033. */
  10034. umdNamedDefine?: boolean;
  10035. /**
  10036. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  10037. */
  10038. uniqueName?: string;
  10039. /**
  10040. * 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).
  10041. */
  10042. wasmLoading?: string | false;
  10043. /**
  10044. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  10045. */
  10046. webassemblyModuleFilename?: string;
  10047. /**
  10048. * 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).
  10049. */
  10050. workerChunkLoading?: string | false;
  10051. /**
  10052. * 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.
  10053. */
  10054. workerPublicPath?: string;
  10055. /**
  10056. * 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).
  10057. */
  10058. workerWasmLoading?: string | false;
  10059. }
  10060. declare interface OutputFileSystem {
  10061. writeFile: WriteFile;
  10062. mkdir: Mkdir;
  10063. readdir?: ReaddirFs;
  10064. rmdir?: Rmdir;
  10065. unlink?: (
  10066. arg0: PathLikeFs,
  10067. arg1: (arg0: null | NodeJS.ErrnoException) => void
  10068. ) => void;
  10069. stat: StatFs;
  10070. lstat?: LStatFs;
  10071. readFile: ReadFileFs;
  10072. join?: (arg0: string, arg1: string) => string;
  10073. relative?: (arg0: string, arg1: string) => string;
  10074. dirname?: (arg0: string) => string;
  10075. }
  10076. /**
  10077. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  10078. */
  10079. declare interface OutputNormalized {
  10080. /**
  10081. * The filename of asset modules as relative path inside the 'output.path' directory.
  10082. */
  10083. assetModuleFilename?:
  10084. | string
  10085. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10086. /**
  10087. * Enable/disable creating async chunks that are loaded on demand.
  10088. */
  10089. asyncChunks?: boolean;
  10090. /**
  10091. * Add charset attribute for script tag.
  10092. */
  10093. charset?: boolean;
  10094. /**
  10095. * 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.
  10096. */
  10097. chunkFilename?:
  10098. | string
  10099. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10100. /**
  10101. * 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).
  10102. */
  10103. chunkFormat?: string | false;
  10104. /**
  10105. * Number of milliseconds before chunk request expires.
  10106. */
  10107. chunkLoadTimeout?: number;
  10108. /**
  10109. * 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).
  10110. */
  10111. chunkLoading?: string | false;
  10112. /**
  10113. * The global variable used by webpack for loading of chunks.
  10114. */
  10115. chunkLoadingGlobal?: string;
  10116. /**
  10117. * Clean the output directory before emit.
  10118. */
  10119. clean?: boolean | CleanOptions;
  10120. /**
  10121. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  10122. */
  10123. compareBeforeEmit?: boolean;
  10124. /**
  10125. * This option enables cross-origin loading of chunks.
  10126. */
  10127. crossOriginLoading?: false | "anonymous" | "use-credentials";
  10128. /**
  10129. * 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.
  10130. */
  10131. cssChunkFilename?:
  10132. | string
  10133. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10134. /**
  10135. * 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.
  10136. */
  10137. cssFilename?:
  10138. | string
  10139. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10140. /**
  10141. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  10142. */
  10143. devtoolFallbackModuleFilenameTemplate?: string | Function;
  10144. /**
  10145. * Filename template string of function for the sources array in a generated SourceMap.
  10146. */
  10147. devtoolModuleFilenameTemplate?: string | Function;
  10148. /**
  10149. * 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.
  10150. */
  10151. devtoolNamespace?: string;
  10152. /**
  10153. * List of chunk loading types enabled for use by entry points.
  10154. */
  10155. enabledChunkLoadingTypes: string[];
  10156. /**
  10157. * List of library types enabled for use by entry points.
  10158. */
  10159. enabledLibraryTypes: string[];
  10160. /**
  10161. * List of wasm loading types enabled for use by entry points.
  10162. */
  10163. enabledWasmLoadingTypes: string[];
  10164. /**
  10165. * The abilities of the environment where the webpack generated code should run.
  10166. */
  10167. environment: Environment;
  10168. /**
  10169. * 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.
  10170. */
  10171. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10172. /**
  10173. * An expression which is used to address the global object/scope in runtime code.
  10174. */
  10175. globalObject?: string;
  10176. /**
  10177. * Digest type used for the hash.
  10178. */
  10179. hashDigest?: string;
  10180. /**
  10181. * Number of chars which are used for the hash.
  10182. */
  10183. hashDigestLength?: number;
  10184. /**
  10185. * Algorithm used for generation the hash (see node.js crypto package).
  10186. */
  10187. hashFunction?: string | typeof Hash;
  10188. /**
  10189. * Any string which is added to the hash to salt it.
  10190. */
  10191. hashSalt?: string;
  10192. /**
  10193. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  10194. */
  10195. hotUpdateChunkFilename?: string;
  10196. /**
  10197. * The global variable used by webpack for loading of hot update chunks.
  10198. */
  10199. hotUpdateGlobal?: string;
  10200. /**
  10201. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  10202. */
  10203. hotUpdateMainFilename?: string;
  10204. /**
  10205. * Ignore warnings in the browser.
  10206. */
  10207. ignoreBrowserWarnings?: boolean;
  10208. /**
  10209. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  10210. */
  10211. iife?: boolean;
  10212. /**
  10213. * The name of the native import() function (can be exchanged for a polyfill).
  10214. */
  10215. importFunctionName?: string;
  10216. /**
  10217. * The name of the native import.meta object (can be exchanged for a polyfill).
  10218. */
  10219. importMetaName?: string;
  10220. /**
  10221. * Options for library.
  10222. */
  10223. library?: LibraryOptions;
  10224. /**
  10225. * Output javascript files as module source type.
  10226. */
  10227. module?: boolean;
  10228. /**
  10229. * The output directory as **absolute path** (required).
  10230. */
  10231. path?: string;
  10232. /**
  10233. * Include comments with information about the modules.
  10234. */
  10235. pathinfo?: boolean | "verbose";
  10236. /**
  10237. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  10238. */
  10239. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10240. /**
  10241. * This option enables loading async chunks via a custom script type, such as script type="module".
  10242. */
  10243. scriptType?: false | "module" | "text/javascript";
  10244. /**
  10245. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  10246. */
  10247. sourceMapFilename?: string;
  10248. /**
  10249. * Prefixes every line of the source in the bundle with this string.
  10250. */
  10251. sourcePrefix?: string;
  10252. /**
  10253. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  10254. */
  10255. strictModuleErrorHandling?: boolean;
  10256. /**
  10257. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  10258. */
  10259. strictModuleExceptionHandling?: boolean;
  10260. /**
  10261. * Use a Trusted Types policy to create urls for chunks.
  10262. */
  10263. trustedTypes?: TrustedTypes;
  10264. /**
  10265. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  10266. */
  10267. uniqueName?: string;
  10268. /**
  10269. * 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).
  10270. */
  10271. wasmLoading?: string | false;
  10272. /**
  10273. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  10274. */
  10275. webassemblyModuleFilename?: string;
  10276. /**
  10277. * 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).
  10278. */
  10279. workerChunkLoading?: string | false;
  10280. /**
  10281. * 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.
  10282. */
  10283. workerPublicPath?: string;
  10284. /**
  10285. * 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).
  10286. */
  10287. workerWasmLoading?: string | false;
  10288. }
  10289. declare interface ParameterizedComparator<TArg, T> {
  10290. (arg0: TArg): Comparator<T>;
  10291. }
  10292. declare interface ParsedIdentifier {
  10293. request: string;
  10294. query: string;
  10295. fragment: string;
  10296. directory: boolean;
  10297. module: boolean;
  10298. file: boolean;
  10299. internal: boolean;
  10300. }
  10301. declare class Parser {
  10302. constructor();
  10303. parse(
  10304. source: string | Buffer | PreparsedAst,
  10305. state: ParserState
  10306. ): ParserState;
  10307. }
  10308. declare interface ParserOptions {
  10309. [index: string]: any;
  10310. }
  10311. type ParserOptionsByModuleType = ParserOptionsByModuleTypeKnown &
  10312. ParserOptionsByModuleTypeUnknown;
  10313. /**
  10314. * Specify options for each parser.
  10315. */
  10316. declare interface ParserOptionsByModuleTypeKnown {
  10317. /**
  10318. * Parser options for asset modules.
  10319. */
  10320. asset?: AssetParserOptions;
  10321. /**
  10322. * No parser options are supported for this module type.
  10323. */
  10324. "asset/inline"?: EmptyParserOptions;
  10325. /**
  10326. * No parser options are supported for this module type.
  10327. */
  10328. "asset/resource"?: EmptyParserOptions;
  10329. /**
  10330. * No parser options are supported for this module type.
  10331. */
  10332. "asset/source"?: EmptyParserOptions;
  10333. /**
  10334. * Parser options for css modules.
  10335. */
  10336. css?: CssParserOptions;
  10337. /**
  10338. * Parser options for css/auto modules.
  10339. */
  10340. "css/auto"?: CssAutoParserOptions;
  10341. /**
  10342. * Parser options for css/global modules.
  10343. */
  10344. "css/global"?: CssGlobalParserOptions;
  10345. /**
  10346. * Parser options for css/module modules.
  10347. */
  10348. "css/module"?: CssModuleParserOptions;
  10349. /**
  10350. * Parser options for javascript modules.
  10351. */
  10352. javascript?: JavascriptParserOptions;
  10353. /**
  10354. * Parser options for javascript modules.
  10355. */
  10356. "javascript/auto"?: JavascriptParserOptions;
  10357. /**
  10358. * Parser options for javascript modules.
  10359. */
  10360. "javascript/dynamic"?: JavascriptParserOptions;
  10361. /**
  10362. * Parser options for javascript modules.
  10363. */
  10364. "javascript/esm"?: JavascriptParserOptions;
  10365. }
  10366. /**
  10367. * Specify options for each parser.
  10368. */
  10369. declare interface ParserOptionsByModuleTypeUnknown {
  10370. [index: string]: { [index: string]: any };
  10371. }
  10372. type ParserState = Record<string, any> & ParserStateBase;
  10373. declare interface ParserStateBase {
  10374. source: string | Buffer;
  10375. current: NormalModule;
  10376. module: NormalModule;
  10377. compilation: Compilation;
  10378. options: { [index: string]: any };
  10379. }
  10380. declare interface PathData {
  10381. chunkGraph?: ChunkGraph;
  10382. hash?: string;
  10383. hashWithLength?: (arg0: number) => string;
  10384. chunk?: Chunk | ChunkPathData;
  10385. module?: Module | ModulePathData;
  10386. runtime?: RuntimeSpec;
  10387. filename?: string;
  10388. basename?: string;
  10389. query?: string;
  10390. contentHashType?: string;
  10391. contentHash?: string;
  10392. contentHashWithLength?: (arg0: number) => string;
  10393. noChunkHash?: boolean;
  10394. url?: string;
  10395. }
  10396. type PathLikeFs = string | Buffer | URL;
  10397. type PathLikeTypes = string | Buffer | URL_url;
  10398. type PathOrFileDescriptorFs = string | number | Buffer | URL;
  10399. type PathOrFileDescriptorTypes = string | number | Buffer | URL_url;
  10400. type Pattern =
  10401. | Identifier
  10402. | MemberExpression
  10403. | ObjectPattern
  10404. | ArrayPattern
  10405. | RestElement
  10406. | AssignmentPattern;
  10407. /**
  10408. * Configuration object for web performance recommendations.
  10409. */
  10410. declare interface PerformanceOptions {
  10411. /**
  10412. * Filter function to select assets that are checked.
  10413. */
  10414. assetFilter?: Function;
  10415. /**
  10416. * Sets the format of the hints: warnings, errors or nothing at all.
  10417. */
  10418. hints?: false | "error" | "warning";
  10419. /**
  10420. * File size limit (in bytes) when exceeded, that webpack will provide performance hints.
  10421. */
  10422. maxAssetSize?: number;
  10423. /**
  10424. * Total size of an entry point (in bytes).
  10425. */
  10426. maxEntrypointSize?: number;
  10427. }
  10428. declare interface PitchLoaderDefinitionFunction<
  10429. OptionsType = {},
  10430. ContextAdditions = {}
  10431. > {
  10432. (
  10433. this: NormalModuleLoaderContext<OptionsType> &
  10434. LoaderRunnerLoaderContext<OptionsType> &
  10435. LoaderPluginLoaderContext &
  10436. HotModuleReplacementPluginLoaderContext &
  10437. ContextAdditions,
  10438. remainingRequest: string,
  10439. previousRequest: string,
  10440. data: object
  10441. ): string | void | Buffer | Promise<string | Buffer>;
  10442. }
  10443. declare class PlatformPlugin {
  10444. constructor(platform: Partial<PlatformTargetProperties>);
  10445. platform: Partial<PlatformTargetProperties>;
  10446. /**
  10447. * Apply the plugin
  10448. */
  10449. apply(compiler: Compiler): void;
  10450. }
  10451. declare interface PlatformTargetProperties {
  10452. /**
  10453. * web platform, importing of http(s) and std: is available
  10454. */
  10455. web: null | boolean;
  10456. /**
  10457. * browser platform, running in a normal web browser
  10458. */
  10459. browser: null | boolean;
  10460. /**
  10461. * (Web)Worker platform, running in a web/shared/service worker
  10462. */
  10463. webworker: null | boolean;
  10464. /**
  10465. * node platform, require of node built-in modules is available
  10466. */
  10467. node: null | boolean;
  10468. /**
  10469. * nwjs platform, require of legacy nw.gui is available
  10470. */
  10471. nwjs: null | boolean;
  10472. /**
  10473. * electron platform, require of some electron built-in modules is available
  10474. */
  10475. electron: null | boolean;
  10476. }
  10477. type Plugin =
  10478. | undefined
  10479. | null
  10480. | false
  10481. | ""
  10482. | 0
  10483. | { apply: (arg0: Resolver) => void }
  10484. | ((this: Resolver, arg1: Resolver) => void);
  10485. declare interface PnpApi {
  10486. resolveToUnqualified: (
  10487. arg0: string,
  10488. arg1: string,
  10489. arg2: object
  10490. ) => null | string;
  10491. }
  10492. declare class PrefetchPlugin {
  10493. constructor(context: string, request?: string);
  10494. context: null | string;
  10495. request: string;
  10496. /**
  10497. * Apply the plugin
  10498. */
  10499. apply(compiler: Compiler): void;
  10500. }
  10501. declare class PrefixSource extends Source {
  10502. constructor(prefix: string, source: string | Source);
  10503. original(): Source;
  10504. getPrefix(): string;
  10505. }
  10506. declare interface PreparsedAst {
  10507. [index: string]: any;
  10508. }
  10509. declare interface PrintedElement {
  10510. element: string;
  10511. content: string;
  10512. }
  10513. declare interface Problem {
  10514. type: ProblemType;
  10515. path: string;
  10516. argument: string;
  10517. value?: any;
  10518. index?: number;
  10519. expected?: string;
  10520. }
  10521. type ProblemType =
  10522. | "unknown-argument"
  10523. | "unexpected-non-array-in-path"
  10524. | "unexpected-non-object-in-path"
  10525. | "multiple-values-unexpected"
  10526. | "invalid-value";
  10527. declare interface ProcessAssetsAdditionalOptions {
  10528. additionalAssets?: true | Function;
  10529. }
  10530. declare class Profiler {
  10531. constructor(inspector?: any);
  10532. session: any;
  10533. inspector: any;
  10534. hasSession(): boolean;
  10535. startProfiling(): Promise<void> | Promise<[any, any, any]>;
  10536. sendCommand(method: string, params?: object): Promise<any>;
  10537. destroy(): Promise<void>;
  10538. stopProfiling(): Promise<{ profile: any }>;
  10539. }
  10540. declare class ProfilingPlugin {
  10541. constructor(options?: ProfilingPluginOptions);
  10542. outputPath: string;
  10543. /**
  10544. * Apply the plugin
  10545. */
  10546. apply(compiler: Compiler): void;
  10547. static Profiler: typeof Profiler;
  10548. }
  10549. declare interface ProfilingPluginOptions {
  10550. /**
  10551. * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.
  10552. */
  10553. outputPath?: string;
  10554. }
  10555. declare class ProgressPlugin {
  10556. constructor(options?: ProgressPluginArgument);
  10557. profile?: null | boolean;
  10558. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  10559. modulesCount?: number;
  10560. dependenciesCount?: number;
  10561. showEntries?: boolean;
  10562. showModules?: boolean;
  10563. showDependencies?: boolean;
  10564. showActiveModules?: boolean;
  10565. percentBy?: null | "entries" | "modules" | "dependencies";
  10566. apply(compiler: Compiler | MultiCompiler): void;
  10567. static getReporter(
  10568. compiler: Compiler
  10569. ): undefined | ((p: number, ...args: string[]) => void);
  10570. static defaultOptions: {
  10571. profile: boolean;
  10572. modulesCount: number;
  10573. dependenciesCount: number;
  10574. modules: boolean;
  10575. dependencies: boolean;
  10576. activeModules: boolean;
  10577. entries: boolean;
  10578. };
  10579. static createDefaultHandler: (
  10580. profile: undefined | null | boolean,
  10581. logger: WebpackLogger
  10582. ) => (percentage: number, msg: string, ...args: string[]) => void;
  10583. }
  10584. type ProgressPluginArgument =
  10585. | ProgressPluginOptions
  10586. | ((percentage: number, msg: string, ...args: string[]) => void);
  10587. /**
  10588. * Options object for the ProgressPlugin.
  10589. */
  10590. declare interface ProgressPluginOptions {
  10591. /**
  10592. * Show active modules count and one active module in progress message.
  10593. */
  10594. activeModules?: boolean;
  10595. /**
  10596. * Show dependencies count in progress message.
  10597. */
  10598. dependencies?: boolean;
  10599. /**
  10600. * Minimum dependencies count to start with. For better progress calculation. Default: 10000.
  10601. */
  10602. dependenciesCount?: number;
  10603. /**
  10604. * Show entries count in progress message.
  10605. */
  10606. entries?: boolean;
  10607. /**
  10608. * Function that executes for every progress step.
  10609. */
  10610. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  10611. /**
  10612. * Show modules count in progress message.
  10613. */
  10614. modules?: boolean;
  10615. /**
  10616. * Minimum modules count to start with. For better progress calculation. Default: 5000.
  10617. */
  10618. modulesCount?: number;
  10619. /**
  10620. * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
  10621. */
  10622. percentBy?: null | "entries" | "modules" | "dependencies";
  10623. /**
  10624. * Collect profile data for progress steps. Default: false.
  10625. */
  10626. profile?: null | boolean;
  10627. }
  10628. declare class ProvidePlugin {
  10629. constructor(definitions: Record<string, string | string[]>);
  10630. definitions: Record<string, string | string[]>;
  10631. /**
  10632. * Apply the plugin
  10633. */
  10634. apply(compiler: Compiler): void;
  10635. }
  10636. declare class ProvideSharedPlugin {
  10637. constructor(options: ProvideSharedPluginOptions);
  10638. /**
  10639. * Apply the plugin
  10640. */
  10641. apply(compiler: Compiler): void;
  10642. }
  10643. declare interface ProvideSharedPluginOptions {
  10644. /**
  10645. * 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.
  10646. */
  10647. provides: Provides;
  10648. /**
  10649. * Share scope name used for all provided modules (defaults to 'default').
  10650. */
  10651. shareScope?: string;
  10652. }
  10653. type Provides = (string | ProvidesObject)[] | ProvidesObject;
  10654. /**
  10655. * Advanced configuration for modules that should be provided as shared modules to the share scope.
  10656. */
  10657. declare interface ProvidesConfig {
  10658. /**
  10659. * 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.
  10660. */
  10661. eager?: boolean;
  10662. /**
  10663. * Key in the share scope under which the shared modules should be stored.
  10664. */
  10665. shareKey?: string;
  10666. /**
  10667. * Share scope name.
  10668. */
  10669. shareScope?: string;
  10670. /**
  10671. * Version of the provided module. Will replace lower matching versions, but not higher.
  10672. */
  10673. version?: string | false;
  10674. }
  10675. /**
  10676. * Modules that should be provided as shared modules to the share scope. Property names are used as share keys.
  10677. */
  10678. declare interface ProvidesObject {
  10679. [index: string]: string | ProvidesConfig;
  10680. }
  10681. declare interface RawChunkGroupOptions {
  10682. preloadOrder?: number;
  10683. prefetchOrder?: number;
  10684. fetchPriority?: "auto" | "low" | "high";
  10685. }
  10686. type RawLoaderDefinition<
  10687. OptionsType = {},
  10688. ContextAdditions = {}
  10689. > = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  10690. raw: true;
  10691. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  10692. };
  10693. declare interface RawLoaderDefinitionFunction<
  10694. OptionsType = {},
  10695. ContextAdditions = {}
  10696. > {
  10697. (
  10698. this: NormalModuleLoaderContext<OptionsType> &
  10699. LoaderRunnerLoaderContext<OptionsType> &
  10700. LoaderPluginLoaderContext &
  10701. HotModuleReplacementPluginLoaderContext &
  10702. ContextAdditions,
  10703. content: Buffer,
  10704. sourceMap?: string | SourceMap,
  10705. additionalData?: AdditionalData
  10706. ): string | void | Buffer | Promise<string | Buffer>;
  10707. }
  10708. declare class RawSource extends Source {
  10709. constructor(source: string | Buffer, convertToString?: boolean);
  10710. isBuffer(): boolean;
  10711. }
  10712. declare interface RawSourceMap {
  10713. version: number;
  10714. sources: string[];
  10715. names: string[];
  10716. sourceRoot?: string;
  10717. sourcesContent?: string[];
  10718. mappings: string;
  10719. file: string;
  10720. }
  10721. declare interface Read<TBuffer extends ArrayBufferView = Buffer> {
  10722. (
  10723. fd: number,
  10724. buffer: TBuffer,
  10725. offset: number,
  10726. length: number,
  10727. position: null | number | bigint,
  10728. callback: (
  10729. err: null | NodeJS.ErrnoException,
  10730. bytesRead: number,
  10731. buffer: TBuffer
  10732. ) => void
  10733. ): void;
  10734. (
  10735. fd: number,
  10736. options: ReadAsyncOptions<TBuffer>,
  10737. callback: (
  10738. err: null | NodeJS.ErrnoException,
  10739. bytesRead: number,
  10740. buffer: TBuffer
  10741. ) => void
  10742. ): void;
  10743. (
  10744. fd: number,
  10745. callback: (
  10746. err: null | NodeJS.ErrnoException,
  10747. bytesRead: number,
  10748. buffer: ArrayBufferView
  10749. ) => void
  10750. ): void;
  10751. }
  10752. declare interface ReadAsyncOptions<TBuffer extends ArrayBufferView> {
  10753. offset?: number;
  10754. length?: number;
  10755. position?: null | number | bigint;
  10756. buffer?: TBuffer;
  10757. }
  10758. declare class ReadFileCompileAsyncWasmPlugin {
  10759. constructor(__0?: ReadFileCompileAsyncWasmPluginOptions);
  10760. /**
  10761. * Apply the plugin
  10762. */
  10763. apply(compiler: Compiler): void;
  10764. }
  10765. declare interface ReadFileCompileAsyncWasmPluginOptions {
  10766. /**
  10767. * use import?
  10768. */
  10769. import?: boolean;
  10770. }
  10771. declare class ReadFileCompileWasmPlugin {
  10772. constructor(options?: ReadFileCompileWasmPluginOptions);
  10773. options: ReadFileCompileWasmPluginOptions;
  10774. /**
  10775. * Apply the plugin
  10776. */
  10777. apply(compiler: Compiler): void;
  10778. }
  10779. declare interface ReadFileCompileWasmPluginOptions {
  10780. /**
  10781. * mangle imports
  10782. */
  10783. mangleImports?: boolean;
  10784. /**
  10785. * use import?
  10786. */
  10787. import?: boolean;
  10788. }
  10789. declare interface ReadFileFs {
  10790. (
  10791. path: PathOrFileDescriptorFs,
  10792. options:
  10793. | undefined
  10794. | null
  10795. | ({ encoding?: null; flag?: string } & Abortable),
  10796. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10797. ): void;
  10798. (
  10799. path: PathOrFileDescriptorFs,
  10800. options:
  10801. | "ascii"
  10802. | "utf8"
  10803. | "utf-8"
  10804. | "utf16le"
  10805. | "utf-16le"
  10806. | "ucs2"
  10807. | "ucs-2"
  10808. | "latin1"
  10809. | "binary"
  10810. | ({ encoding: BufferEncoding; flag?: string } & Abortable)
  10811. | "base64"
  10812. | "base64url"
  10813. | "hex",
  10814. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10815. ): void;
  10816. (
  10817. path: PathOrFileDescriptorFs,
  10818. options:
  10819. | undefined
  10820. | null
  10821. | "ascii"
  10822. | "utf8"
  10823. | "utf-8"
  10824. | "utf16le"
  10825. | "utf-16le"
  10826. | "ucs2"
  10827. | "ucs-2"
  10828. | "latin1"
  10829. | "binary"
  10830. | "base64"
  10831. | "base64url"
  10832. | "hex"
  10833. | (ObjectEncodingOptions & { flag?: string } & Abortable),
  10834. callback: (
  10835. arg0: null | NodeJS.ErrnoException,
  10836. arg1?: string | Buffer
  10837. ) => void
  10838. ): void;
  10839. (
  10840. path: PathOrFileDescriptorFs,
  10841. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10842. ): void;
  10843. }
  10844. declare interface ReadFileSync {
  10845. (
  10846. path: PathOrFileDescriptorFs,
  10847. options?: null | { encoding?: null; flag?: string }
  10848. ): Buffer;
  10849. (
  10850. path: PathOrFileDescriptorFs,
  10851. options:
  10852. | "ascii"
  10853. | "utf8"
  10854. | "utf-8"
  10855. | "utf16le"
  10856. | "utf-16le"
  10857. | "ucs2"
  10858. | "ucs-2"
  10859. | "latin1"
  10860. | "binary"
  10861. | "base64"
  10862. | "base64url"
  10863. | "hex"
  10864. | { encoding: BufferEncoding; flag?: string }
  10865. ): string;
  10866. (
  10867. path: PathOrFileDescriptorFs,
  10868. options?:
  10869. | null
  10870. | "ascii"
  10871. | "utf8"
  10872. | "utf-8"
  10873. | "utf16le"
  10874. | "utf-16le"
  10875. | "ucs2"
  10876. | "ucs-2"
  10877. | "latin1"
  10878. | "binary"
  10879. | "base64"
  10880. | "base64url"
  10881. | "hex"
  10882. | (ObjectEncodingOptions & { flag?: string })
  10883. ): string | Buffer;
  10884. }
  10885. declare interface ReadFileTypes {
  10886. (
  10887. path: PathOrFileDescriptorTypes,
  10888. options:
  10889. | undefined
  10890. | null
  10891. | ({ encoding?: null; flag?: string } & Abortable),
  10892. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10893. ): void;
  10894. (
  10895. path: PathOrFileDescriptorTypes,
  10896. options:
  10897. | "ascii"
  10898. | "utf8"
  10899. | "utf-8"
  10900. | "utf16le"
  10901. | "utf-16le"
  10902. | "ucs2"
  10903. | "ucs-2"
  10904. | "latin1"
  10905. | "binary"
  10906. | "base64"
  10907. | "base64url"
  10908. | "hex"
  10909. | ({ encoding: BufferEncoding; flag?: string } & Abortable),
  10910. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10911. ): void;
  10912. (
  10913. path: PathOrFileDescriptorTypes,
  10914. options:
  10915. | undefined
  10916. | null
  10917. | "ascii"
  10918. | "utf8"
  10919. | "utf-8"
  10920. | "utf16le"
  10921. | "utf-16le"
  10922. | "ucs2"
  10923. | "ucs-2"
  10924. | "latin1"
  10925. | "binary"
  10926. | "base64"
  10927. | "base64url"
  10928. | "hex"
  10929. | (ObjectEncodingOptions & { flag?: string } & Abortable),
  10930. callback: (
  10931. arg0: null | NodeJS.ErrnoException,
  10932. arg1?: string | Buffer
  10933. ) => void
  10934. ): void;
  10935. (
  10936. path: PathOrFileDescriptorTypes,
  10937. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10938. ): void;
  10939. }
  10940. declare interface ReaddirFs {
  10941. (
  10942. path: PathLikeFs,
  10943. options:
  10944. | undefined
  10945. | null
  10946. | "ascii"
  10947. | "utf8"
  10948. | "utf-8"
  10949. | "utf16le"
  10950. | "utf-16le"
  10951. | "ucs2"
  10952. | "ucs-2"
  10953. | "latin1"
  10954. | "binary"
  10955. | "base64"
  10956. | "base64url"
  10957. | "hex"
  10958. | {
  10959. encoding:
  10960. | null
  10961. | "ascii"
  10962. | "utf8"
  10963. | "utf-8"
  10964. | "utf16le"
  10965. | "utf-16le"
  10966. | "ucs2"
  10967. | "ucs-2"
  10968. | "latin1"
  10969. | "binary"
  10970. | "base64"
  10971. | "base64url"
  10972. | "hex";
  10973. withFileTypes?: false;
  10974. recursive?: boolean;
  10975. },
  10976. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  10977. ): void;
  10978. (
  10979. path: PathLikeFs,
  10980. options:
  10981. | "buffer"
  10982. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
  10983. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer[]) => void
  10984. ): void;
  10985. (
  10986. path: PathLikeFs,
  10987. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  10988. ): void;
  10989. (
  10990. path: PathLikeFs,
  10991. options:
  10992. | undefined
  10993. | null
  10994. | "ascii"
  10995. | "utf8"
  10996. | "utf-8"
  10997. | "utf16le"
  10998. | "utf-16le"
  10999. | "ucs2"
  11000. | "ucs-2"
  11001. | "latin1"
  11002. | "binary"
  11003. | "base64"
  11004. | "base64url"
  11005. | "hex"
  11006. | (ObjectEncodingOptions & {
  11007. withFileTypes?: false;
  11008. recursive?: boolean;
  11009. }),
  11010. callback: (
  11011. arg0: null | NodeJS.ErrnoException,
  11012. arg1?: string[] | Buffer[]
  11013. ) => void
  11014. ): void;
  11015. (
  11016. path: PathLikeFs,
  11017. options: ObjectEncodingOptions & {
  11018. withFileTypes: true;
  11019. recursive?: boolean;
  11020. },
  11021. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Dirent[]) => void
  11022. ): void;
  11023. }
  11024. declare interface ReaddirSync {
  11025. (
  11026. path: PathLikeFs,
  11027. options?:
  11028. | null
  11029. | "ascii"
  11030. | "utf8"
  11031. | "utf-8"
  11032. | "utf16le"
  11033. | "utf-16le"
  11034. | "ucs2"
  11035. | "ucs-2"
  11036. | "latin1"
  11037. | "binary"
  11038. | "base64"
  11039. | "base64url"
  11040. | "hex"
  11041. | {
  11042. encoding:
  11043. | null
  11044. | "ascii"
  11045. | "utf8"
  11046. | "utf-8"
  11047. | "utf16le"
  11048. | "utf-16le"
  11049. | "ucs2"
  11050. | "ucs-2"
  11051. | "latin1"
  11052. | "binary"
  11053. | "base64"
  11054. | "base64url"
  11055. | "hex";
  11056. withFileTypes?: false;
  11057. recursive?: boolean;
  11058. }
  11059. ): string[];
  11060. (
  11061. path: PathLikeFs,
  11062. options:
  11063. | "buffer"
  11064. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean }
  11065. ): Buffer[];
  11066. (
  11067. path: PathLikeFs,
  11068. options?:
  11069. | null
  11070. | "ascii"
  11071. | "utf8"
  11072. | "utf-8"
  11073. | "utf16le"
  11074. | "utf-16le"
  11075. | "ucs2"
  11076. | "ucs-2"
  11077. | "latin1"
  11078. | "binary"
  11079. | "base64"
  11080. | "base64url"
  11081. | "hex"
  11082. | (ObjectEncodingOptions & { withFileTypes?: false; recursive?: boolean })
  11083. ): string[] | Buffer[];
  11084. (
  11085. path: PathLikeFs,
  11086. options: ObjectEncodingOptions & {
  11087. withFileTypes: true;
  11088. recursive?: boolean;
  11089. }
  11090. ): Dirent[];
  11091. }
  11092. declare interface ReaddirTypes {
  11093. (
  11094. path: PathLikeTypes,
  11095. options:
  11096. | undefined
  11097. | null
  11098. | "ascii"
  11099. | "utf8"
  11100. | "utf-8"
  11101. | "utf16le"
  11102. | "utf-16le"
  11103. | "ucs2"
  11104. | "ucs-2"
  11105. | "latin1"
  11106. | "binary"
  11107. | "base64"
  11108. | "base64url"
  11109. | "hex"
  11110. | {
  11111. encoding:
  11112. | null
  11113. | "ascii"
  11114. | "utf8"
  11115. | "utf-8"
  11116. | "utf16le"
  11117. | "utf-16le"
  11118. | "ucs2"
  11119. | "ucs-2"
  11120. | "latin1"
  11121. | "binary"
  11122. | "base64"
  11123. | "base64url"
  11124. | "hex";
  11125. withFileTypes?: false;
  11126. recursive?: boolean;
  11127. },
  11128. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  11129. ): void;
  11130. (
  11131. path: PathLikeTypes,
  11132. options:
  11133. | "buffer"
  11134. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
  11135. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer[]) => void
  11136. ): void;
  11137. (
  11138. path: PathLikeTypes,
  11139. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  11140. ): void;
  11141. (
  11142. path: PathLikeTypes,
  11143. options:
  11144. | undefined
  11145. | null
  11146. | "ascii"
  11147. | "utf8"
  11148. | "utf-8"
  11149. | "utf16le"
  11150. | "utf-16le"
  11151. | "ucs2"
  11152. | "ucs-2"
  11153. | "latin1"
  11154. | "binary"
  11155. | "base64"
  11156. | "base64url"
  11157. | "hex"
  11158. | (ObjectEncodingOptions & {
  11159. withFileTypes?: false;
  11160. recursive?: boolean;
  11161. }),
  11162. callback: (
  11163. arg0: null | NodeJS.ErrnoException,
  11164. arg1?: string[] | Buffer[]
  11165. ) => void
  11166. ): void;
  11167. (
  11168. path: PathLikeTypes,
  11169. options: ObjectEncodingOptions & {
  11170. withFileTypes: true;
  11171. recursive?: boolean;
  11172. },
  11173. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Dirent[]) => void
  11174. ): void;
  11175. }
  11176. declare interface ReadlinkFs {
  11177. (
  11178. path: PathLikeFs,
  11179. options: EncodingOption,
  11180. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  11181. ): void;
  11182. (
  11183. path: PathLikeFs,
  11184. options: BufferEncodingOption,
  11185. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  11186. ): void;
  11187. (
  11188. path: PathLikeFs,
  11189. options: EncodingOption,
  11190. callback: (
  11191. arg0: null | NodeJS.ErrnoException,
  11192. arg1?: string | Buffer
  11193. ) => void
  11194. ): void;
  11195. (
  11196. path: PathLikeFs,
  11197. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  11198. ): void;
  11199. }
  11200. declare interface ReadlinkSync {
  11201. (path: PathLikeFs, options?: EncodingOption): string;
  11202. (path: PathLikeFs, options: BufferEncodingOption): Buffer;
  11203. (path: PathLikeFs, options?: EncodingOption): string | Buffer;
  11204. }
  11205. declare interface ReadlinkTypes {
  11206. (
  11207. path: PathLikeTypes,
  11208. options: EncodingOption,
  11209. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  11210. ): void;
  11211. (
  11212. path: PathLikeTypes,
  11213. options: BufferEncodingOption,
  11214. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  11215. ): void;
  11216. (
  11217. path: PathLikeTypes,
  11218. options: EncodingOption,
  11219. callback: (
  11220. arg0: null | NodeJS.ErrnoException,
  11221. arg1?: string | Buffer
  11222. ) => void
  11223. ): void;
  11224. (
  11225. path: PathLikeTypes,
  11226. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  11227. ): void;
  11228. }
  11229. declare class RealContentHashPlugin {
  11230. constructor(__0: {
  11231. /**
  11232. * the hash function to use
  11233. */
  11234. hashFunction: string | typeof Hash;
  11235. /**
  11236. * the hash digest to use
  11237. */
  11238. hashDigest: string;
  11239. });
  11240. /**
  11241. * Apply the plugin
  11242. */
  11243. apply(compiler: Compiler): void;
  11244. static getCompilationHooks(
  11245. compilation: Compilation
  11246. ): CompilationHooksRealContentHashPlugin;
  11247. }
  11248. declare interface RealDependencyLocation {
  11249. start: SourcePosition;
  11250. end?: SourcePosition;
  11251. index?: number;
  11252. }
  11253. declare interface RealPathFs {
  11254. (
  11255. path: PathLikeFs,
  11256. options: EncodingOption,
  11257. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  11258. ): void;
  11259. (
  11260. path: PathLikeFs,
  11261. options: BufferEncodingOption,
  11262. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  11263. ): void;
  11264. (
  11265. path: PathLikeFs,
  11266. options: EncodingOption,
  11267. callback: (
  11268. arg0: null | NodeJS.ErrnoException,
  11269. arg1?: string | Buffer
  11270. ) => void
  11271. ): void;
  11272. (
  11273. path: PathLikeFs,
  11274. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  11275. ): void;
  11276. }
  11277. declare interface RealPathSync {
  11278. (path: PathLikeFs, options?: EncodingOption): string;
  11279. (path: PathLikeFs, options: BufferEncodingOption): Buffer;
  11280. (path: PathLikeFs, options?: EncodingOption): string | Buffer;
  11281. }
  11282. declare interface RealPathTypes {
  11283. (
  11284. path: PathLikeTypes,
  11285. options: EncodingOption,
  11286. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  11287. ): void;
  11288. (
  11289. path: PathLikeTypes,
  11290. options: BufferEncodingOption,
  11291. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  11292. ): void;
  11293. (
  11294. path: PathLikeTypes,
  11295. options: EncodingOption,
  11296. callback: (
  11297. arg0: null | NodeJS.ErrnoException,
  11298. arg1?: string | Buffer
  11299. ) => void
  11300. ): void;
  11301. (
  11302. path: PathLikeTypes,
  11303. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  11304. ): void;
  11305. }
  11306. type RecursiveArrayOrRecord<T> =
  11307. | { [index: string]: RecursiveArrayOrRecord<T> }
  11308. | RecursiveArrayOrRecord<T>[]
  11309. | T;
  11310. declare interface ReferencedExport {
  11311. /**
  11312. * name of the referenced export
  11313. */
  11314. name: string[];
  11315. /**
  11316. * when false, referenced export can not be mangled, defaults to true
  11317. */
  11318. canMangle?: boolean;
  11319. }
  11320. type Remotes = (string | RemotesObject)[] | RemotesObject;
  11321. /**
  11322. * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
  11323. */
  11324. declare interface RemotesConfig {
  11325. /**
  11326. * Container locations from which modules should be resolved and loaded at runtime.
  11327. */
  11328. external: string | string[];
  11329. /**
  11330. * The name of the share scope shared with this remote.
  11331. */
  11332. shareScope?: string;
  11333. }
  11334. /**
  11335. * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
  11336. */
  11337. declare interface RemotesObject {
  11338. [index: string]: string | RemotesConfig | string[];
  11339. }
  11340. declare interface RenderBootstrapContext {
  11341. /**
  11342. * the chunk
  11343. */
  11344. chunk: Chunk;
  11345. /**
  11346. * results of code generation
  11347. */
  11348. codeGenerationResults: CodeGenerationResults;
  11349. /**
  11350. * the runtime template
  11351. */
  11352. runtimeTemplate: RuntimeTemplate;
  11353. /**
  11354. * the module graph
  11355. */
  11356. moduleGraph: ModuleGraph;
  11357. /**
  11358. * the chunk graph
  11359. */
  11360. chunkGraph: ChunkGraph;
  11361. /**
  11362. * hash to be used for render call
  11363. */
  11364. hash: string;
  11365. }
  11366. declare interface RenderContextCssModulesPlugin {
  11367. /**
  11368. * the chunk
  11369. */
  11370. chunk: Chunk;
  11371. /**
  11372. * the chunk graph
  11373. */
  11374. chunkGraph: ChunkGraph;
  11375. /**
  11376. * results of code generation
  11377. */
  11378. codeGenerationResults: CodeGenerationResults;
  11379. /**
  11380. * the runtime template
  11381. */
  11382. runtimeTemplate: RuntimeTemplate;
  11383. /**
  11384. * the unique name
  11385. */
  11386. uniqueName: string;
  11387. /**
  11388. * undo path to css file
  11389. */
  11390. undoPath: string;
  11391. /**
  11392. * modules
  11393. */
  11394. modules: CssModule[];
  11395. }
  11396. declare interface RenderContextJavascriptModulesPlugin {
  11397. /**
  11398. * the chunk
  11399. */
  11400. chunk: Chunk;
  11401. /**
  11402. * the dependency templates
  11403. */
  11404. dependencyTemplates: DependencyTemplates;
  11405. /**
  11406. * the runtime template
  11407. */
  11408. runtimeTemplate: RuntimeTemplate;
  11409. /**
  11410. * the module graph
  11411. */
  11412. moduleGraph: ModuleGraph;
  11413. /**
  11414. * the chunk graph
  11415. */
  11416. chunkGraph: ChunkGraph;
  11417. /**
  11418. * results of code generation
  11419. */
  11420. codeGenerationResults: CodeGenerationResults;
  11421. /**
  11422. * rendering in strict context
  11423. */
  11424. strictMode?: boolean;
  11425. }
  11426. type RenderManifestEntry =
  11427. | RenderManifestEntryTemplated
  11428. | RenderManifestEntryStatic;
  11429. declare interface RenderManifestEntryStatic {
  11430. render: () => Source;
  11431. filename: string;
  11432. info: AssetInfo;
  11433. identifier: string;
  11434. hash?: string;
  11435. auxiliary?: boolean;
  11436. }
  11437. declare interface RenderManifestEntryTemplated {
  11438. render: () => Source;
  11439. filenameTemplate: TemplatePath;
  11440. pathOptions?: PathData;
  11441. info?: AssetInfo;
  11442. identifier: string;
  11443. hash?: string;
  11444. auxiliary?: boolean;
  11445. }
  11446. declare interface RenderManifestOptions {
  11447. /**
  11448. * the chunk used to render
  11449. */
  11450. chunk: Chunk;
  11451. hash: string;
  11452. fullHash: string;
  11453. outputOptions: Output;
  11454. codeGenerationResults: CodeGenerationResults;
  11455. moduleTemplates: { javascript: ModuleTemplate };
  11456. dependencyTemplates: DependencyTemplates;
  11457. runtimeTemplate: RuntimeTemplate;
  11458. moduleGraph: ModuleGraph;
  11459. chunkGraph: ChunkGraph;
  11460. }
  11461. declare class ReplaceSource extends Source {
  11462. constructor(source: Source, name?: string);
  11463. replace(start: number, end: number, newValue: string, name?: string): void;
  11464. insert(pos: number, newValue: string, name?: string): void;
  11465. getName(): string;
  11466. original(): string;
  11467. getReplacements(): {
  11468. start: number;
  11469. end: number;
  11470. content: string;
  11471. insertIndex: number;
  11472. name: string;
  11473. }[];
  11474. }
  11475. declare interface RequestRecord {
  11476. [index: string]: string | string[];
  11477. }
  11478. declare abstract class RequestShortener {
  11479. contextify: (arg0: string) => string;
  11480. shorten(request?: null | string): undefined | null | string;
  11481. }
  11482. declare interface ResolveBuildDependenciesResult {
  11483. /**
  11484. * list of files
  11485. */
  11486. files: Set<string>;
  11487. /**
  11488. * list of directories
  11489. */
  11490. directories: Set<string>;
  11491. /**
  11492. * list of missing entries
  11493. */
  11494. missing: Set<string>;
  11495. /**
  11496. * stored resolve results
  11497. */
  11498. resolveResults: Map<string, undefined | string | false>;
  11499. /**
  11500. * dependencies of the resolving
  11501. */
  11502. resolveDependencies: {
  11503. /**
  11504. * list of files
  11505. */
  11506. files: Set<string>;
  11507. /**
  11508. * list of directories
  11509. */
  11510. directories: Set<string>;
  11511. /**
  11512. * list of missing entries
  11513. */
  11514. missing: Set<string>;
  11515. };
  11516. }
  11517. declare interface ResolveContext {
  11518. contextDependencies?: WriteOnlySet<string>;
  11519. /**
  11520. * files that was found on file system
  11521. */
  11522. fileDependencies?: WriteOnlySet<string>;
  11523. /**
  11524. * dependencies that was not found on file system
  11525. */
  11526. missingDependencies?: WriteOnlySet<string>;
  11527. /**
  11528. * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
  11529. */
  11530. stack?: Set<string>;
  11531. /**
  11532. * log function
  11533. */
  11534. log?: (arg0: string) => void;
  11535. /**
  11536. * yield result, if provided plugins can return several results
  11537. */
  11538. yield?: (arg0: ResolveRequest) => void;
  11539. }
  11540. declare interface ResolveData {
  11541. contextInfo: ModuleFactoryCreateDataContextInfo;
  11542. resolveOptions?: ResolveOptions;
  11543. context: string;
  11544. request: string;
  11545. assertions?: Record<string, any>;
  11546. dependencies: ModuleDependency[];
  11547. dependencyType: string;
  11548. createData: Partial<NormalModuleCreateData & { settings: ModuleSettings }>;
  11549. fileDependencies: LazySet<string>;
  11550. missingDependencies: LazySet<string>;
  11551. contextDependencies: LazySet<string>;
  11552. ignoredModule?: Module;
  11553. /**
  11554. * allow to use the unsafe cache
  11555. */
  11556. cacheable: boolean;
  11557. }
  11558. /**
  11559. * Options object for resolving requests.
  11560. */
  11561. declare interface ResolveOptions {
  11562. /**
  11563. * Redirect module requests.
  11564. */
  11565. alias?:
  11566. | {
  11567. /**
  11568. * New request.
  11569. */
  11570. alias: string | false | string[];
  11571. /**
  11572. * Request to be redirected.
  11573. */
  11574. name: string;
  11575. /**
  11576. * Redirect only exact matching request.
  11577. */
  11578. onlyModule?: boolean;
  11579. }[]
  11580. | { [index: string]: string | false | string[] };
  11581. /**
  11582. * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
  11583. */
  11584. aliasFields?: (string | string[])[];
  11585. /**
  11586. * Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
  11587. */
  11588. byDependency?: { [index: string]: ResolveOptions };
  11589. /**
  11590. * Enable caching of successfully resolved requests (cache entries are revalidated).
  11591. */
  11592. cache?: boolean;
  11593. /**
  11594. * Predicate function to decide which requests should be cached.
  11595. */
  11596. cachePredicate?: (request: ResolveRequest) => boolean;
  11597. /**
  11598. * Include the context information in the cache identifier when caching.
  11599. */
  11600. cacheWithContext?: boolean;
  11601. /**
  11602. * Condition names for exports field entry point.
  11603. */
  11604. conditionNames?: string[];
  11605. /**
  11606. * Filenames used to find a description file (like a package.json).
  11607. */
  11608. descriptionFiles?: string[];
  11609. /**
  11610. * Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).
  11611. */
  11612. enforceExtension?: boolean;
  11613. /**
  11614. * Field names from the description file (usually package.json) which are used to provide entry points of a package.
  11615. */
  11616. exportsFields?: string[];
  11617. /**
  11618. * An object which maps extension to extension aliases.
  11619. */
  11620. extensionAlias?: { [index: string]: string | string[] };
  11621. /**
  11622. * Extensions added to the request when trying to find the file.
  11623. */
  11624. extensions?: string[];
  11625. /**
  11626. * Redirect module requests when normal resolving fails.
  11627. */
  11628. fallback?:
  11629. | {
  11630. /**
  11631. * New request.
  11632. */
  11633. alias: string | false | string[];
  11634. /**
  11635. * Request to be redirected.
  11636. */
  11637. name: string;
  11638. /**
  11639. * Redirect only exact matching request.
  11640. */
  11641. onlyModule?: boolean;
  11642. }[]
  11643. | { [index: string]: string | false | string[] };
  11644. /**
  11645. * Filesystem for the resolver.
  11646. */
  11647. fileSystem?: InputFileSystem;
  11648. /**
  11649. * 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).
  11650. */
  11651. fullySpecified?: boolean;
  11652. /**
  11653. * 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).
  11654. */
  11655. importsFields?: string[];
  11656. /**
  11657. * Field names from the description file (package.json) which are used to find the default entry point.
  11658. */
  11659. mainFields?: (string | string[])[];
  11660. /**
  11661. * Filenames used to find the default entry point if there is no description file or main field.
  11662. */
  11663. mainFiles?: string[];
  11664. /**
  11665. * Folder names or directory paths where to find modules.
  11666. */
  11667. modules?: string[];
  11668. /**
  11669. * Plugins for the resolver.
  11670. */
  11671. plugins?: (
  11672. | undefined
  11673. | null
  11674. | false
  11675. | ""
  11676. | 0
  11677. | {
  11678. [index: string]: any;
  11679. /**
  11680. * The run point of the plugin, required method.
  11681. */
  11682. apply: (arg0: Resolver) => void;
  11683. }
  11684. | ((this: Resolver, arg1: Resolver) => void)
  11685. | "..."
  11686. )[];
  11687. /**
  11688. * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
  11689. */
  11690. preferAbsolute?: boolean;
  11691. /**
  11692. * Prefer to resolve module requests as relative request and fallback to resolving as module.
  11693. */
  11694. preferRelative?: boolean;
  11695. /**
  11696. * Custom resolver.
  11697. */
  11698. resolver?: Resolver;
  11699. /**
  11700. * 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.
  11701. */
  11702. restrictions?: (string | RegExp)[];
  11703. /**
  11704. * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
  11705. */
  11706. roots?: string[];
  11707. /**
  11708. * Enable resolving symlinks to the original location.
  11709. */
  11710. symlinks?: boolean;
  11711. /**
  11712. * Enable caching of successfully resolved requests (cache entries are not revalidated).
  11713. */
  11714. unsafeCache?: boolean | { [index: string]: any };
  11715. /**
  11716. * Use synchronous filesystem calls for the resolver.
  11717. */
  11718. useSyncFileSystemCalls?: boolean;
  11719. }
  11720. declare interface ResolveOptionsResolverFactoryObject1 {
  11721. alias: AliasOption[];
  11722. fallback: AliasOption[];
  11723. aliasFields: Set<string | string[]>;
  11724. extensionAlias: ExtensionAliasOption[];
  11725. cachePredicate: (arg0: ResolveRequest) => boolean;
  11726. cacheWithContext: boolean;
  11727. /**
  11728. * A list of exports field condition names.
  11729. */
  11730. conditionNames: Set<string>;
  11731. descriptionFiles: string[];
  11732. enforceExtension: boolean;
  11733. exportsFields: Set<string | string[]>;
  11734. importsFields: Set<string | string[]>;
  11735. extensions: Set<string>;
  11736. fileSystem: FileSystem;
  11737. unsafeCache: false | object;
  11738. symlinks: boolean;
  11739. resolver?: Resolver;
  11740. modules: (string | string[])[];
  11741. mainFields: { name: string[]; forceRelative: boolean }[];
  11742. mainFiles: Set<string>;
  11743. plugins: Plugin[];
  11744. pnpApi: null | PnpApi;
  11745. roots: Set<string>;
  11746. fullySpecified: boolean;
  11747. resolveToContext: boolean;
  11748. restrictions: Set<string | RegExp>;
  11749. preferRelative: boolean;
  11750. preferAbsolute: boolean;
  11751. }
  11752. declare interface ResolveOptionsResolverFactoryObject2 {
  11753. /**
  11754. * A list of module alias configurations or an object which maps key to value
  11755. */
  11756. alias?: AliasOption[] | AliasOptions;
  11757. /**
  11758. * A list of module alias configurations or an object which maps key to value, applied only after modules option
  11759. */
  11760. fallback?: AliasOption[] | AliasOptions;
  11761. /**
  11762. * An object which maps extension to extension aliases
  11763. */
  11764. extensionAlias?: ExtensionAliasOptions;
  11765. /**
  11766. * A list of alias fields in description files
  11767. */
  11768. aliasFields?: (string | string[])[];
  11769. /**
  11770. * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
  11771. */
  11772. cachePredicate?: (arg0: ResolveRequest) => boolean;
  11773. /**
  11774. * Whether or not the unsafeCache should include request context as part of the cache key.
  11775. */
  11776. cacheWithContext?: boolean;
  11777. /**
  11778. * A list of description files to read from
  11779. */
  11780. descriptionFiles?: string[];
  11781. /**
  11782. * A list of exports field condition names.
  11783. */
  11784. conditionNames?: string[];
  11785. /**
  11786. * Enforce that a extension from extensions must be used
  11787. */
  11788. enforceExtension?: boolean;
  11789. /**
  11790. * A list of exports fields in description files
  11791. */
  11792. exportsFields?: (string | string[])[];
  11793. /**
  11794. * A list of imports fields in description files
  11795. */
  11796. importsFields?: (string | string[])[];
  11797. /**
  11798. * A list of extensions which should be tried for files
  11799. */
  11800. extensions?: string[];
  11801. /**
  11802. * The file system which should be used
  11803. */
  11804. fileSystem: FileSystem;
  11805. /**
  11806. * Use this cache object to unsafely cache the successful requests
  11807. */
  11808. unsafeCache?: boolean | object;
  11809. /**
  11810. * Resolve symlinks to their symlinked location
  11811. */
  11812. symlinks?: boolean;
  11813. /**
  11814. * A prepared Resolver to which the plugins are attached
  11815. */
  11816. resolver?: Resolver;
  11817. /**
  11818. * A list of directories to resolve modules from, can be absolute path or folder name
  11819. */
  11820. modules?: string | string[];
  11821. /**
  11822. * A list of main fields in description files
  11823. */
  11824. mainFields?: (
  11825. | string
  11826. | string[]
  11827. | { name: string | string[]; forceRelative: boolean }
  11828. )[];
  11829. /**
  11830. * A list of main files in directories
  11831. */
  11832. mainFiles?: string[];
  11833. /**
  11834. * A list of additional resolve plugins which should be applied
  11835. */
  11836. plugins?: Plugin[];
  11837. /**
  11838. * A PnP API that should be used - null is "never", undefined is "auto"
  11839. */
  11840. pnpApi?: null | PnpApi;
  11841. /**
  11842. * A list of root paths
  11843. */
  11844. roots?: string[];
  11845. /**
  11846. * The request is already fully specified and no extensions or directories are resolved for it
  11847. */
  11848. fullySpecified?: boolean;
  11849. /**
  11850. * Resolve to a context instead of a file
  11851. */
  11852. resolveToContext?: boolean;
  11853. /**
  11854. * A list of resolve restrictions
  11855. */
  11856. restrictions?: (string | RegExp)[];
  11857. /**
  11858. * Use only the sync constraints of the file system calls
  11859. */
  11860. useSyncFileSystemCalls?: boolean;
  11861. /**
  11862. * Prefer to resolve module requests as relative requests before falling back to modules
  11863. */
  11864. preferRelative?: boolean;
  11865. /**
  11866. * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
  11867. */
  11868. preferAbsolute?: boolean;
  11869. }
  11870. type ResolveOptionsWithDependencyType = ResolveOptions & {
  11871. dependencyType?: string;
  11872. resolveToContext?: boolean;
  11873. };
  11874. type ResolvePluginInstance =
  11875. | {
  11876. [index: string]: any;
  11877. /**
  11878. * The run point of the plugin, required method.
  11879. */
  11880. apply: (arg0: Resolver) => void;
  11881. }
  11882. | ((this: Resolver, arg1: Resolver) => void);
  11883. type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
  11884. declare interface ResolvedContextFileSystemInfoEntry {
  11885. safeTime: number;
  11886. timestampHash?: string;
  11887. }
  11888. declare interface ResolvedContextTimestampAndHash {
  11889. safeTime: number;
  11890. timestampHash?: string;
  11891. hash: string;
  11892. }
  11893. declare interface ResolvedOptions {
  11894. /**
  11895. * - platform target properties
  11896. */
  11897. platform: false | PlatformTargetProperties;
  11898. }
  11899. declare abstract class Resolver {
  11900. fileSystem: FileSystem;
  11901. options: ResolveOptionsResolverFactoryObject1;
  11902. hooks: KnownHooks;
  11903. ensureHook(
  11904. name:
  11905. | string
  11906. | AsyncSeriesBailHook<
  11907. [ResolveRequest, ResolveContext],
  11908. null | ResolveRequest
  11909. >
  11910. ): AsyncSeriesBailHook<
  11911. [ResolveRequest, ResolveContext],
  11912. null | ResolveRequest
  11913. >;
  11914. getHook(
  11915. name:
  11916. | string
  11917. | AsyncSeriesBailHook<
  11918. [ResolveRequest, ResolveContext],
  11919. null | ResolveRequest
  11920. >
  11921. ): AsyncSeriesBailHook<
  11922. [ResolveRequest, ResolveContext],
  11923. null | ResolveRequest
  11924. >;
  11925. resolveSync(context: object, path: string, request: string): string | false;
  11926. resolve(
  11927. context: object,
  11928. path: string,
  11929. request: string,
  11930. resolveContext: ResolveContext,
  11931. callback: (
  11932. err: null | ErrorWithDetail,
  11933. res?: string | false,
  11934. req?: ResolveRequest
  11935. ) => void
  11936. ): void;
  11937. doResolve(
  11938. hook: AsyncSeriesBailHook<
  11939. [ResolveRequest, ResolveContext],
  11940. null | ResolveRequest
  11941. >,
  11942. request: ResolveRequest,
  11943. message: null | string,
  11944. resolveContext: ResolveContext,
  11945. callback: (err?: null | Error, result?: ResolveRequest) => void
  11946. ): void;
  11947. parse(identifier: string): ParsedIdentifier;
  11948. isModule(path: string): boolean;
  11949. isPrivate(path: string): boolean;
  11950. isDirectory(path: string): boolean;
  11951. join(path: string, request: string): string;
  11952. normalize(path: string): string;
  11953. }
  11954. declare interface ResolverCache {
  11955. direct: WeakMap<object, ResolverWithOptions>;
  11956. stringified: Map<string, ResolverWithOptions>;
  11957. }
  11958. declare abstract class ResolverFactory {
  11959. hooks: Readonly<{
  11960. resolveOptions: HookMap<
  11961. SyncWaterfallHook<[ResolveOptionsWithDependencyType]>
  11962. >;
  11963. resolver: HookMap<
  11964. SyncHook<
  11965. [
  11966. Resolver,
  11967. ResolveOptionsResolverFactoryObject2,
  11968. ResolveOptionsWithDependencyType
  11969. ]
  11970. >
  11971. >;
  11972. }>;
  11973. cache: Map<string, ResolverCache>;
  11974. get(
  11975. type: string,
  11976. resolveOptions?: ResolveOptionsWithDependencyType
  11977. ): ResolverWithOptions;
  11978. }
  11979. type ResolverWithOptions = Resolver & WithOptions;
  11980. declare interface ResourceDataWithData {
  11981. resource: string;
  11982. path?: string;
  11983. query?: string;
  11984. fragment?: string;
  11985. context?: string;
  11986. data: Record<string, any>;
  11987. }
  11988. declare abstract class RestoreProvidedData {
  11989. exports: any;
  11990. otherProvided: any;
  11991. otherCanMangleProvide: any;
  11992. otherTerminalBinding: any;
  11993. serialize(__0: ObjectSerializerContext): void;
  11994. }
  11995. declare interface RmDirOptions {
  11996. maxRetries?: number;
  11997. recursive?: boolean;
  11998. retryDelay?: number;
  11999. }
  12000. declare interface Rmdir {
  12001. (
  12002. file: PathLikeFs,
  12003. callback: (arg0: null | NodeJS.ErrnoException) => void
  12004. ): void;
  12005. (
  12006. file: PathLikeFs,
  12007. options: RmDirOptions,
  12008. callback: (arg0: null | NodeJS.ErrnoException) => void
  12009. ): void;
  12010. }
  12011. type Rule = string | RegExp;
  12012. declare interface RuleSet {
  12013. /**
  12014. * map of references in the rule set (may grow over time)
  12015. */
  12016. references: Map<string, any>;
  12017. /**
  12018. * execute the rule set
  12019. */
  12020. exec: (arg0: EffectData) => Effect[];
  12021. }
  12022. type RuleSetCondition =
  12023. | string
  12024. | RegExp
  12025. | ((value: string) => boolean)
  12026. | RuleSetLogicalConditions
  12027. | RuleSetCondition[];
  12028. type RuleSetConditionAbsolute =
  12029. | string
  12030. | RegExp
  12031. | ((value: string) => boolean)
  12032. | RuleSetLogicalConditionsAbsolute
  12033. | RuleSetConditionAbsolute[];
  12034. type RuleSetConditionOrConditions =
  12035. | string
  12036. | RegExp
  12037. | ((value: string) => boolean)
  12038. | RuleSetLogicalConditions
  12039. | RuleSetCondition[];
  12040. /**
  12041. * Logic operators used in a condition matcher.
  12042. */
  12043. declare interface RuleSetLogicalConditions {
  12044. /**
  12045. * Logical AND.
  12046. */
  12047. and?: RuleSetCondition[];
  12048. /**
  12049. * Logical NOT.
  12050. */
  12051. not?:
  12052. | string
  12053. | RegExp
  12054. | ((value: string) => boolean)
  12055. | RuleSetLogicalConditions
  12056. | RuleSetCondition[];
  12057. /**
  12058. * Logical OR.
  12059. */
  12060. or?: RuleSetCondition[];
  12061. }
  12062. /**
  12063. * Logic operators used in a condition matcher.
  12064. */
  12065. declare interface RuleSetLogicalConditionsAbsolute {
  12066. /**
  12067. * Logical AND.
  12068. */
  12069. and?: RuleSetConditionAbsolute[];
  12070. /**
  12071. * Logical NOT.
  12072. */
  12073. not?:
  12074. | string
  12075. | RegExp
  12076. | ((value: string) => boolean)
  12077. | RuleSetLogicalConditionsAbsolute
  12078. | RuleSetConditionAbsolute[];
  12079. /**
  12080. * Logical OR.
  12081. */
  12082. or?: RuleSetConditionAbsolute[];
  12083. }
  12084. /**
  12085. * A rule description with conditions and effects for modules.
  12086. */
  12087. declare interface RuleSetRule {
  12088. /**
  12089. * Match on import assertions of the dependency.
  12090. */
  12091. assert?: { [index: string]: RuleSetConditionOrConditions };
  12092. /**
  12093. * Match the child compiler name.
  12094. */
  12095. compiler?:
  12096. | string
  12097. | RegExp
  12098. | ((value: string) => boolean)
  12099. | RuleSetLogicalConditions
  12100. | RuleSetCondition[];
  12101. /**
  12102. * Match dependency type.
  12103. */
  12104. dependency?:
  12105. | string
  12106. | RegExp
  12107. | ((value: string) => boolean)
  12108. | RuleSetLogicalConditions
  12109. | RuleSetCondition[];
  12110. /**
  12111. * Match values of properties in the description file (usually package.json).
  12112. */
  12113. descriptionData?: { [index: string]: RuleSetConditionOrConditions };
  12114. /**
  12115. * Enforce this rule as pre or post step.
  12116. */
  12117. enforce?: "pre" | "post";
  12118. /**
  12119. * Shortcut for resource.exclude.
  12120. */
  12121. exclude?:
  12122. | string
  12123. | RegExp
  12124. | ((value: string) => boolean)
  12125. | RuleSetLogicalConditionsAbsolute
  12126. | RuleSetConditionAbsolute[];
  12127. /**
  12128. * The options for the module generator.
  12129. */
  12130. generator?: { [index: string]: any };
  12131. /**
  12132. * Shortcut for resource.include.
  12133. */
  12134. include?:
  12135. | string
  12136. | RegExp
  12137. | ((value: string) => boolean)
  12138. | RuleSetLogicalConditionsAbsolute
  12139. | RuleSetConditionAbsolute[];
  12140. /**
  12141. * Match the issuer of the module (The module pointing to this module).
  12142. */
  12143. issuer?:
  12144. | string
  12145. | RegExp
  12146. | ((value: string) => boolean)
  12147. | RuleSetLogicalConditionsAbsolute
  12148. | RuleSetConditionAbsolute[];
  12149. /**
  12150. * Match layer of the issuer of this module (The module pointing to this module).
  12151. */
  12152. issuerLayer?:
  12153. | string
  12154. | RegExp
  12155. | ((value: string) => boolean)
  12156. | RuleSetLogicalConditions
  12157. | RuleSetCondition[];
  12158. /**
  12159. * Specifies the layer in which the module should be placed in.
  12160. */
  12161. layer?: string;
  12162. /**
  12163. * Shortcut for use.loader.
  12164. */
  12165. loader?: string;
  12166. /**
  12167. * Match module mimetype when load from Data URI.
  12168. */
  12169. mimetype?:
  12170. | string
  12171. | RegExp
  12172. | ((value: string) => boolean)
  12173. | RuleSetLogicalConditions
  12174. | RuleSetCondition[];
  12175. /**
  12176. * Only execute the first matching rule in this array.
  12177. */
  12178. oneOf?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  12179. /**
  12180. * Shortcut for use.options.
  12181. */
  12182. options?: string | { [index: string]: any };
  12183. /**
  12184. * Options for parsing.
  12185. */
  12186. parser?: { [index: string]: any };
  12187. /**
  12188. * Match the real resource path of the module.
  12189. */
  12190. realResource?:
  12191. | string
  12192. | RegExp
  12193. | ((value: string) => boolean)
  12194. | RuleSetLogicalConditionsAbsolute
  12195. | RuleSetConditionAbsolute[];
  12196. /**
  12197. * Options for the resolver.
  12198. */
  12199. resolve?: ResolveOptions;
  12200. /**
  12201. * Match the resource path of the module.
  12202. */
  12203. resource?:
  12204. | string
  12205. | RegExp
  12206. | ((value: string) => boolean)
  12207. | RuleSetLogicalConditionsAbsolute
  12208. | RuleSetConditionAbsolute[];
  12209. /**
  12210. * Match the resource fragment of the module.
  12211. */
  12212. resourceFragment?:
  12213. | string
  12214. | RegExp
  12215. | ((value: string) => boolean)
  12216. | RuleSetLogicalConditions
  12217. | RuleSetCondition[];
  12218. /**
  12219. * Match the resource query of the module.
  12220. */
  12221. resourceQuery?:
  12222. | string
  12223. | RegExp
  12224. | ((value: string) => boolean)
  12225. | RuleSetLogicalConditions
  12226. | RuleSetCondition[];
  12227. /**
  12228. * Match and execute these rules when this rule is matched.
  12229. */
  12230. rules?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  12231. /**
  12232. * Match module scheme.
  12233. */
  12234. scheme?:
  12235. | string
  12236. | RegExp
  12237. | ((value: string) => boolean)
  12238. | RuleSetLogicalConditions
  12239. | RuleSetCondition[];
  12240. /**
  12241. * Flags a module as with or without side effects.
  12242. */
  12243. sideEffects?: boolean;
  12244. /**
  12245. * Shortcut for resource.test.
  12246. */
  12247. test?:
  12248. | string
  12249. | RegExp
  12250. | ((value: string) => boolean)
  12251. | RuleSetLogicalConditionsAbsolute
  12252. | RuleSetConditionAbsolute[];
  12253. /**
  12254. * Module type to use for the module.
  12255. */
  12256. type?: string;
  12257. /**
  12258. * Modifiers applied to the module when rule is matched.
  12259. */
  12260. use?:
  12261. | string
  12262. | (
  12263. | undefined
  12264. | null
  12265. | string
  12266. | false
  12267. | 0
  12268. | {
  12269. /**
  12270. * Unique loader options identifier.
  12271. */
  12272. ident?: string;
  12273. /**
  12274. * Loader name.
  12275. */
  12276. loader?: string;
  12277. /**
  12278. * Loader options.
  12279. */
  12280. options?: string | { [index: string]: any };
  12281. }
  12282. | ((data: object) =>
  12283. | string
  12284. | {
  12285. /**
  12286. * Unique loader options identifier.
  12287. */
  12288. ident?: string;
  12289. /**
  12290. * Loader name.
  12291. */
  12292. loader?: string;
  12293. /**
  12294. * Loader options.
  12295. */
  12296. options?: string | { [index: string]: any };
  12297. }
  12298. | __TypeWebpackOptions
  12299. | __Type_2[])
  12300. )[]
  12301. | ((data: {
  12302. resource: string;
  12303. realResource: string;
  12304. resourceQuery: string;
  12305. issuer: string;
  12306. compiler: string;
  12307. }) => __Type_2[])
  12308. | {
  12309. /**
  12310. * Unique loader options identifier.
  12311. */
  12312. ident?: string;
  12313. /**
  12314. * Loader name.
  12315. */
  12316. loader?: string;
  12317. /**
  12318. * Loader options.
  12319. */
  12320. options?: string | { [index: string]: any };
  12321. }
  12322. | __TypeWebpackOptions;
  12323. /**
  12324. * Match on import attributes of the dependency.
  12325. */
  12326. with?: { [index: string]: RuleSetConditionOrConditions };
  12327. }
  12328. type RuleSetUse =
  12329. | string
  12330. | (
  12331. | undefined
  12332. | null
  12333. | string
  12334. | false
  12335. | 0
  12336. | {
  12337. /**
  12338. * Unique loader options identifier.
  12339. */
  12340. ident?: string;
  12341. /**
  12342. * Loader name.
  12343. */
  12344. loader?: string;
  12345. /**
  12346. * Loader options.
  12347. */
  12348. options?: string | { [index: string]: any };
  12349. }
  12350. | ((data: object) =>
  12351. | string
  12352. | {
  12353. /**
  12354. * Unique loader options identifier.
  12355. */
  12356. ident?: string;
  12357. /**
  12358. * Loader name.
  12359. */
  12360. loader?: string;
  12361. /**
  12362. * Loader options.
  12363. */
  12364. options?: string | { [index: string]: any };
  12365. }
  12366. | __TypeWebpackOptions
  12367. | __Type_2[])
  12368. )[]
  12369. | ((data: {
  12370. resource: string;
  12371. realResource: string;
  12372. resourceQuery: string;
  12373. issuer: string;
  12374. compiler: string;
  12375. }) => __Type_2[])
  12376. | {
  12377. /**
  12378. * Unique loader options identifier.
  12379. */
  12380. ident?: string;
  12381. /**
  12382. * Loader name.
  12383. */
  12384. loader?: string;
  12385. /**
  12386. * Loader options.
  12387. */
  12388. options?: string | { [index: string]: any };
  12389. }
  12390. | __TypeWebpackOptions;
  12391. type RuleSetUseItem =
  12392. | string
  12393. | {
  12394. /**
  12395. * Unique loader options identifier.
  12396. */
  12397. ident?: string;
  12398. /**
  12399. * Loader name.
  12400. */
  12401. loader?: string;
  12402. /**
  12403. * Loader options.
  12404. */
  12405. options?: string | { [index: string]: any };
  12406. }
  12407. | __TypeWebpackOptions;
  12408. declare interface RunCallback<T> {
  12409. (err: null | Error, result?: T): any;
  12410. }
  12411. declare class RuntimeChunkPlugin {
  12412. constructor(options: { name?: (entrypoint: { name: string }) => string });
  12413. options: {
  12414. name:
  12415. | ((entrypoint: { name: string }) => string)
  12416. | ((entrypoint: Entrypoint) => string);
  12417. };
  12418. /**
  12419. * Apply the plugin
  12420. */
  12421. apply(compiler: Compiler): void;
  12422. }
  12423. type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
  12424. declare class RuntimeModule extends Module {
  12425. constructor(name: string, stage?: number);
  12426. name: string;
  12427. stage: number;
  12428. compilation?: Compilation;
  12429. chunk?: Chunk;
  12430. chunkGraph?: ChunkGraph;
  12431. fullHash: boolean;
  12432. dependentHash: boolean;
  12433. attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
  12434. generate(): null | string;
  12435. getGeneratedCode(): null | string;
  12436. shouldIsolate(): boolean;
  12437. /**
  12438. * Runtime modules without any dependencies to other runtime modules
  12439. */
  12440. static STAGE_NORMAL: number;
  12441. /**
  12442. * Runtime modules with simple dependencies on other runtime modules
  12443. */
  12444. static STAGE_BASIC: number;
  12445. /**
  12446. * Runtime modules which attach to handlers of other runtime modules
  12447. */
  12448. static STAGE_ATTACH: number;
  12449. /**
  12450. * Runtime modules which trigger actions on bootstrap
  12451. */
  12452. static STAGE_TRIGGER: number;
  12453. }
  12454. declare interface RuntimeRequirementsContext {
  12455. /**
  12456. * the chunk graph
  12457. */
  12458. chunkGraph: ChunkGraph;
  12459. /**
  12460. * the code generation results
  12461. */
  12462. codeGenerationResults: CodeGenerationResults;
  12463. }
  12464. type RuntimeSpec = undefined | string | SortableSet<string>;
  12465. declare class RuntimeSpecMap<T> {
  12466. constructor(clone?: RuntimeSpecMap<T>);
  12467. get(runtime: RuntimeSpec): undefined | T;
  12468. has(runtime: RuntimeSpec): boolean;
  12469. set(runtime: RuntimeSpec, value: T): void;
  12470. provide(runtime: RuntimeSpec, computer: () => any): any;
  12471. delete(runtime: RuntimeSpec): void;
  12472. update(runtime: RuntimeSpec, fn: (arg0?: T) => T): void;
  12473. keys(): RuntimeSpec[];
  12474. values(): IterableIterator<T>;
  12475. get size(): number;
  12476. }
  12477. declare class RuntimeSpecSet {
  12478. constructor(iterable?: Iterable<RuntimeSpec>);
  12479. add(runtime: RuntimeSpec): void;
  12480. has(runtime: RuntimeSpec): boolean;
  12481. get size(): number;
  12482. [Symbol.iterator](): IterableIterator<RuntimeSpec>;
  12483. }
  12484. declare abstract class RuntimeTemplate {
  12485. compilation: Compilation;
  12486. outputOptions: OutputNormalized;
  12487. requestShortener: RequestShortener;
  12488. globalObject: string;
  12489. contentHashReplacement: string;
  12490. isIIFE(): undefined | boolean;
  12491. isModule(): undefined | boolean;
  12492. isNeutralPlatform(): boolean;
  12493. supportsConst(): undefined | boolean;
  12494. supportsArrowFunction(): undefined | boolean;
  12495. supportsAsyncFunction(): undefined | boolean;
  12496. supportsOptionalChaining(): undefined | boolean;
  12497. supportsForOf(): undefined | boolean;
  12498. supportsDestructuring(): undefined | boolean;
  12499. supportsBigIntLiteral(): undefined | boolean;
  12500. supportsDynamicImport(): undefined | boolean;
  12501. supportsEcmaScriptModuleSyntax(): undefined | boolean;
  12502. supportTemplateLiteral(): undefined | boolean;
  12503. supportNodePrefixForCoreModules(): undefined | boolean;
  12504. returningFunction(returnValue: string, args?: string): string;
  12505. basicFunction(args: string, body: string | string[]): string;
  12506. concatenation(...args: (string | { expr: string })[]): string;
  12507. expressionFunction(expression: string, args?: string): string;
  12508. emptyFunction(): string;
  12509. destructureArray(items: string[], value: string): string;
  12510. destructureObject(items: string[], value: string): string;
  12511. iife(args: string, body: string): string;
  12512. forEach(variable: string, array: string, body: string | string[]): string;
  12513. /**
  12514. * Add a comment
  12515. */
  12516. comment(__0: {
  12517. /**
  12518. * request string used originally
  12519. */
  12520. request?: string;
  12521. /**
  12522. * name of the chunk referenced
  12523. */
  12524. chunkName?: null | string;
  12525. /**
  12526. * reason information of the chunk
  12527. */
  12528. chunkReason?: string;
  12529. /**
  12530. * additional message
  12531. */
  12532. message?: string;
  12533. /**
  12534. * name of the export
  12535. */
  12536. exportName?: string;
  12537. }): string;
  12538. throwMissingModuleErrorBlock(__0: {
  12539. /**
  12540. * request string used originally
  12541. */
  12542. request?: string;
  12543. }): string;
  12544. throwMissingModuleErrorFunction(__0: {
  12545. /**
  12546. * request string used originally
  12547. */
  12548. request?: string;
  12549. }): string;
  12550. missingModule(__0: {
  12551. /**
  12552. * request string used originally
  12553. */
  12554. request?: string;
  12555. }): string;
  12556. missingModuleStatement(__0: {
  12557. /**
  12558. * request string used originally
  12559. */
  12560. request?: string;
  12561. }): string;
  12562. missingModulePromise(__0: {
  12563. /**
  12564. * request string used originally
  12565. */
  12566. request?: string;
  12567. }): string;
  12568. weakError(__0: {
  12569. /**
  12570. * the chunk graph
  12571. */
  12572. chunkGraph: ChunkGraph;
  12573. /**
  12574. * the module
  12575. */
  12576. module: Module;
  12577. /**
  12578. * the request that should be printed as comment
  12579. */
  12580. request?: string;
  12581. /**
  12582. * expression to use as id expression
  12583. */
  12584. idExpr?: string;
  12585. /**
  12586. * which kind of code should be returned
  12587. */
  12588. type: "promise" | "expression" | "statements";
  12589. }): string;
  12590. moduleId(__0: {
  12591. /**
  12592. * the module
  12593. */
  12594. module: Module;
  12595. /**
  12596. * the chunk graph
  12597. */
  12598. chunkGraph: ChunkGraph;
  12599. /**
  12600. * the request that should be printed as comment
  12601. */
  12602. request?: string;
  12603. /**
  12604. * if the dependency is weak (will create a nice error message)
  12605. */
  12606. weak?: boolean;
  12607. }): string;
  12608. moduleRaw(__0: {
  12609. /**
  12610. * the module
  12611. */
  12612. module: null | Module;
  12613. /**
  12614. * the chunk graph
  12615. */
  12616. chunkGraph: ChunkGraph;
  12617. /**
  12618. * the request that should be printed as comment
  12619. */
  12620. request?: string;
  12621. /**
  12622. * if the dependency is weak (will create a nice error message)
  12623. */
  12624. weak?: boolean;
  12625. /**
  12626. * if set, will be filled with runtime requirements
  12627. */
  12628. runtimeRequirements: Set<string>;
  12629. }): string;
  12630. moduleExports(__0: {
  12631. /**
  12632. * the module
  12633. */
  12634. module: null | Module;
  12635. /**
  12636. * the chunk graph
  12637. */
  12638. chunkGraph: ChunkGraph;
  12639. /**
  12640. * the request that should be printed as comment
  12641. */
  12642. request: string;
  12643. /**
  12644. * if the dependency is weak (will create a nice error message)
  12645. */
  12646. weak?: boolean;
  12647. /**
  12648. * if set, will be filled with runtime requirements
  12649. */
  12650. runtimeRequirements: Set<string>;
  12651. }): string;
  12652. moduleNamespace(__0: {
  12653. /**
  12654. * the module
  12655. */
  12656. module: Module;
  12657. /**
  12658. * the chunk graph
  12659. */
  12660. chunkGraph: ChunkGraph;
  12661. /**
  12662. * the request that should be printed as comment
  12663. */
  12664. request: string;
  12665. /**
  12666. * if the current module is in strict esm mode
  12667. */
  12668. strict?: boolean;
  12669. /**
  12670. * if the dependency is weak (will create a nice error message)
  12671. */
  12672. weak?: boolean;
  12673. /**
  12674. * if set, will be filled with runtime requirements
  12675. */
  12676. runtimeRequirements: Set<string>;
  12677. }): string;
  12678. moduleNamespacePromise(__0: {
  12679. /**
  12680. * the chunk graph
  12681. */
  12682. chunkGraph: ChunkGraph;
  12683. /**
  12684. * the current dependencies block
  12685. */
  12686. block?: AsyncDependenciesBlock;
  12687. /**
  12688. * the module
  12689. */
  12690. module: Module;
  12691. /**
  12692. * the request that should be printed as comment
  12693. */
  12694. request: string;
  12695. /**
  12696. * a message for the comment
  12697. */
  12698. message: string;
  12699. /**
  12700. * if the current module is in strict esm mode
  12701. */
  12702. strict?: boolean;
  12703. /**
  12704. * if the dependency is weak (will create a nice error message)
  12705. */
  12706. weak?: boolean;
  12707. /**
  12708. * if set, will be filled with runtime requirements
  12709. */
  12710. runtimeRequirements: Set<string>;
  12711. }): string;
  12712. runtimeConditionExpression(__0: {
  12713. /**
  12714. * the chunk graph
  12715. */
  12716. chunkGraph: ChunkGraph;
  12717. /**
  12718. * runtime for which this code will be generated
  12719. */
  12720. runtime?: RuntimeSpec;
  12721. /**
  12722. * only execute the statement in some runtimes
  12723. */
  12724. runtimeCondition?: string | boolean | SortableSet<string>;
  12725. /**
  12726. * if set, will be filled with runtime requirements
  12727. */
  12728. runtimeRequirements: Set<string>;
  12729. }): string;
  12730. importStatement(__0: {
  12731. /**
  12732. * whether a new variable should be created or the existing one updated
  12733. */
  12734. update?: boolean;
  12735. /**
  12736. * the module
  12737. */
  12738. module: Module;
  12739. /**
  12740. * the chunk graph
  12741. */
  12742. chunkGraph: ChunkGraph;
  12743. /**
  12744. * the request that should be printed as comment
  12745. */
  12746. request: string;
  12747. /**
  12748. * name of the import variable
  12749. */
  12750. importVar: string;
  12751. /**
  12752. * module in which the statement is emitted
  12753. */
  12754. originModule: Module;
  12755. /**
  12756. * true, if this is a weak dependency
  12757. */
  12758. weak?: boolean;
  12759. /**
  12760. * if set, will be filled with runtime requirements
  12761. */
  12762. runtimeRequirements: Set<string>;
  12763. }): [string, string];
  12764. exportFromImport(__0: {
  12765. /**
  12766. * the module graph
  12767. */
  12768. moduleGraph: ModuleGraph;
  12769. /**
  12770. * the module
  12771. */
  12772. module: Module;
  12773. /**
  12774. * the request
  12775. */
  12776. request: string;
  12777. /**
  12778. * the export name
  12779. */
  12780. exportName: string | string[];
  12781. /**
  12782. * the origin module
  12783. */
  12784. originModule: Module;
  12785. /**
  12786. * true, if location is safe for ASI, a bracket can be emitted
  12787. */
  12788. asiSafe?: boolean;
  12789. /**
  12790. * true, if expression will be called
  12791. */
  12792. isCall: boolean;
  12793. /**
  12794. * when false, call context will not be preserved
  12795. */
  12796. callContext: null | boolean;
  12797. /**
  12798. * when true and accessing the default exports, interop code will be generated
  12799. */
  12800. defaultInterop: boolean;
  12801. /**
  12802. * the identifier name of the import variable
  12803. */
  12804. importVar: string;
  12805. /**
  12806. * init fragments will be added here
  12807. */
  12808. initFragments: InitFragment<any>[];
  12809. /**
  12810. * runtime for which this code will be generated
  12811. */
  12812. runtime: RuntimeSpec;
  12813. /**
  12814. * if set, will be filled with runtime requirements
  12815. */
  12816. runtimeRequirements: Set<string>;
  12817. }): string;
  12818. blockPromise(__0: {
  12819. /**
  12820. * the async block
  12821. */
  12822. block?: AsyncDependenciesBlock;
  12823. /**
  12824. * the message
  12825. */
  12826. message: string;
  12827. /**
  12828. * the chunk graph
  12829. */
  12830. chunkGraph: ChunkGraph;
  12831. /**
  12832. * if set, will be filled with runtime requirements
  12833. */
  12834. runtimeRequirements: Set<string>;
  12835. }): string;
  12836. asyncModuleFactory(__0: {
  12837. /**
  12838. * the async block
  12839. */
  12840. block: AsyncDependenciesBlock;
  12841. /**
  12842. * the chunk graph
  12843. */
  12844. chunkGraph: ChunkGraph;
  12845. /**
  12846. * if set, will be filled with runtime requirements
  12847. */
  12848. runtimeRequirements: Set<string>;
  12849. /**
  12850. * request string used originally
  12851. */
  12852. request?: string;
  12853. }): string;
  12854. syncModuleFactory(__0: {
  12855. /**
  12856. * the dependency
  12857. */
  12858. dependency: Dependency;
  12859. /**
  12860. * the chunk graph
  12861. */
  12862. chunkGraph: ChunkGraph;
  12863. /**
  12864. * if set, will be filled with runtime requirements
  12865. */
  12866. runtimeRequirements: Set<string>;
  12867. /**
  12868. * request string used originally
  12869. */
  12870. request?: string;
  12871. }): string;
  12872. defineEsModuleFlagStatement(__0: {
  12873. /**
  12874. * the name of the exports object
  12875. */
  12876. exportsArgument: string;
  12877. /**
  12878. * if set, will be filled with runtime requirements
  12879. */
  12880. runtimeRequirements: Set<string>;
  12881. }): string;
  12882. }
  12883. declare abstract class RuntimeValue {
  12884. fn: (arg0: {
  12885. module: NormalModule;
  12886. key: string;
  12887. readonly version: ValueCacheVersion;
  12888. }) => CodeValuePrimitive;
  12889. options: true | RuntimeValueOptions;
  12890. get fileDependencies(): true | string[];
  12891. exec(
  12892. parser: JavascriptParser,
  12893. valueCacheVersions: Map<string, string | Set<string>>,
  12894. key: string
  12895. ): CodeValuePrimitive;
  12896. getCacheVersion(): undefined | string;
  12897. }
  12898. declare interface RuntimeValueOptions {
  12899. fileDependencies?: string[];
  12900. contextDependencies?: string[];
  12901. missingDependencies?: string[];
  12902. buildDependencies?: string[];
  12903. version?: string | (() => string);
  12904. }
  12905. /**
  12906. * Helper function for joining two ranges into a single range. This is useful
  12907. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  12908. * to create the range of the _parent node_.
  12909. */
  12910. declare interface ScopeInfo {
  12911. definitions: StackedMap<string, VariableInfo | ScopeInfo>;
  12912. topLevelScope: boolean | "arrow";
  12913. inShorthand: string | boolean;
  12914. inTaggedTemplateTag: boolean;
  12915. inTry: boolean;
  12916. isStrict: boolean;
  12917. isAsmJs: boolean;
  12918. }
  12919. declare interface Selector<A, B> {
  12920. (input: A): undefined | null | B;
  12921. }
  12922. declare abstract class Serializer {
  12923. serializeMiddlewares: SerializerMiddleware<any, any>[];
  12924. deserializeMiddlewares: SerializerMiddleware<any, any>[];
  12925. context: any;
  12926. serialize(obj?: any, context?: any): Promise<any>;
  12927. deserialize(value?: any, context?: any): Promise<any>;
  12928. }
  12929. declare abstract class SerializerMiddleware<DeserializedType, SerializedType> {
  12930. serialize(
  12931. data: DeserializedType,
  12932. context: object
  12933. ): SerializedType | Promise<SerializedType>;
  12934. deserialize(
  12935. data: SerializedType,
  12936. context: object
  12937. ): DeserializedType | Promise<DeserializedType>;
  12938. }
  12939. type ServerOptionsHttps<
  12940. Request extends typeof IncomingMessage = typeof IncomingMessage,
  12941. Response extends typeof ServerResponse = typeof ServerResponse
  12942. > = SecureContextOptions & TlsOptions & ServerOptionsImport<Request, Response>;
  12943. declare class SharePlugin {
  12944. constructor(options: SharePluginOptions);
  12945. /**
  12946. * Apply the plugin
  12947. */
  12948. apply(compiler: Compiler): void;
  12949. }
  12950. /**
  12951. * Options for shared modules.
  12952. */
  12953. declare interface SharePluginOptions {
  12954. /**
  12955. * Share scope name used for all shared modules (defaults to 'default').
  12956. */
  12957. shareScope?: string;
  12958. /**
  12959. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  12960. */
  12961. shared: Shared;
  12962. }
  12963. type Shared = (string | SharedObject)[] | SharedObject;
  12964. /**
  12965. * Advanced configuration for modules that should be shared in the share scope.
  12966. */
  12967. declare interface SharedConfig {
  12968. /**
  12969. * 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.
  12970. */
  12971. eager?: boolean;
  12972. /**
  12973. * 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.
  12974. */
  12975. import?: string | false;
  12976. /**
  12977. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  12978. */
  12979. packageName?: string;
  12980. /**
  12981. * Version requirement from module in share scope.
  12982. */
  12983. requiredVersion?: string | false;
  12984. /**
  12985. * Module is looked up under this key from the share scope.
  12986. */
  12987. shareKey?: string;
  12988. /**
  12989. * Share scope name.
  12990. */
  12991. shareScope?: string;
  12992. /**
  12993. * Allow only a single version of the shared module in share scope (disabled by default).
  12994. */
  12995. singleton?: boolean;
  12996. /**
  12997. * 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).
  12998. */
  12999. strictVersion?: boolean;
  13000. /**
  13001. * Version of the provided module. Will replace lower matching versions, but not higher.
  13002. */
  13003. version?: string | false;
  13004. }
  13005. /**
  13006. * 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.
  13007. */
  13008. declare interface SharedObject {
  13009. [index: string]: string | SharedConfig;
  13010. }
  13011. declare class SideEffectsFlagPlugin {
  13012. constructor(analyseSource?: boolean);
  13013. /**
  13014. * Apply the plugin
  13015. */
  13016. apply(compiler: Compiler): void;
  13017. static moduleHasSideEffects(
  13018. moduleName: string,
  13019. flagValue: undefined | string | boolean | string[],
  13020. cache: Map<string, RegExp>
  13021. ): undefined | boolean;
  13022. }
  13023. type SimpleType = "string" | "number" | "boolean";
  13024. declare class SizeOnlySource extends Source {
  13025. constructor(size: number);
  13026. }
  13027. declare abstract class Snapshot {
  13028. startTime?: number;
  13029. fileTimestamps?: Map<string, null | FileSystemInfoEntry>;
  13030. fileHashes?: Map<string, null | string>;
  13031. fileTshs?: Map<string, null | string | TimestampAndHash>;
  13032. contextTimestamps?: Map<string, null | ResolvedContextFileSystemInfoEntry>;
  13033. contextHashes?: Map<string, null | string>;
  13034. contextTshs?: Map<string, null | ResolvedContextTimestampAndHash>;
  13035. missingExistence?: Map<string, boolean>;
  13036. managedItemInfo?: Map<string, string>;
  13037. managedFiles?: Set<string>;
  13038. managedContexts?: Set<string>;
  13039. managedMissing?: Set<string>;
  13040. children?: Set<Snapshot>;
  13041. hasStartTime(): boolean;
  13042. setStartTime(value: number): void;
  13043. setMergedStartTime(value: undefined | number, snapshot: Snapshot): void;
  13044. hasFileTimestamps(): boolean;
  13045. setFileTimestamps(value: Map<string, null | FileSystemInfoEntry>): void;
  13046. hasFileHashes(): boolean;
  13047. setFileHashes(value: Map<string, null | string>): void;
  13048. hasFileTshs(): boolean;
  13049. setFileTshs(value: Map<string, null | string | TimestampAndHash>): void;
  13050. hasContextTimestamps(): boolean;
  13051. setContextTimestamps(
  13052. value: Map<string, null | ResolvedContextFileSystemInfoEntry>
  13053. ): void;
  13054. hasContextHashes(): boolean;
  13055. setContextHashes(value: Map<string, null | string>): void;
  13056. hasContextTshs(): boolean;
  13057. setContextTshs(
  13058. value: Map<string, null | ResolvedContextTimestampAndHash>
  13059. ): void;
  13060. hasMissingExistence(): boolean;
  13061. setMissingExistence(value: Map<string, boolean>): void;
  13062. hasManagedItemInfo(): boolean;
  13063. setManagedItemInfo(value: Map<string, string>): void;
  13064. hasManagedFiles(): boolean;
  13065. setManagedFiles(value: Set<string>): void;
  13066. hasManagedContexts(): boolean;
  13067. setManagedContexts(value: Set<string>): void;
  13068. hasManagedMissing(): boolean;
  13069. setManagedMissing(value: Set<string>): void;
  13070. hasChildren(): boolean;
  13071. setChildren(value: Set<Snapshot>): void;
  13072. addChild(child: Snapshot): void;
  13073. serialize(__0: ObjectSerializerContext): void;
  13074. deserialize(__0: ObjectDeserializerContext): void;
  13075. getFileIterable(): Iterable<string>;
  13076. getContextIterable(): Iterable<string>;
  13077. getMissingIterable(): Iterable<string>;
  13078. }
  13079. declare interface SnapshotOptionsFileSystemInfo {
  13080. /**
  13081. * should use hash to snapshot
  13082. */
  13083. hash?: boolean;
  13084. /**
  13085. * should use timestamp to snapshot
  13086. */
  13087. timestamp?: boolean;
  13088. }
  13089. /**
  13090. * Options affecting how file system snapshots are created and validated.
  13091. */
  13092. declare interface SnapshotOptionsWebpackOptions {
  13093. /**
  13094. * Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
  13095. */
  13096. buildDependencies?: {
  13097. /**
  13098. * Use hashes of the content of the files/directories to determine invalidation.
  13099. */
  13100. hash?: boolean;
  13101. /**
  13102. * Use timestamps of the files/directories to determine invalidation.
  13103. */
  13104. timestamp?: boolean;
  13105. };
  13106. /**
  13107. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  13108. */
  13109. immutablePaths?: (string | RegExp)[];
  13110. /**
  13111. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  13112. */
  13113. managedPaths?: (string | RegExp)[];
  13114. /**
  13115. * Options for snapshotting dependencies of modules to determine if they need to be built again.
  13116. */
  13117. module?: {
  13118. /**
  13119. * Use hashes of the content of the files/directories to determine invalidation.
  13120. */
  13121. hash?: boolean;
  13122. /**
  13123. * Use timestamps of the files/directories to determine invalidation.
  13124. */
  13125. timestamp?: boolean;
  13126. };
  13127. /**
  13128. * Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.
  13129. */
  13130. resolve?: {
  13131. /**
  13132. * Use hashes of the content of the files/directories to determine invalidation.
  13133. */
  13134. hash?: boolean;
  13135. /**
  13136. * Use timestamps of the files/directories to determine invalidation.
  13137. */
  13138. timestamp?: boolean;
  13139. };
  13140. /**
  13141. * Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.
  13142. */
  13143. resolveBuildDependencies?: {
  13144. /**
  13145. * Use hashes of the content of the files/directories to determine invalidation.
  13146. */
  13147. hash?: boolean;
  13148. /**
  13149. * Use timestamps of the files/directories to determine invalidation.
  13150. */
  13151. timestamp?: boolean;
  13152. };
  13153. /**
  13154. * List of paths that are not managed by a package manager and the contents are subject to change.
  13155. */
  13156. unmanagedPaths?: (string | RegExp)[];
  13157. }
  13158. declare interface SortFunction<T> {
  13159. (arg0: T, arg1: T): number;
  13160. }
  13161. declare abstract class SortableSet<T> extends Set<T> {
  13162. /**
  13163. * Sort with a comparer function
  13164. */
  13165. sortWith(sortFn?: SortFunction<T>): void;
  13166. sort(): SortableSet<T>;
  13167. /**
  13168. * Get data from cache
  13169. */
  13170. getFromCache<R>(fn: (arg0: SortableSet<T>) => R): R;
  13171. /**
  13172. * Get data from cache (ignoring sorting)
  13173. */
  13174. getFromUnorderedCache<R>(fn: (arg0: SortableSet<T>) => R): R;
  13175. toJSON(): T[];
  13176. }
  13177. declare class Source {
  13178. constructor();
  13179. size(): number;
  13180. map(options?: MapOptions): null | RawSourceMap;
  13181. sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
  13182. updateHash(hash: Hash): void;
  13183. source(): string | Buffer;
  13184. buffer(): Buffer;
  13185. }
  13186. declare interface SourceLike {
  13187. source(): string | Buffer;
  13188. }
  13189. declare interface SourceMap {
  13190. version: number;
  13191. sources: string[];
  13192. mappings: string;
  13193. file?: string;
  13194. sourceRoot?: string;
  13195. sourcesContent?: string[];
  13196. names?: string[];
  13197. debugId?: string;
  13198. }
  13199. declare class SourceMapDevToolPlugin {
  13200. constructor(options?: SourceMapDevToolPluginOptions);
  13201. sourceMapFilename: string | false;
  13202. sourceMappingURLComment:
  13203. | string
  13204. | false
  13205. | ((arg0: PathData, arg1?: AssetInfo) => string);
  13206. moduleFilenameTemplate: string | Function;
  13207. fallbackModuleFilenameTemplate: string | Function;
  13208. namespace: string;
  13209. options: SourceMapDevToolPluginOptions;
  13210. /**
  13211. * Apply the plugin
  13212. */
  13213. apply(compiler: Compiler): void;
  13214. }
  13215. declare interface SourceMapDevToolPluginOptions {
  13216. /**
  13217. * 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.
  13218. */
  13219. append?:
  13220. | null
  13221. | string
  13222. | false
  13223. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  13224. /**
  13225. * Indicates whether column mappings should be used (defaults to true).
  13226. */
  13227. columns?: boolean;
  13228. /**
  13229. * Emit debug IDs into source and SourceMap.
  13230. */
  13231. debugIds?: boolean;
  13232. /**
  13233. * Exclude modules that match the given value from source map generation.
  13234. */
  13235. exclude?: string | RegExp | Rule[];
  13236. /**
  13237. * 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.
  13238. */
  13239. fallbackModuleFilenameTemplate?: string | Function;
  13240. /**
  13241. * Path prefix to which the [file] placeholder is relative to.
  13242. */
  13243. fileContext?: string;
  13244. /**
  13245. * Defines the output filename of the SourceMap (will be inlined if no value is provided).
  13246. */
  13247. filename?: null | string | false;
  13248. /**
  13249. * Include source maps for module paths that match the given value.
  13250. */
  13251. include?: string | RegExp | Rule[];
  13252. /**
  13253. * Indicates whether SourceMaps from loaders should be used (defaults to true).
  13254. */
  13255. module?: boolean;
  13256. /**
  13257. * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
  13258. */
  13259. moduleFilenameTemplate?: string | Function;
  13260. /**
  13261. * Namespace prefix to allow multiple webpack roots in the devtools.
  13262. */
  13263. namespace?: string;
  13264. /**
  13265. * Omit the 'sourceContents' array from the SourceMap.
  13266. */
  13267. noSources?: boolean;
  13268. /**
  13269. * Provide a custom public path for the SourceMapping comment.
  13270. */
  13271. publicPath?: string;
  13272. /**
  13273. * Provide a custom value for the 'sourceRoot' property in the SourceMap.
  13274. */
  13275. sourceRoot?: string;
  13276. /**
  13277. * Include source maps for modules based on their extension (defaults to .js and .css).
  13278. */
  13279. test?: string | RegExp | Rule[];
  13280. }
  13281. declare class SourceMapSource extends Source {
  13282. constructor(
  13283. source: string | Buffer,
  13284. name: string,
  13285. sourceMap: string | Object | Buffer,
  13286. originalSource?: string | Buffer,
  13287. innerSourceMap?: string | Object | Buffer,
  13288. removeOriginalSource?: boolean
  13289. );
  13290. getArgsAsBuffers(): [
  13291. Buffer,
  13292. string,
  13293. Buffer,
  13294. undefined | Buffer,
  13295. undefined | Buffer,
  13296. boolean
  13297. ];
  13298. }
  13299. declare interface SourcePosition {
  13300. line: number;
  13301. column?: number;
  13302. }
  13303. declare interface SplitChunksOptions {
  13304. chunksFilter: (chunk: Chunk) => undefined | boolean;
  13305. defaultSizeTypes: string[];
  13306. minSize: SplitChunksSizes;
  13307. minSizeReduction: SplitChunksSizes;
  13308. minRemainingSize: SplitChunksSizes;
  13309. enforceSizeThreshold: SplitChunksSizes;
  13310. maxInitialSize: SplitChunksSizes;
  13311. maxAsyncSize: SplitChunksSizes;
  13312. minChunks: number;
  13313. maxAsyncRequests: number;
  13314. maxInitialRequests: number;
  13315. hidePathInfo: boolean;
  13316. filename: TemplatePath;
  13317. automaticNameDelimiter: string;
  13318. getCacheGroups: (
  13319. module: Module,
  13320. context: CacheGroupsContext
  13321. ) => CacheGroupSource[];
  13322. getName: (
  13323. module?: Module,
  13324. chunks?: Chunk[],
  13325. key?: string
  13326. ) => undefined | string;
  13327. usedExports: boolean;
  13328. fallbackCacheGroup: FallbackCacheGroup;
  13329. }
  13330. declare class SplitChunksPlugin {
  13331. constructor(options?: OptimizationSplitChunksOptions);
  13332. options: SplitChunksOptions;
  13333. /**
  13334. * Apply the plugin
  13335. */
  13336. apply(compiler: Compiler): void;
  13337. }
  13338. declare interface SplitChunksSizes {
  13339. [index: string]: number;
  13340. }
  13341. declare abstract class StackedMap<K, V> {
  13342. map: Map<K, InternalCell<V>>;
  13343. stack: Map<K, InternalCell<V>>[];
  13344. set(item: K, value: V): void;
  13345. delete(item: K): void;
  13346. has(item: K): boolean;
  13347. get(item: K): Cell<V>;
  13348. asArray(): K[];
  13349. asSet(): Set<K>;
  13350. asPairArray(): [K, Cell<V>][];
  13351. asMap(): Map<K, Cell<V>>;
  13352. get size(): number;
  13353. createChild(): StackedMap<K, V>;
  13354. }
  13355. type StartupRenderContext = RenderContextJavascriptModulesPlugin & {
  13356. inlined: boolean;
  13357. };
  13358. declare interface StatFs {
  13359. (
  13360. path: PathLikeFs,
  13361. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  13362. ): void;
  13363. (
  13364. path: PathLikeFs,
  13365. options: undefined | (StatOptions & { bigint?: false }),
  13366. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  13367. ): void;
  13368. (
  13369. path: PathLikeFs,
  13370. options: StatOptions & { bigint: true },
  13371. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  13372. ): void;
  13373. (
  13374. path: PathLikeFs,
  13375. options: undefined | StatOptions,
  13376. callback: (
  13377. arg0: null | NodeJS.ErrnoException,
  13378. arg1?: IStats | IBigIntStats
  13379. ) => void
  13380. ): void;
  13381. }
  13382. declare interface StatOptions {
  13383. bigint?: boolean;
  13384. }
  13385. declare interface StatSync {
  13386. (path: PathLikeFs, options?: undefined): IStats;
  13387. (
  13388. path: PathLikeFs,
  13389. options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
  13390. ): undefined | IStats;
  13391. (
  13392. path: PathLikeFs,
  13393. options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
  13394. ): undefined | IBigIntStats;
  13395. (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
  13396. (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
  13397. (
  13398. path: PathLikeFs,
  13399. options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
  13400. ): IStats | IBigIntStats;
  13401. (
  13402. path: PathLikeFs,
  13403. options?: StatSyncOptions
  13404. ): undefined | IStats | IBigIntStats;
  13405. }
  13406. declare interface StatSyncOptions {
  13407. bigint?: boolean;
  13408. throwIfNoEntry?: boolean;
  13409. }
  13410. declare interface StatTypes {
  13411. (
  13412. path: PathLikeTypes,
  13413. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  13414. ): void;
  13415. (
  13416. path: PathLikeTypes,
  13417. options: undefined | (StatOptions & { bigint?: false }),
  13418. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  13419. ): void;
  13420. (
  13421. path: PathLikeTypes,
  13422. options: StatOptions & { bigint: true },
  13423. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  13424. ): void;
  13425. (
  13426. path: PathLikeTypes,
  13427. options: undefined | StatOptions,
  13428. callback: (
  13429. arg0: null | NodeJS.ErrnoException,
  13430. arg1?: IStats | IBigIntStats
  13431. ) => void
  13432. ): void;
  13433. }
  13434. type Statement =
  13435. | FunctionDeclaration
  13436. | VariableDeclaration
  13437. | ClassDeclaration
  13438. | ExpressionStatement
  13439. | BlockStatement
  13440. | StaticBlock
  13441. | EmptyStatement
  13442. | DebuggerStatement
  13443. | WithStatement
  13444. | ReturnStatement
  13445. | LabeledStatement
  13446. | BreakStatement
  13447. | ContinueStatement
  13448. | IfStatement
  13449. | SwitchStatement
  13450. | ThrowStatement
  13451. | TryStatement
  13452. | WhileStatement
  13453. | DoWhileStatement
  13454. | ForStatement
  13455. | ForInStatement
  13456. | ForOfStatement;
  13457. type StatementPathItem =
  13458. | ImportDeclarationJavascriptParser
  13459. | ExportNamedDeclarationJavascriptParser
  13460. | ExportAllDeclarationJavascriptParser
  13461. | ImportExpressionImport
  13462. | UnaryExpression
  13463. | ArrayExpression
  13464. | ArrowFunctionExpression
  13465. | AssignmentExpression
  13466. | AwaitExpression
  13467. | BinaryExpression
  13468. | SimpleCallExpression
  13469. | NewExpression
  13470. | ChainExpression
  13471. | ClassExpression
  13472. | ConditionalExpression
  13473. | FunctionExpression
  13474. | Identifier
  13475. | SimpleLiteral
  13476. | RegExpLiteral
  13477. | BigIntLiteral
  13478. | LogicalExpression
  13479. | MemberExpression
  13480. | MetaProperty
  13481. | ObjectExpression
  13482. | SequenceExpression
  13483. | TaggedTemplateExpression
  13484. | TemplateLiteral
  13485. | ThisExpression
  13486. | UpdateExpression
  13487. | YieldExpression
  13488. | FunctionDeclaration
  13489. | VariableDeclaration
  13490. | ClassDeclaration
  13491. | ExpressionStatement
  13492. | BlockStatement
  13493. | StaticBlock
  13494. | EmptyStatement
  13495. | DebuggerStatement
  13496. | WithStatement
  13497. | ReturnStatement
  13498. | LabeledStatement
  13499. | BreakStatement
  13500. | ContinueStatement
  13501. | IfStatement
  13502. | SwitchStatement
  13503. | ThrowStatement
  13504. | TryStatement
  13505. | WhileStatement
  13506. | DoWhileStatement
  13507. | ForStatement
  13508. | ForInStatement
  13509. | ForOfStatement
  13510. | ExportDefaultDeclaration;
  13511. declare class Stats {
  13512. constructor(compilation: Compilation);
  13513. compilation: Compilation;
  13514. get hash(): string;
  13515. get startTime(): number;
  13516. get endTime(): number;
  13517. hasWarnings(): boolean;
  13518. hasErrors(): boolean;
  13519. toJson(options?: string | boolean | StatsOptions): StatsCompilation;
  13520. toString(options?: string | boolean | StatsOptions): string;
  13521. }
  13522. type StatsAsset = Record<string, any> & KnownStatsAsset;
  13523. type StatsChunk = Record<string, any> & KnownStatsChunk;
  13524. type StatsChunkGroup = Record<string, any> & KnownStatsChunkGroup;
  13525. type StatsChunkOrigin = Record<string, any> & KnownStatsChunkOrigin;
  13526. type StatsCompilation = Record<string, any> & KnownStatsCompilation;
  13527. type StatsError = Record<string, any> & KnownStatsError;
  13528. declare abstract class StatsFactory {
  13529. hooks: StatsFactoryHooks;
  13530. create(
  13531. type: string,
  13532. data: any,
  13533. baseContext: Omit<StatsFactoryContext, "type">
  13534. ): any;
  13535. }
  13536. type StatsFactoryContext = Record<string, any> & KnownStatsFactoryContext;
  13537. declare interface StatsFactoryHooks {
  13538. extract: HookMap<
  13539. SyncBailHook<[ObjectForExtract, any, StatsFactoryContext], void>
  13540. >;
  13541. filter: HookMap<
  13542. SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
  13543. >;
  13544. sort: HookMap<
  13545. SyncBailHook<
  13546. [((arg0?: any, arg1?: any) => 0 | 1 | -1)[], StatsFactoryContext],
  13547. void
  13548. >
  13549. >;
  13550. filterSorted: HookMap<
  13551. SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
  13552. >;
  13553. groupResults: HookMap<
  13554. SyncBailHook<[GroupConfig[], StatsFactoryContext], void>
  13555. >;
  13556. sortResults: HookMap<
  13557. SyncBailHook<
  13558. [((arg0?: any, arg1?: any) => 0 | 1 | -1)[], StatsFactoryContext],
  13559. void
  13560. >
  13561. >;
  13562. filterResults: HookMap<
  13563. SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
  13564. >;
  13565. merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  13566. result: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  13567. getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], string | void>>;
  13568. getItemFactory: HookMap<
  13569. SyncBailHook<[any, StatsFactoryContext], void | StatsFactory>
  13570. >;
  13571. }
  13572. type StatsLogging = Record<string, any> & KnownStatsLogging;
  13573. type StatsLoggingEntry = Record<string, any> & KnownStatsLoggingEntry;
  13574. type StatsModule = Record<string, any> & KnownStatsModule;
  13575. type StatsModuleIssuer = Record<string, any> & KnownStatsModuleIssuer;
  13576. type StatsModuleReason = Record<string, any> & KnownStatsModuleReason;
  13577. type StatsModuleTraceDependency = Record<string, any> &
  13578. KnownStatsModuleTraceDependency;
  13579. type StatsModuleTraceItem = Record<string, any> & KnownStatsModuleTraceItem;
  13580. /**
  13581. * Stats options object.
  13582. */
  13583. declare interface StatsOptions {
  13584. /**
  13585. * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).
  13586. */
  13587. all?: boolean;
  13588. /**
  13589. * Add assets information.
  13590. */
  13591. assets?: boolean;
  13592. /**
  13593. * Sort the assets by that field.
  13594. */
  13595. assetsSort?: string;
  13596. /**
  13597. * Space to display assets (groups will be collapsed to fit this space).
  13598. */
  13599. assetsSpace?: number;
  13600. /**
  13601. * Add built at time information.
  13602. */
  13603. builtAt?: boolean;
  13604. /**
  13605. * Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).
  13606. */
  13607. cached?: boolean;
  13608. /**
  13609. * Show cached assets (setting this to `false` only shows emitted files).
  13610. */
  13611. cachedAssets?: boolean;
  13612. /**
  13613. * Add information about cached (not built) modules.
  13614. */
  13615. cachedModules?: boolean;
  13616. /**
  13617. * Add children information.
  13618. */
  13619. children?: boolean;
  13620. /**
  13621. * Display auxiliary assets in chunk groups.
  13622. */
  13623. chunkGroupAuxiliary?: boolean;
  13624. /**
  13625. * Display children of chunk groups.
  13626. */
  13627. chunkGroupChildren?: boolean;
  13628. /**
  13629. * Limit of assets displayed in chunk groups.
  13630. */
  13631. chunkGroupMaxAssets?: number;
  13632. /**
  13633. * Display all chunk groups with the corresponding bundles.
  13634. */
  13635. chunkGroups?: boolean;
  13636. /**
  13637. * Add built modules information to chunk information.
  13638. */
  13639. chunkModules?: boolean;
  13640. /**
  13641. * Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
  13642. */
  13643. chunkModulesSpace?: number;
  13644. /**
  13645. * Add the origins of chunks and chunk merging info.
  13646. */
  13647. chunkOrigins?: boolean;
  13648. /**
  13649. * Add information about parent, children and sibling chunks to chunk information.
  13650. */
  13651. chunkRelations?: boolean;
  13652. /**
  13653. * Add chunk information.
  13654. */
  13655. chunks?: boolean;
  13656. /**
  13657. * Sort the chunks by that field.
  13658. */
  13659. chunksSort?: string;
  13660. /**
  13661. * Enables/Disables colorful output.
  13662. */
  13663. colors?:
  13664. | boolean
  13665. | {
  13666. /**
  13667. * Custom color for bold text.
  13668. */
  13669. bold?: string;
  13670. /**
  13671. * Custom color for cyan text.
  13672. */
  13673. cyan?: string;
  13674. /**
  13675. * Custom color for green text.
  13676. */
  13677. green?: string;
  13678. /**
  13679. * Custom color for magenta text.
  13680. */
  13681. magenta?: string;
  13682. /**
  13683. * Custom color for red text.
  13684. */
  13685. red?: string;
  13686. /**
  13687. * Custom color for yellow text.
  13688. */
  13689. yellow?: string;
  13690. };
  13691. /**
  13692. * Context directory for request shortening.
  13693. */
  13694. context?: string;
  13695. /**
  13696. * Show chunk modules that are dependencies of other modules of the chunk.
  13697. */
  13698. dependentModules?: boolean;
  13699. /**
  13700. * Add module depth in module graph.
  13701. */
  13702. depth?: boolean;
  13703. /**
  13704. * Display the entry points with the corresponding bundles.
  13705. */
  13706. entrypoints?: boolean | "auto";
  13707. /**
  13708. * Add --env information.
  13709. */
  13710. env?: boolean;
  13711. /**
  13712. * Add details to errors (like resolving log).
  13713. */
  13714. errorDetails?: boolean | "auto";
  13715. /**
  13716. * Add internal stack trace to errors.
  13717. */
  13718. errorStack?: boolean;
  13719. /**
  13720. * Add errors.
  13721. */
  13722. errors?: boolean;
  13723. /**
  13724. * Add errors count.
  13725. */
  13726. errorsCount?: boolean;
  13727. /**
  13728. * Space to display errors (value is in number of lines).
  13729. */
  13730. errorsSpace?: number;
  13731. /**
  13732. * Please use excludeModules instead.
  13733. */
  13734. exclude?:
  13735. | string
  13736. | boolean
  13737. | RegExp
  13738. | ModuleFilterItemTypes[]
  13739. | ((
  13740. name: string,
  13741. module: StatsModule,
  13742. type: "module" | "chunk" | "root-of-chunk" | "nested"
  13743. ) => boolean);
  13744. /**
  13745. * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
  13746. */
  13747. excludeAssets?:
  13748. | string
  13749. | RegExp
  13750. | AssetFilterItemTypes[]
  13751. | ((name: string, asset: StatsAsset) => boolean);
  13752. /**
  13753. * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
  13754. */
  13755. excludeModules?:
  13756. | string
  13757. | boolean
  13758. | RegExp
  13759. | ModuleFilterItemTypes[]
  13760. | ((
  13761. name: string,
  13762. module: StatsModule,
  13763. type: "module" | "chunk" | "root-of-chunk" | "nested"
  13764. ) => boolean);
  13765. /**
  13766. * Group assets by how their are related to chunks.
  13767. */
  13768. groupAssetsByChunk?: boolean;
  13769. /**
  13770. * Group assets by their status (emitted, compared for emit or cached).
  13771. */
  13772. groupAssetsByEmitStatus?: boolean;
  13773. /**
  13774. * Group assets by their extension.
  13775. */
  13776. groupAssetsByExtension?: boolean;
  13777. /**
  13778. * Group assets by their asset info (immutable, development, hotModuleReplacement, etc).
  13779. */
  13780. groupAssetsByInfo?: boolean;
  13781. /**
  13782. * Group assets by their path.
  13783. */
  13784. groupAssetsByPath?: boolean;
  13785. /**
  13786. * Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).
  13787. */
  13788. groupModulesByAttributes?: boolean;
  13789. /**
  13790. * Group modules by their status (cached or built and cacheable).
  13791. */
  13792. groupModulesByCacheStatus?: boolean;
  13793. /**
  13794. * Group modules by their extension.
  13795. */
  13796. groupModulesByExtension?: boolean;
  13797. /**
  13798. * Group modules by their layer.
  13799. */
  13800. groupModulesByLayer?: boolean;
  13801. /**
  13802. * Group modules by their path.
  13803. */
  13804. groupModulesByPath?: boolean;
  13805. /**
  13806. * Group modules by their type.
  13807. */
  13808. groupModulesByType?: boolean;
  13809. /**
  13810. * Group reasons by their origin module.
  13811. */
  13812. groupReasonsByOrigin?: boolean;
  13813. /**
  13814. * Add the hash of the compilation.
  13815. */
  13816. hash?: boolean;
  13817. /**
  13818. * Add ids.
  13819. */
  13820. ids?: boolean;
  13821. /**
  13822. * Add logging output.
  13823. */
  13824. logging?: boolean | "none" | "error" | "warn" | "info" | "log" | "verbose";
  13825. /**
  13826. * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
  13827. */
  13828. loggingDebug?:
  13829. | string
  13830. | boolean
  13831. | RegExp
  13832. | FilterItemTypes[]
  13833. | ((value: string) => boolean);
  13834. /**
  13835. * Add stack traces to logging output.
  13836. */
  13837. loggingTrace?: boolean;
  13838. /**
  13839. * Add information about assets inside modules.
  13840. */
  13841. moduleAssets?: boolean;
  13842. /**
  13843. * Add dependencies and origin of warnings/errors.
  13844. */
  13845. moduleTrace?: boolean;
  13846. /**
  13847. * Add built modules information.
  13848. */
  13849. modules?: boolean;
  13850. /**
  13851. * Sort the modules by that field.
  13852. */
  13853. modulesSort?: string;
  13854. /**
  13855. * Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).
  13856. */
  13857. modulesSpace?: number;
  13858. /**
  13859. * Add information about modules nested in other modules (like with module concatenation).
  13860. */
  13861. nestedModules?: boolean;
  13862. /**
  13863. * Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).
  13864. */
  13865. nestedModulesSpace?: number;
  13866. /**
  13867. * Show reasons why optimization bailed out for modules.
  13868. */
  13869. optimizationBailout?: boolean;
  13870. /**
  13871. * Add information about orphan modules.
  13872. */
  13873. orphanModules?: boolean;
  13874. /**
  13875. * Add output path information.
  13876. */
  13877. outputPath?: boolean;
  13878. /**
  13879. * Add performance hint flags.
  13880. */
  13881. performance?: boolean;
  13882. /**
  13883. * Preset for the default values.
  13884. */
  13885. preset?: string | boolean;
  13886. /**
  13887. * Show exports provided by modules.
  13888. */
  13889. providedExports?: boolean;
  13890. /**
  13891. * Add public path information.
  13892. */
  13893. publicPath?: boolean;
  13894. /**
  13895. * Add information about the reasons why modules are included.
  13896. */
  13897. reasons?: boolean;
  13898. /**
  13899. * Space to display reasons (groups will be collapsed to fit this space).
  13900. */
  13901. reasonsSpace?: number;
  13902. /**
  13903. * Add information about assets that are related to other assets (like SourceMaps for assets).
  13904. */
  13905. relatedAssets?: boolean;
  13906. /**
  13907. * Add information about runtime modules (deprecated: use 'runtimeModules' instead).
  13908. */
  13909. runtime?: boolean;
  13910. /**
  13911. * Add information about runtime modules.
  13912. */
  13913. runtimeModules?: boolean;
  13914. /**
  13915. * Add the source code of modules.
  13916. */
  13917. source?: boolean;
  13918. /**
  13919. * Add timing information.
  13920. */
  13921. timings?: boolean;
  13922. /**
  13923. * Show exports used by modules.
  13924. */
  13925. usedExports?: boolean;
  13926. /**
  13927. * Add webpack version information.
  13928. */
  13929. version?: boolean;
  13930. /**
  13931. * Add warnings.
  13932. */
  13933. warnings?: boolean;
  13934. /**
  13935. * Add warnings count.
  13936. */
  13937. warningsCount?: boolean;
  13938. /**
  13939. * Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
  13940. */
  13941. warningsFilter?:
  13942. | string
  13943. | RegExp
  13944. | WarningFilterItemTypes[]
  13945. | ((warning: StatsError, value: string) => boolean);
  13946. /**
  13947. * Space to display warnings (value is in number of lines).
  13948. */
  13949. warningsSpace?: number;
  13950. }
  13951. declare interface StatsPrintHooks {
  13952. sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], void>>;
  13953. printElements: HookMap<
  13954. SyncBailHook<[PrintedElement[], StatsPrinterContext], string | void>
  13955. >;
  13956. sortItems: HookMap<
  13957. SyncBailHook<[any[], StatsPrinterContext], boolean | void>
  13958. >;
  13959. getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string | void>>;
  13960. printItems: HookMap<
  13961. SyncBailHook<[string[], StatsPrinterContext], string | void>
  13962. >;
  13963. print: HookMap<SyncBailHook<[any, StatsPrinterContext], string | void>>;
  13964. result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
  13965. }
  13966. declare abstract class StatsPrinter {
  13967. hooks: StatsPrintHooks;
  13968. print(type: string, object?: any, baseContext?: StatsPrinterContext): string;
  13969. }
  13970. type StatsPrinterContext = Record<string, any> &
  13971. KnownStatsPrinterColorFn &
  13972. KnownStatsPrinterFormaters &
  13973. KnownStatsPrinterContext;
  13974. type StatsProfile = Record<string, any> & KnownStatsProfile;
  13975. type StatsValue =
  13976. | boolean
  13977. | StatsOptions
  13978. | "none"
  13979. | "verbose"
  13980. | "summary"
  13981. | "errors-only"
  13982. | "errors-warnings"
  13983. | "minimal"
  13984. | "normal"
  13985. | "detailed";
  13986. type Supports = undefined | string;
  13987. declare class SyncModuleIdsPlugin {
  13988. constructor(__0: {
  13989. /**
  13990. * path to file
  13991. */
  13992. path: string;
  13993. /**
  13994. * context for module names
  13995. */
  13996. context?: string;
  13997. /**
  13998. * selector for modules
  13999. */
  14000. test: (arg0: Module) => boolean;
  14001. /**
  14002. * operation mode (defaults to merge)
  14003. */
  14004. mode?: "read" | "create" | "merge" | "update";
  14005. });
  14006. /**
  14007. * Apply the plugin
  14008. */
  14009. apply(compiler: Compiler): void;
  14010. }
  14011. declare interface SyntheticDependencyLocation {
  14012. name: string;
  14013. index?: number;
  14014. }
  14015. declare const TOMBSTONE: unique symbol;
  14016. declare const TRANSITIVE: unique symbol;
  14017. declare const TRANSITIVE_ONLY: unique symbol;
  14018. /**
  14019. * Helper function for joining two ranges into a single range. This is useful
  14020. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  14021. * to create the range of the _parent node_.
  14022. */
  14023. declare interface TagInfo {
  14024. tag: any;
  14025. data: any;
  14026. next?: TagInfo;
  14027. }
  14028. declare interface TargetItem {
  14029. module: Module;
  14030. connection: ModuleGraphConnection;
  14031. export?: string[];
  14032. }
  14033. declare interface TargetItemWithoutConnection {
  14034. module: Module;
  14035. export: string[];
  14036. }
  14037. declare class Template {
  14038. constructor();
  14039. static getFunctionContent(fn: Function): string;
  14040. static toIdentifier(str: string): string;
  14041. static toComment(str: string): string;
  14042. static toNormalComment(str: string): string;
  14043. static toPath(str: string): string;
  14044. static numberToIdentifier(n: number): string;
  14045. static numberToIdentifierContinuation(n: number): string;
  14046. static indent(s: string | string[]): string;
  14047. static prefix(s: string | string[], prefix: string): string;
  14048. static asString(str: string | string[]): string;
  14049. static getModulesArrayBounds(modules: WithId[]): false | [number, number];
  14050. static renderChunkModules(
  14051. renderContext: ChunkRenderContextJavascriptModulesPlugin,
  14052. modules: Module[],
  14053. renderModule: (arg0: Module) => null | Source,
  14054. prefix?: string
  14055. ): null | Source;
  14056. static renderRuntimeModules(
  14057. runtimeModules: RuntimeModule[],
  14058. renderContext: RenderContextJavascriptModulesPlugin & {
  14059. codeGenerationResults?: CodeGenerationResults;
  14060. }
  14061. ): Source;
  14062. static renderChunkRuntimeModules(
  14063. runtimeModules: RuntimeModule[],
  14064. renderContext: RenderContextJavascriptModulesPlugin
  14065. ): Source;
  14066. static NUMBER_OF_IDENTIFIER_START_CHARS: number;
  14067. static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
  14068. }
  14069. type TemplatePath = string | ((arg0: PathData, arg1?: AssetInfo) => string);
  14070. declare interface TimestampAndHash {
  14071. safeTime: number;
  14072. timestamp?: number;
  14073. hash: string;
  14074. }
  14075. declare class TopLevelSymbol {
  14076. constructor(name: string);
  14077. name: string;
  14078. }
  14079. /**
  14080. * Use a Trusted Types policy to create urls for chunks.
  14081. */
  14082. declare interface TrustedTypes {
  14083. /**
  14084. * 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'.
  14085. */
  14086. onPolicyCreationFailure?: "continue" | "stop";
  14087. /**
  14088. * The name of the Trusted Types policy created by webpack to serve bundle chunks.
  14089. */
  14090. policyName?: string;
  14091. }
  14092. declare const UNDEFINED_MARKER: unique symbol;
  14093. /**
  14094. * `URL` class is a global reference for `require('url').URL`
  14095. * https://nodejs.org/api/url.html#the-whatwg-url-api
  14096. */
  14097. declare interface URL_url extends URL {}
  14098. declare interface UnsafeCacheData {
  14099. factoryMeta?: FactoryMeta;
  14100. resolveOptions?: ResolveOptions;
  14101. }
  14102. declare interface UpdateHashContextDependency {
  14103. chunkGraph: ChunkGraph;
  14104. runtime: RuntimeSpec;
  14105. runtimeTemplate?: RuntimeTemplate;
  14106. }
  14107. declare interface UpdateHashContextGenerator {
  14108. /**
  14109. * the module
  14110. */
  14111. module: NormalModule;
  14112. chunkGraph: ChunkGraph;
  14113. runtime: RuntimeSpec;
  14114. runtimeTemplate?: RuntimeTemplate;
  14115. }
  14116. type UsageStateType = 0 | 1 | 2 | 3 | 4;
  14117. type UsedName = string | false | string[];
  14118. type Value = string | number | boolean | RegExp;
  14119. type ValueCacheVersion = string | Set<string>;
  14120. declare class VariableInfo {
  14121. constructor(
  14122. declaredScope: ScopeInfo,
  14123. freeName?: string | true,
  14124. tagInfo?: TagInfo
  14125. );
  14126. declaredScope: ScopeInfo;
  14127. freeName?: string | true;
  14128. tagInfo?: TagInfo;
  14129. }
  14130. declare interface VariableInfoInterface {
  14131. declaredScope: ScopeInfo;
  14132. freeName?: string | true;
  14133. tagInfo?: TagInfo;
  14134. }
  14135. type WarningFilterItemTypes =
  14136. | string
  14137. | RegExp
  14138. | ((warning: StatsError, value: string) => boolean);
  14139. declare interface WatchFileSystem {
  14140. watch: (
  14141. files: Iterable<string>,
  14142. directories: Iterable<string>,
  14143. missing: Iterable<string>,
  14144. startTime: number,
  14145. options: WatchOptions,
  14146. callback: (
  14147. arg0: null | Error,
  14148. arg1?: Map<string, FileSystemInfoEntry | "ignore">,
  14149. arg2?: Map<string, FileSystemInfoEntry | "ignore">,
  14150. arg3?: Set<string>,
  14151. arg4?: Set<string>
  14152. ) => void,
  14153. callbackUndelayed: (arg0: string, arg1: number) => void
  14154. ) => Watcher;
  14155. }
  14156. declare class WatchIgnorePlugin {
  14157. constructor(options: WatchIgnorePluginOptions);
  14158. paths: (string | RegExp)[];
  14159. /**
  14160. * Apply the plugin
  14161. */
  14162. apply(compiler: Compiler): void;
  14163. }
  14164. declare interface WatchIgnorePluginOptions {
  14165. /**
  14166. * A list of RegExps or absolute paths to directories or files that should be ignored.
  14167. */
  14168. paths: (string | RegExp)[];
  14169. }
  14170. /**
  14171. * Options for the watcher.
  14172. */
  14173. declare interface WatchOptions {
  14174. /**
  14175. * Delay the rebuilt after the first change. Value is a time in ms.
  14176. */
  14177. aggregateTimeout?: number;
  14178. /**
  14179. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  14180. */
  14181. followSymlinks?: boolean;
  14182. /**
  14183. * Ignore some files from watching (glob pattern or regexp).
  14184. */
  14185. ignored?: string | RegExp | string[];
  14186. /**
  14187. * Enable polling mode for watching.
  14188. */
  14189. poll?: number | boolean;
  14190. /**
  14191. * Stop watching when stdin stream has ended.
  14192. */
  14193. stdin?: boolean;
  14194. }
  14195. declare interface Watcher {
  14196. /**
  14197. * closes the watcher and all underlying file watchers
  14198. */
  14199. close: () => void;
  14200. /**
  14201. * closes the watcher, but keeps underlying file watchers alive until the next watch call
  14202. */
  14203. pause: () => void;
  14204. /**
  14205. * get current aggregated changes that have not yet send to callback
  14206. */
  14207. getAggregatedChanges?: () => null | Set<string>;
  14208. /**
  14209. * get current aggregated removals that have not yet send to callback
  14210. */
  14211. getAggregatedRemovals?: () => null | Set<string>;
  14212. /**
  14213. * get info about files
  14214. */
  14215. getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  14216. /**
  14217. * get info about directories
  14218. */
  14219. getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  14220. /**
  14221. * get info about timestamps and changes
  14222. */
  14223. getInfo?: () => WatcherInfo;
  14224. }
  14225. declare interface WatcherInfo {
  14226. /**
  14227. * get current aggregated changes that have not yet send to callback
  14228. */
  14229. changes: null | Set<string>;
  14230. /**
  14231. * get current aggregated removals that have not yet send to callback
  14232. */
  14233. removals: null | Set<string>;
  14234. /**
  14235. * get info about files
  14236. */
  14237. fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  14238. /**
  14239. * get info about directories
  14240. */
  14241. contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  14242. }
  14243. declare abstract class Watching {
  14244. startTime: null | number;
  14245. invalid: boolean;
  14246. handler: CallbackFunction_1<Stats>;
  14247. callbacks: CallbackFunction_1<void>[];
  14248. closed: boolean;
  14249. suspended: boolean;
  14250. blocked: boolean;
  14251. watchOptions: WatchOptions;
  14252. compiler: Compiler;
  14253. running: boolean;
  14254. watcher?: null | Watcher;
  14255. pausedWatcher?: null | Watcher;
  14256. lastWatcherStartTime?: number;
  14257. watch(
  14258. files: Iterable<string>,
  14259. dirs: Iterable<string>,
  14260. missing: Iterable<string>
  14261. ): void;
  14262. invalidate(callback?: CallbackFunction_1<void>): void;
  14263. suspend(): void;
  14264. resume(): void;
  14265. close(callback: CallbackFunction_1<void>): void;
  14266. }
  14267. declare abstract class WeakTupleMap<T extends any[], V> {
  14268. set(...args: [T, ...V[]]): void;
  14269. has(...args: T): boolean;
  14270. get(...args: T): undefined | V;
  14271. provide(...args: [T, ...(() => V)[]]): V;
  14272. delete(...args: T): void;
  14273. clear(): void;
  14274. }
  14275. declare interface WebAssemblyRenderContext {
  14276. /**
  14277. * the chunk
  14278. */
  14279. chunk: Chunk;
  14280. /**
  14281. * the dependency templates
  14282. */
  14283. dependencyTemplates: DependencyTemplates;
  14284. /**
  14285. * the runtime template
  14286. */
  14287. runtimeTemplate: RuntimeTemplate;
  14288. /**
  14289. * the module graph
  14290. */
  14291. moduleGraph: ModuleGraph;
  14292. /**
  14293. * the chunk graph
  14294. */
  14295. chunkGraph: ChunkGraph;
  14296. /**
  14297. * results of code generation
  14298. */
  14299. codeGenerationResults: CodeGenerationResults;
  14300. }
  14301. declare class WebWorkerTemplatePlugin {
  14302. constructor();
  14303. /**
  14304. * Apply the plugin
  14305. */
  14306. apply(compiler: Compiler): void;
  14307. }
  14308. declare class WebpackError extends Error {
  14309. /**
  14310. * Creates an instance of WebpackError.
  14311. */
  14312. constructor(message?: string);
  14313. [index: number]: () => string;
  14314. details?: string;
  14315. module?: null | Module;
  14316. loc?: SyntheticDependencyLocation | RealDependencyLocation;
  14317. hideStack?: boolean;
  14318. chunk?: Chunk;
  14319. file?: string;
  14320. serialize(__0: ObjectSerializerContext): void;
  14321. deserialize(__0: ObjectDeserializerContext): void;
  14322. /**
  14323. * Create .stack property on a target object
  14324. */
  14325. static captureStackTrace(
  14326. targetObject: object,
  14327. constructorOpt?: Function
  14328. ): void;
  14329. /**
  14330. * Optional override for formatting stack traces
  14331. */
  14332. static prepareStackTrace?: (
  14333. err: Error,
  14334. stackTraces: NodeJS.CallSite[]
  14335. ) => any;
  14336. static stackTraceLimit: number;
  14337. }
  14338. declare abstract class WebpackLogger {
  14339. getChildLogger: (arg0: string | (() => string)) => WebpackLogger;
  14340. error(...args: any[]): void;
  14341. warn(...args: any[]): void;
  14342. info(...args: any[]): void;
  14343. log(...args: any[]): void;
  14344. debug(...args: any[]): void;
  14345. assert(assertion: any, ...args: any[]): void;
  14346. trace(): void;
  14347. clear(): void;
  14348. status(...args: any[]): void;
  14349. group(...args: any[]): void;
  14350. groupCollapsed(...args: any[]): void;
  14351. groupEnd(): void;
  14352. profile(label?: string): void;
  14353. profileEnd(label?: string): void;
  14354. time(label: string): void;
  14355. timeLog(label?: string): void;
  14356. timeEnd(label?: string): void;
  14357. timeAggregate(label?: string): void;
  14358. timeAggregateEnd(label?: string): void;
  14359. }
  14360. declare class WebpackOptionsApply extends OptionsApply {
  14361. constructor();
  14362. }
  14363. declare class WebpackOptionsDefaulter {
  14364. constructor();
  14365. process(options: Configuration): WebpackOptionsNormalized;
  14366. }
  14367. /**
  14368. * Normalized webpack options object.
  14369. */
  14370. declare interface WebpackOptionsNormalized {
  14371. /**
  14372. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  14373. */
  14374. amd?: false | { [index: string]: any };
  14375. /**
  14376. * Report the first error as a hard error instead of tolerating it.
  14377. */
  14378. bail?: boolean;
  14379. /**
  14380. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  14381. */
  14382. cache: CacheOptionsNormalized;
  14383. /**
  14384. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  14385. */
  14386. context?: string;
  14387. /**
  14388. * References to other configurations to depend on.
  14389. */
  14390. dependencies?: string[];
  14391. /**
  14392. * Options for the webpack-dev-server.
  14393. */
  14394. devServer?: false | { [index: string]: any };
  14395. /**
  14396. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  14397. */
  14398. devtool?: string | false;
  14399. /**
  14400. * The entry point(s) of the compilation.
  14401. */
  14402. entry: EntryNormalized;
  14403. /**
  14404. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  14405. */
  14406. experiments: ExperimentsNormalized;
  14407. /**
  14408. * 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`.
  14409. */
  14410. externals: Externals;
  14411. /**
  14412. * Enable presets of externals for specific targets.
  14413. */
  14414. externalsPresets: ExternalsPresets;
  14415. /**
  14416. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  14417. */
  14418. externalsType?:
  14419. | "import"
  14420. | "var"
  14421. | "module"
  14422. | "assign"
  14423. | "this"
  14424. | "window"
  14425. | "self"
  14426. | "global"
  14427. | "commonjs"
  14428. | "commonjs2"
  14429. | "commonjs-module"
  14430. | "commonjs-static"
  14431. | "amd"
  14432. | "amd-require"
  14433. | "umd"
  14434. | "umd2"
  14435. | "jsonp"
  14436. | "system"
  14437. | "promise"
  14438. | "module-import"
  14439. | "script"
  14440. | "node-commonjs";
  14441. /**
  14442. * Ignore specific warnings.
  14443. */
  14444. ignoreWarnings?: ((
  14445. warning: WebpackError,
  14446. compilation: Compilation
  14447. ) => boolean)[];
  14448. /**
  14449. * Options for infrastructure level logging.
  14450. */
  14451. infrastructureLogging: InfrastructureLogging;
  14452. /**
  14453. * Custom values available in the loader context.
  14454. */
  14455. loader?: Loader;
  14456. /**
  14457. * Enable production optimizations or development hints.
  14458. */
  14459. mode?: "none" | "development" | "production";
  14460. /**
  14461. * Options affecting the normal modules (`NormalModuleFactory`).
  14462. */
  14463. module: ModuleOptionsNormalized;
  14464. /**
  14465. * Name of the configuration. Used when loading multiple configurations.
  14466. */
  14467. name?: string;
  14468. /**
  14469. * Include polyfills or mocks for various node stuff.
  14470. */
  14471. node: Node;
  14472. /**
  14473. * Enables/Disables integrated optimizations.
  14474. */
  14475. optimization: Optimization;
  14476. /**
  14477. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  14478. */
  14479. output: OutputNormalized;
  14480. /**
  14481. * The number of parallel processed modules in the compilation.
  14482. */
  14483. parallelism?: number;
  14484. /**
  14485. * Configuration for web performance recommendations.
  14486. */
  14487. performance?: false | PerformanceOptions;
  14488. /**
  14489. * Add additional plugins to the compiler.
  14490. */
  14491. plugins: (
  14492. | undefined
  14493. | null
  14494. | false
  14495. | ""
  14496. | 0
  14497. | ((this: Compiler, compiler: Compiler) => void)
  14498. | WebpackPluginInstance
  14499. )[];
  14500. /**
  14501. * Capture timing information for each module.
  14502. */
  14503. profile?: boolean;
  14504. /**
  14505. * Store compiler state to a json file.
  14506. */
  14507. recordsInputPath?: string | false;
  14508. /**
  14509. * Load compiler state from a json file.
  14510. */
  14511. recordsOutputPath?: string | false;
  14512. /**
  14513. * Options for the resolver.
  14514. */
  14515. resolve: ResolveOptions;
  14516. /**
  14517. * Options for the resolver when resolving loaders.
  14518. */
  14519. resolveLoader: ResolveOptions;
  14520. /**
  14521. * Options affecting how file system snapshots are created and validated.
  14522. */
  14523. snapshot: SnapshotOptionsWebpackOptions;
  14524. /**
  14525. * Stats options object or preset name.
  14526. */
  14527. stats: StatsValue;
  14528. /**
  14529. * Environment to build for. An array of environments to build for all of them when possible.
  14530. */
  14531. target?: string | false | string[];
  14532. /**
  14533. * Enter watch mode, which rebuilds on file change.
  14534. */
  14535. watch?: boolean;
  14536. /**
  14537. * Options for the watcher.
  14538. */
  14539. watchOptions: WatchOptions;
  14540. }
  14541. /**
  14542. * Plugin instance.
  14543. */
  14544. declare interface WebpackPluginInstance {
  14545. [index: string]: any;
  14546. /**
  14547. * The run point of the plugin, required method.
  14548. */
  14549. apply: (compiler: Compiler) => void;
  14550. }
  14551. declare interface WithId {
  14552. id: string | number;
  14553. }
  14554. declare interface WithOptions {
  14555. /**
  14556. * create a resolver with additional/different options
  14557. */
  14558. withOptions: (
  14559. arg0: Partial<ResolveOptionsWithDependencyType>
  14560. ) => ResolverWithOptions;
  14561. }
  14562. declare interface WriteFile {
  14563. (
  14564. file: PathOrFileDescriptorFs,
  14565. data:
  14566. | string
  14567. | Uint8Array<ArrayBufferLike>
  14568. | Uint8ClampedArray<ArrayBufferLike>
  14569. | Uint16Array<ArrayBufferLike>
  14570. | Uint32Array<ArrayBufferLike>
  14571. | Int8Array<ArrayBufferLike>
  14572. | Int16Array<ArrayBufferLike>
  14573. | Int32Array<ArrayBufferLike>
  14574. | BigUint64Array<ArrayBufferLike>
  14575. | BigInt64Array<ArrayBufferLike>
  14576. | Float32Array<ArrayBufferLike>
  14577. | Float64Array<ArrayBufferLike>
  14578. | DataView<ArrayBufferLike>,
  14579. options: WriteFileOptions,
  14580. callback: (arg0: null | NodeJS.ErrnoException) => void
  14581. ): void;
  14582. (
  14583. file: PathOrFileDescriptorFs,
  14584. data:
  14585. | string
  14586. | Uint8Array<ArrayBufferLike>
  14587. | Uint8ClampedArray<ArrayBufferLike>
  14588. | Uint16Array<ArrayBufferLike>
  14589. | Uint32Array<ArrayBufferLike>
  14590. | Int8Array<ArrayBufferLike>
  14591. | Int16Array<ArrayBufferLike>
  14592. | Int32Array<ArrayBufferLike>
  14593. | BigUint64Array<ArrayBufferLike>
  14594. | BigInt64Array<ArrayBufferLike>
  14595. | Float32Array<ArrayBufferLike>
  14596. | Float64Array<ArrayBufferLike>
  14597. | DataView<ArrayBufferLike>,
  14598. callback: (arg0: null | NodeJS.ErrnoException) => void
  14599. ): void;
  14600. }
  14601. type WriteFileOptions =
  14602. | null
  14603. | "ascii"
  14604. | "utf8"
  14605. | "utf-8"
  14606. | "utf16le"
  14607. | "utf-16le"
  14608. | "ucs2"
  14609. | "ucs-2"
  14610. | "latin1"
  14611. | "binary"
  14612. | "base64"
  14613. | "base64url"
  14614. | "hex"
  14615. | (ObjectEncodingOptions &
  14616. Abortable & { mode?: string | number; flag?: string; flush?: boolean });
  14617. declare interface WriteOnlySet<T> {
  14618. add: (item: T) => void;
  14619. }
  14620. declare interface WriteStreamOptions {
  14621. flags?: string;
  14622. encoding?:
  14623. | "ascii"
  14624. | "utf8"
  14625. | "utf-8"
  14626. | "utf16le"
  14627. | "utf-16le"
  14628. | "ucs2"
  14629. | "ucs-2"
  14630. | "latin1"
  14631. | "binary"
  14632. | "base64"
  14633. | "base64url"
  14634. | "hex";
  14635. fd?: any;
  14636. mode?: number;
  14637. autoClose?: boolean;
  14638. emitClose?: boolean;
  14639. start?: number;
  14640. signal?: null | AbortSignal;
  14641. fs?: null | CreateWriteStreamFSImplementation;
  14642. }
  14643. type __TypeWebpackOptions = (data: object) =>
  14644. | string
  14645. | {
  14646. /**
  14647. * Unique loader options identifier.
  14648. */
  14649. ident?: string;
  14650. /**
  14651. * Loader name.
  14652. */
  14653. loader?: string;
  14654. /**
  14655. * Loader options.
  14656. */
  14657. options?: string | { [index: string]: any };
  14658. }
  14659. | __TypeWebpackOptions
  14660. | __Type_2[];
  14661. type __Type_2 =
  14662. | undefined
  14663. | null
  14664. | string
  14665. | false
  14666. | 0
  14667. | {
  14668. /**
  14669. * Unique loader options identifier.
  14670. */
  14671. ident?: string;
  14672. /**
  14673. * Loader name.
  14674. */
  14675. loader?: string;
  14676. /**
  14677. * Loader options.
  14678. */
  14679. options?: string | { [index: string]: any };
  14680. }
  14681. | ((data: object) =>
  14682. | string
  14683. | {
  14684. /**
  14685. * Unique loader options identifier.
  14686. */
  14687. ident?: string;
  14688. /**
  14689. * Loader name.
  14690. */
  14691. loader?: string;
  14692. /**
  14693. * Loader options.
  14694. */
  14695. options?: string | { [index: string]: any };
  14696. }
  14697. | __TypeWebpackOptions
  14698. | __Type_2[]);
  14699. declare function exports(
  14700. options: Configuration,
  14701. callback?: CallbackWebpack<Stats>
  14702. ): Compiler;
  14703. declare function exports(
  14704. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  14705. callback?: CallbackWebpack<MultiStats>
  14706. ): MultiCompiler;
  14707. declare namespace exports {
  14708. export const webpack: {
  14709. (options: Configuration, callback?: CallbackWebpack<Stats>): Compiler;
  14710. (
  14711. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  14712. callback?: CallbackWebpack<MultiStats>
  14713. ): MultiCompiler;
  14714. };
  14715. export const validate: (arg0: Configuration | Configuration[]) => void;
  14716. export const validateSchema: (
  14717. schema: Parameters<typeof validateFunction>[0],
  14718. options: Parameters<typeof validateFunction>[1],
  14719. validationConfiguration?: ValidationErrorConfiguration
  14720. ) => void;
  14721. export const version: string;
  14722. export namespace cli {
  14723. export let getArguments: (schema?: any) => Flags;
  14724. export let processArguments: (
  14725. args: Flags,
  14726. config: any,
  14727. values: Record<string, Value[]>
  14728. ) => null | Problem[];
  14729. }
  14730. export namespace ModuleFilenameHelpers {
  14731. export let ALL_LOADERS_RESOURCE: string;
  14732. export let REGEXP_ALL_LOADERS_RESOURCE: RegExp;
  14733. export let LOADERS_RESOURCE: string;
  14734. export let REGEXP_LOADERS_RESOURCE: RegExp;
  14735. export let RESOURCE: string;
  14736. export let REGEXP_RESOURCE: RegExp;
  14737. export let ABSOLUTE_RESOURCE_PATH: string;
  14738. export let REGEXP_ABSOLUTE_RESOURCE_PATH: RegExp;
  14739. export let RESOURCE_PATH: string;
  14740. export let REGEXP_RESOURCE_PATH: RegExp;
  14741. export let ALL_LOADERS: string;
  14742. export let REGEXP_ALL_LOADERS: RegExp;
  14743. export let LOADERS: string;
  14744. export let REGEXP_LOADERS: RegExp;
  14745. export let QUERY: string;
  14746. export let REGEXP_QUERY: RegExp;
  14747. export let ID: string;
  14748. export let REGEXP_ID: RegExp;
  14749. export let HASH: string;
  14750. export let REGEXP_HASH: RegExp;
  14751. export let NAMESPACE: string;
  14752. export let REGEXP_NAMESPACE: RegExp;
  14753. export let createFilename: (
  14754. module: string | Module,
  14755. options: any,
  14756. __2: {
  14757. /**
  14758. * requestShortener
  14759. */
  14760. requestShortener: RequestShortener;
  14761. /**
  14762. * chunk graph
  14763. */
  14764. chunkGraph: ChunkGraph;
  14765. /**
  14766. * the hash function to use
  14767. */
  14768. hashFunction?: string | typeof Hash;
  14769. }
  14770. ) => string;
  14771. export let replaceDuplicates: <T>(
  14772. array: T[],
  14773. fn: (
  14774. duplicateItem: T,
  14775. duplicateItemIndex: number,
  14776. numberOfTimesReplaced: number
  14777. ) => T,
  14778. comparator?: (firstElement: T, nextElement: T) => 0 | 1 | -1
  14779. ) => T[];
  14780. export let matchPart: (str: string, test: Matcher) => boolean;
  14781. export let matchObject: (obj: MatchObject, str: string) => boolean;
  14782. }
  14783. export namespace OptimizationStages {
  14784. export let STAGE_BASIC: -10;
  14785. export let STAGE_DEFAULT: 0;
  14786. export let STAGE_ADVANCED: 10;
  14787. }
  14788. export namespace RuntimeGlobals {
  14789. export let require: "__webpack_require__";
  14790. export let requireScope: "__webpack_require__.*";
  14791. export let exports: "__webpack_exports__";
  14792. export let thisAsExports: "top-level-this-exports";
  14793. export let returnExportsFromRuntime: "return-exports-from-runtime";
  14794. export let module: "module";
  14795. export let moduleId: "module.id";
  14796. export let moduleLoaded: "module.loaded";
  14797. export let publicPath: "__webpack_require__.p";
  14798. export let entryModuleId: "__webpack_require__.s";
  14799. export let moduleCache: "__webpack_require__.c";
  14800. export let moduleFactories: "__webpack_require__.m";
  14801. export let moduleFactoriesAddOnly: "__webpack_require__.m (add only)";
  14802. export let ensureChunk: "__webpack_require__.e";
  14803. export let ensureChunkHandlers: "__webpack_require__.f";
  14804. export let ensureChunkIncludeEntries: "__webpack_require__.f (include entries)";
  14805. export let prefetchChunk: "__webpack_require__.E";
  14806. export let prefetchChunkHandlers: "__webpack_require__.F";
  14807. export let preloadChunk: "__webpack_require__.G";
  14808. export let preloadChunkHandlers: "__webpack_require__.H";
  14809. export let definePropertyGetters: "__webpack_require__.d";
  14810. export let makeNamespaceObject: "__webpack_require__.r";
  14811. export let createFakeNamespaceObject: "__webpack_require__.t";
  14812. export let compatGetDefaultExport: "__webpack_require__.n";
  14813. export let harmonyModuleDecorator: "__webpack_require__.hmd";
  14814. export let nodeModuleDecorator: "__webpack_require__.nmd";
  14815. export let getFullHash: "__webpack_require__.h";
  14816. export let wasmInstances: "__webpack_require__.w";
  14817. export let instantiateWasm: "__webpack_require__.v";
  14818. export let uncaughtErrorHandler: "__webpack_require__.oe";
  14819. export let scriptNonce: "__webpack_require__.nc";
  14820. export let loadScript: "__webpack_require__.l";
  14821. export let createScript: "__webpack_require__.ts";
  14822. export let createScriptUrl: "__webpack_require__.tu";
  14823. export let getTrustedTypesPolicy: "__webpack_require__.tt";
  14824. export let hasFetchPriority: "has fetch priority";
  14825. export let chunkName: "__webpack_require__.cn";
  14826. export let runtimeId: "__webpack_require__.j";
  14827. export let getChunkScriptFilename: "__webpack_require__.u";
  14828. export let getChunkCssFilename: "__webpack_require__.k";
  14829. export let hasCssModules: "has css modules";
  14830. export let getChunkUpdateScriptFilename: "__webpack_require__.hu";
  14831. export let getChunkUpdateCssFilename: "__webpack_require__.hk";
  14832. export let startup: "__webpack_require__.x";
  14833. export let startupNoDefault: "__webpack_require__.x (no default handler)";
  14834. export let startupOnlyAfter: "__webpack_require__.x (only after)";
  14835. export let startupOnlyBefore: "__webpack_require__.x (only before)";
  14836. export let chunkCallback: "webpackChunk";
  14837. export let startupEntrypoint: "__webpack_require__.X";
  14838. export let onChunksLoaded: "__webpack_require__.O";
  14839. export let externalInstallChunk: "__webpack_require__.C";
  14840. export let interceptModuleExecution: "__webpack_require__.i";
  14841. export let global: "__webpack_require__.g";
  14842. export let shareScopeMap: "__webpack_require__.S";
  14843. export let initializeSharing: "__webpack_require__.I";
  14844. export let currentRemoteGetScope: "__webpack_require__.R";
  14845. export let getUpdateManifestFilename: "__webpack_require__.hmrF";
  14846. export let hmrDownloadManifest: "__webpack_require__.hmrM";
  14847. export let hmrDownloadUpdateHandlers: "__webpack_require__.hmrC";
  14848. export let hmrModuleData: "__webpack_require__.hmrD";
  14849. export let hmrInvalidateModuleHandlers: "__webpack_require__.hmrI";
  14850. export let hmrRuntimeStatePrefix: "__webpack_require__.hmrS";
  14851. export let amdDefine: "__webpack_require__.amdD";
  14852. export let amdOptions: "__webpack_require__.amdO";
  14853. export let system: "__webpack_require__.System";
  14854. export let hasOwnProperty: "__webpack_require__.o";
  14855. export let systemContext: "__webpack_require__.y";
  14856. export let baseURI: "__webpack_require__.b";
  14857. export let relativeUrl: "__webpack_require__.U";
  14858. export let asyncModule: "__webpack_require__.a";
  14859. }
  14860. export const UsageState: Readonly<{
  14861. Unused: 0;
  14862. OnlyPropertiesUsed: 1;
  14863. NoInfo: 2;
  14864. Unknown: 3;
  14865. Used: 4;
  14866. }>;
  14867. export namespace cache {
  14868. export { MemoryCachePlugin };
  14869. }
  14870. export namespace config {
  14871. export const getNormalizedWebpackOptions: (
  14872. config: Configuration
  14873. ) => WebpackOptionsNormalized;
  14874. export const applyWebpackOptionsDefaults: (
  14875. options: WebpackOptionsNormalized,
  14876. compilerIndex?: number
  14877. ) => ResolvedOptions;
  14878. }
  14879. export namespace dependencies {
  14880. export {
  14881. ModuleDependency,
  14882. HarmonyImportDependency,
  14883. ConstDependency,
  14884. NullDependency
  14885. };
  14886. }
  14887. export namespace ids {
  14888. export {
  14889. ChunkModuleIdRangePlugin,
  14890. NaturalModuleIdsPlugin,
  14891. OccurrenceModuleIdsPlugin,
  14892. NamedModuleIdsPlugin,
  14893. DeterministicChunkIdsPlugin,
  14894. DeterministicModuleIdsPlugin,
  14895. NamedChunkIdsPlugin,
  14896. OccurrenceChunkIdsPlugin,
  14897. HashedModuleIdsPlugin
  14898. };
  14899. }
  14900. export namespace javascript {
  14901. export {
  14902. EnableChunkLoadingPlugin,
  14903. JavascriptModulesPlugin,
  14904. JavascriptParser
  14905. };
  14906. }
  14907. export namespace optimize {
  14908. export namespace InnerGraph {
  14909. export let bailout: (parserState: ParserState) => void;
  14910. export let enable: (parserState: ParserState) => void;
  14911. export let isEnabled: (parserState: ParserState) => boolean;
  14912. export let addUsage: (
  14913. state: ParserState,
  14914. symbol: null | TopLevelSymbol,
  14915. usage: string | true | TopLevelSymbol
  14916. ) => void;
  14917. export let addVariableUsage: (
  14918. parser: JavascriptParser,
  14919. name: string,
  14920. usage: string | true | TopLevelSymbol
  14921. ) => void;
  14922. export let inferDependencyUsage: (state: ParserState) => void;
  14923. export let onUsage: (
  14924. state: ParserState,
  14925. onUsageCallback: (arg0?: boolean | Set<string>) => void
  14926. ) => void;
  14927. export let setTopLevelSymbol: (
  14928. state: ParserState,
  14929. symbol?: TopLevelSymbol
  14930. ) => void;
  14931. export let getTopLevelSymbol: (
  14932. state: ParserState
  14933. ) => void | TopLevelSymbol;
  14934. export let tagTopLevelSymbol: (
  14935. parser: JavascriptParser,
  14936. name: string
  14937. ) => undefined | TopLevelSymbol;
  14938. export let isDependencyUsedByExports: (
  14939. dependency: Dependency,
  14940. usedByExports: boolean | Set<string>,
  14941. moduleGraph: ModuleGraph,
  14942. runtime: RuntimeSpec
  14943. ) => boolean;
  14944. export let getDependencyUsedByExportsCondition: (
  14945. dependency: Dependency,
  14946. usedByExports: undefined | boolean | Set<string>,
  14947. moduleGraph: ModuleGraph
  14948. ) =>
  14949. | null
  14950. | false
  14951. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
  14952. export { TopLevelSymbol, topLevelSymbolTag };
  14953. }
  14954. export {
  14955. AggressiveMergingPlugin,
  14956. AggressiveSplittingPlugin,
  14957. LimitChunkCountPlugin,
  14958. MergeDuplicateChunksPlugin,
  14959. MinChunkSizePlugin,
  14960. ModuleConcatenationPlugin,
  14961. RealContentHashPlugin,
  14962. RuntimeChunkPlugin,
  14963. SideEffectsFlagPlugin,
  14964. SplitChunksPlugin
  14965. };
  14966. }
  14967. export namespace runtime {
  14968. export { GetChunkFilenameRuntimeModule, LoadScriptRuntimeModule };
  14969. }
  14970. export namespace prefetch {
  14971. export { ChunkPrefetchPreloadPlugin };
  14972. }
  14973. export namespace web {
  14974. export {
  14975. FetchCompileWasmPlugin,
  14976. FetchCompileAsyncWasmPlugin,
  14977. JsonpChunkLoadingRuntimeModule,
  14978. JsonpTemplatePlugin,
  14979. CssLoadingRuntimeModule
  14980. };
  14981. }
  14982. export namespace esm {
  14983. export { ModuleChunkLoadingRuntimeModule };
  14984. }
  14985. export namespace webworker {
  14986. export { WebWorkerTemplatePlugin };
  14987. }
  14988. export namespace node {
  14989. export {
  14990. NodeEnvironmentPlugin,
  14991. NodeSourcePlugin,
  14992. NodeTargetPlugin,
  14993. NodeTemplatePlugin,
  14994. ReadFileCompileWasmPlugin,
  14995. ReadFileCompileAsyncWasmPlugin
  14996. };
  14997. }
  14998. export namespace electron {
  14999. export { ElectronTargetPlugin };
  15000. }
  15001. export namespace wasm {
  15002. export { AsyncWebAssemblyModulesPlugin, EnableWasmLoadingPlugin };
  15003. }
  15004. export namespace css {
  15005. export { CssModulesPlugin };
  15006. }
  15007. export namespace library {
  15008. export { AbstractLibraryPlugin, EnableLibraryPlugin };
  15009. }
  15010. export namespace container {
  15011. export const scope: <T>(
  15012. scope: string,
  15013. options: ContainerOptionsFormat<T>
  15014. ) => Record<string, string | string[] | T>;
  15015. export {
  15016. ContainerPlugin,
  15017. ContainerReferencePlugin,
  15018. ModuleFederationPlugin
  15019. };
  15020. }
  15021. export namespace sharing {
  15022. export const scope: <T>(
  15023. scope: string,
  15024. options: ContainerOptionsFormat<T>
  15025. ) => Record<string, string | string[] | T>;
  15026. export { ConsumeSharedPlugin, ProvideSharedPlugin, SharePlugin };
  15027. }
  15028. export namespace debug {
  15029. export { ProfilingPlugin };
  15030. }
  15031. export namespace util {
  15032. export const createHash: (algorithm: Algorithm) => Hash;
  15033. export namespace comparators {
  15034. export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
  15035. export let compareModulesByIdentifier: (
  15036. a: Module,
  15037. b: Module
  15038. ) => 0 | 1 | -1;
  15039. export let compareModulesById: ParameterizedComparator<
  15040. ChunkGraph,
  15041. Module
  15042. >;
  15043. export let compareNumbers: (a: number, b: number) => 0 | 1 | -1;
  15044. export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1;
  15045. export let compareModulesByPostOrderIndexOrIdentifier: ParameterizedComparator<
  15046. ModuleGraph,
  15047. Module
  15048. >;
  15049. export let compareModulesByPreOrderIndexOrIdentifier: ParameterizedComparator<
  15050. ModuleGraph,
  15051. Module
  15052. >;
  15053. export let compareModulesByIdOrIdentifier: ParameterizedComparator<
  15054. ChunkGraph,
  15055. Module
  15056. >;
  15057. export let compareChunks: ParameterizedComparator<ChunkGraph, Chunk>;
  15058. export let compareIds: (
  15059. a: string | number,
  15060. b: string | number
  15061. ) => 0 | 1 | -1;
  15062. export let compareStrings: (a: string, b: string) => 0 | 1 | -1;
  15063. export let compareChunkGroupsByIndex: (
  15064. a: ChunkGroup,
  15065. b: ChunkGroup
  15066. ) => 0 | 1 | -1;
  15067. export let concatComparators: <T>(
  15068. c1: Comparator<T>,
  15069. c2: Comparator<T>,
  15070. ...cRest: Comparator<T>[]
  15071. ) => Comparator<T>;
  15072. export let compareSelect: <T, R>(
  15073. getter: Selector<T, R>,
  15074. comparator: Comparator<R>
  15075. ) => Comparator<T>;
  15076. export let compareIterables: <T>(
  15077. elementComparator: Comparator<T>
  15078. ) => Comparator<Iterable<T>>;
  15079. export let keepOriginalOrder: <T>(iterable: Iterable<T>) => Comparator<T>;
  15080. export let compareChunksNatural: (
  15081. chunkGraph: ChunkGraph
  15082. ) => Comparator<Chunk>;
  15083. export let compareLocations: (
  15084. a: DependencyLocation,
  15085. b: DependencyLocation
  15086. ) => 0 | 1 | -1;
  15087. }
  15088. export namespace runtime {
  15089. export let getEntryRuntime: (
  15090. compilation: Compilation,
  15091. name: string,
  15092. options?: EntryOptions
  15093. ) => RuntimeSpec;
  15094. export let forEachRuntime: (
  15095. runtime: RuntimeSpec,
  15096. fn: (arg0?: string) => void,
  15097. deterministicOrder?: boolean
  15098. ) => void;
  15099. export let getRuntimeKey: (runtime: RuntimeSpec) => string;
  15100. export let keyToRuntime: (key: string) => RuntimeSpec;
  15101. export let runtimeToString: (runtime: RuntimeSpec) => string;
  15102. export let runtimeConditionToString: (
  15103. runtimeCondition: RuntimeCondition
  15104. ) => string;
  15105. export let runtimeEqual: (a: RuntimeSpec, b: RuntimeSpec) => boolean;
  15106. export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
  15107. export let mergeRuntime: (a: RuntimeSpec, b: RuntimeSpec) => RuntimeSpec;
  15108. export let mergeRuntimeCondition: (
  15109. a: RuntimeCondition,
  15110. b: RuntimeCondition,
  15111. runtime: RuntimeSpec
  15112. ) => RuntimeCondition;
  15113. export let mergeRuntimeConditionNonFalse: (
  15114. a: undefined | string | true | SortableSet<string>,
  15115. b: undefined | string | true | SortableSet<string>,
  15116. runtime: RuntimeSpec
  15117. ) => undefined | string | true | SortableSet<string>;
  15118. export let mergeRuntimeOwned: (
  15119. a: RuntimeSpec,
  15120. b: RuntimeSpec
  15121. ) => RuntimeSpec;
  15122. export let intersectRuntime: (
  15123. a: RuntimeSpec,
  15124. b: RuntimeSpec
  15125. ) => RuntimeSpec;
  15126. export let subtractRuntime: (
  15127. a: RuntimeSpec,
  15128. b: RuntimeSpec
  15129. ) => RuntimeSpec;
  15130. export let subtractRuntimeCondition: (
  15131. a: RuntimeCondition,
  15132. b: RuntimeCondition,
  15133. runtime: RuntimeSpec
  15134. ) => RuntimeCondition;
  15135. export let filterRuntime: (
  15136. runtime: RuntimeSpec,
  15137. filter: (arg0: RuntimeSpec) => boolean
  15138. ) => undefined | string | boolean | SortableSet<string>;
  15139. export { RuntimeSpecMap, RuntimeSpecSet };
  15140. }
  15141. export namespace serialization {
  15142. export const register: (
  15143. Constructor: Constructor,
  15144. request: string,
  15145. name: null | string,
  15146. serializer: ObjectSerializer
  15147. ) => void;
  15148. export const registerLoader: (
  15149. regExp: RegExp,
  15150. loader: (arg0: string) => boolean
  15151. ) => void;
  15152. export const registerNotSerializable: (Constructor: Constructor) => void;
  15153. export const NOT_SERIALIZABLE: object;
  15154. export const buffersSerializer: Serializer;
  15155. export let createFileSerializer: (
  15156. fs: IntermediateFileSystem,
  15157. hashFunction: string | typeof Hash
  15158. ) => Serializer;
  15159. export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
  15160. }
  15161. export const cleverMerge: <T, O>(
  15162. first?: null | T,
  15163. second?: null | O
  15164. ) => T | O | (T & O);
  15165. export function compileBooleanMatcher(
  15166. map: Record<string | number, boolean>
  15167. ): boolean | ((arg0: string) => string);
  15168. export namespace compileBooleanMatcher {
  15169. export let fromLists: (
  15170. positiveItems: string[],
  15171. negativeItems: string[]
  15172. ) => (arg0: string) => string;
  15173. export let itemsToRegexp: (itemsArr: string[]) => string;
  15174. }
  15175. export { LazySet };
  15176. }
  15177. export namespace sources {
  15178. export {
  15179. Source,
  15180. RawSource,
  15181. OriginalSource,
  15182. ReplaceSource,
  15183. SourceMapSource,
  15184. ConcatSource,
  15185. PrefixSource,
  15186. CachedSource,
  15187. SizeOnlySource,
  15188. CompatSource
  15189. };
  15190. }
  15191. export namespace experiments {
  15192. export namespace schemes {
  15193. export { HttpUriPlugin };
  15194. }
  15195. export namespace ids {
  15196. export { SyncModuleIdsPlugin };
  15197. }
  15198. }
  15199. export type WebpackPluginFunction = (
  15200. this: Compiler,
  15201. compiler: Compiler
  15202. ) => void;
  15203. export {
  15204. AutomaticPrefetchPlugin,
  15205. AsyncDependenciesBlock,
  15206. BannerPlugin,
  15207. Cache,
  15208. Chunk,
  15209. ChunkGraph,
  15210. CleanPlugin,
  15211. Compilation,
  15212. Compiler,
  15213. ConcatenationScope,
  15214. ContextExclusionPlugin,
  15215. ContextReplacementPlugin,
  15216. DefinePlugin,
  15217. DelegatedPlugin,
  15218. Dependency,
  15219. DllPlugin,
  15220. DllReferencePlugin,
  15221. DynamicEntryPlugin,
  15222. EntryOptionPlugin,
  15223. EntryPlugin,
  15224. EnvironmentPlugin,
  15225. EvalDevToolModulePlugin,
  15226. EvalSourceMapDevToolPlugin,
  15227. ExternalModule,
  15228. ExternalsPlugin,
  15229. Generator,
  15230. HotUpdateChunk,
  15231. HotModuleReplacementPlugin,
  15232. InitFragment,
  15233. IgnorePlugin,
  15234. JavascriptModulesPlugin,
  15235. LibManifestPlugin,
  15236. LibraryTemplatePlugin,
  15237. LoaderOptionsPlugin,
  15238. LoaderTargetPlugin,
  15239. Module,
  15240. ModuleGraph,
  15241. ModuleGraphConnection,
  15242. NoEmitOnErrorsPlugin,
  15243. NormalModule,
  15244. NormalModuleReplacementPlugin,
  15245. MultiCompiler,
  15246. Parser,
  15247. PlatformPlugin,
  15248. PrefetchPlugin,
  15249. ProgressPlugin,
  15250. ProvidePlugin,
  15251. RuntimeModule,
  15252. EntryPlugin as SingleEntryPlugin,
  15253. SourceMapDevToolPlugin,
  15254. Stats,
  15255. Template,
  15256. WatchIgnorePlugin,
  15257. WebpackError,
  15258. WebpackOptionsApply,
  15259. WebpackOptionsDefaulter,
  15260. ValidationError as WebpackOptionsValidationError,
  15261. ValidationError,
  15262. Entry,
  15263. EntryNormalized,
  15264. EntryObject,
  15265. ExternalItemFunctionData,
  15266. ExternalItemObjectKnown,
  15267. ExternalItemObjectUnknown,
  15268. ExternalItemValue,
  15269. Externals,
  15270. FileCacheOptions,
  15271. LibraryOptions,
  15272. MemoryCacheOptions,
  15273. ModuleOptions,
  15274. ResolveOptions,
  15275. RuleSetCondition,
  15276. RuleSetConditionAbsolute,
  15277. RuleSetRule,
  15278. RuleSetUse,
  15279. RuleSetUseItem,
  15280. StatsOptions,
  15281. Configuration,
  15282. WebpackOptionsNormalized,
  15283. WebpackPluginInstance,
  15284. ChunkGroup,
  15285. Asset,
  15286. AssetInfo,
  15287. EntryOptions,
  15288. PathData,
  15289. AssetEmittedInfo,
  15290. MultiCompilerOptions,
  15291. MultiStats,
  15292. ResolveData,
  15293. ParserState,
  15294. ResolvePluginInstance,
  15295. Resolver,
  15296. Watching,
  15297. Argument,
  15298. Problem,
  15299. StatsAsset,
  15300. StatsChunk,
  15301. StatsChunkGroup,
  15302. StatsChunkOrigin,
  15303. StatsCompilation,
  15304. StatsError,
  15305. StatsLogging,
  15306. StatsLoggingEntry,
  15307. StatsModule,
  15308. StatsModuleIssuer,
  15309. StatsModuleReason,
  15310. StatsModuleTraceDependency,
  15311. StatsModuleTraceItem,
  15312. StatsProfile,
  15313. InputFileSystem,
  15314. OutputFileSystem,
  15315. LoaderModule,
  15316. RawLoaderDefinition,
  15317. LoaderDefinition,
  15318. LoaderDefinitionFunction,
  15319. PitchLoaderDefinitionFunction,
  15320. RawLoaderDefinitionFunction,
  15321. LoaderContextDeclarationsIndex as LoaderContext
  15322. };
  15323. }
  15324. declare const topLevelSymbolTag: unique symbol;
  15325. export = exports;