types.d.ts 334 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291
  1. /*
  2. * This file was automatically generated.
  3. * DO NOT MODIFY BY HAND.
  4. * Run `yarn special-lint-fix` to update
  5. */
  6. import { Buffer } from "buffer";
  7. import {
  8. ArrayExpression,
  9. ArrayPattern,
  10. ArrowFunctionExpression,
  11. AssignmentExpression,
  12. AssignmentPattern,
  13. AssignmentProperty,
  14. AwaitExpression,
  15. BigIntLiteral,
  16. BinaryExpression,
  17. BlockStatement,
  18. BreakStatement,
  19. CatchClause,
  20. ChainExpression,
  21. ClassBody,
  22. ClassDeclaration,
  23. ClassExpression,
  24. Comment,
  25. ConditionalExpression,
  26. ContinueStatement,
  27. DebuggerStatement,
  28. DoWhileStatement,
  29. EmptyStatement,
  30. ExportAllDeclaration,
  31. ExportDefaultDeclaration,
  32. ExportNamedDeclaration,
  33. ExportSpecifier,
  34. ExpressionStatement,
  35. ForInStatement,
  36. ForOfStatement,
  37. ForStatement,
  38. FunctionDeclaration,
  39. FunctionExpression,
  40. Identifier,
  41. IfStatement,
  42. ImportDeclaration,
  43. ImportDefaultSpecifier,
  44. ImportExpression,
  45. ImportNamespaceSpecifier,
  46. ImportSpecifier,
  47. LabeledStatement,
  48. LogicalExpression,
  49. MemberExpression,
  50. MetaProperty,
  51. MethodDefinition,
  52. NewExpression,
  53. ObjectExpression,
  54. ObjectPattern,
  55. PrivateIdentifier,
  56. Program,
  57. Property,
  58. PropertyDefinition,
  59. RegExpLiteral,
  60. RestElement,
  61. ReturnStatement,
  62. SequenceExpression,
  63. SimpleCallExpression,
  64. SimpleLiteral,
  65. SpreadElement,
  66. StaticBlock,
  67. Super,
  68. SwitchCase,
  69. SwitchStatement,
  70. TaggedTemplateExpression,
  71. TemplateElement,
  72. TemplateLiteral,
  73. ThisExpression,
  74. ThrowStatement,
  75. TryStatement,
  76. UnaryExpression,
  77. UpdateExpression,
  78. VariableDeclaration,
  79. VariableDeclarator,
  80. WhileStatement,
  81. WithStatement,
  82. YieldExpression
  83. } from "estree";
  84. import {
  85. IncomingMessage,
  86. ServerOptions as ServerOptionsImport,
  87. ServerResponse
  88. } from "http";
  89. import { ListenOptions, Server } from "net";
  90. import { validate as validateFunction } from "schema-utils";
  91. import { default as ValidationError } from "schema-utils/declarations/ValidationError";
  92. import { ValidationErrorConfiguration } from "schema-utils/declarations/validate";
  93. import {
  94. AsArray,
  95. AsyncParallelHook,
  96. AsyncSeriesBailHook,
  97. AsyncSeriesHook,
  98. AsyncSeriesWaterfallHook,
  99. HookMap,
  100. MultiHook,
  101. SyncBailHook,
  102. SyncHook,
  103. SyncWaterfallHook
  104. } from "tapable";
  105. import { SecureContextOptions, TlsOptions } from "tls";
  106. declare class AbstractLibraryPlugin<T> {
  107. constructor(__0: {
  108. /**
  109. * name of the plugin
  110. */
  111. pluginName: string;
  112. /**
  113. * used library type
  114. */
  115. type: string;
  116. });
  117. /**
  118. * Apply the plugin
  119. */
  120. apply(compiler: Compiler): void;
  121. parseOptions(library: LibraryOptions): false | T;
  122. finishEntryModule(
  123. module: Module,
  124. entryName: string,
  125. libraryContext: LibraryContext<T>
  126. ): void;
  127. embedInRuntimeBailout(
  128. module: Module,
  129. renderContext: RenderContext,
  130. libraryContext: LibraryContext<T>
  131. ): undefined | string;
  132. strictRuntimeBailout(
  133. renderContext: RenderContext,
  134. libraryContext: LibraryContext<T>
  135. ): undefined | string;
  136. runtimeRequirements(
  137. chunk: Chunk,
  138. set: Set<string>,
  139. libraryContext: LibraryContext<T>
  140. ): void;
  141. render(
  142. source: Source,
  143. renderContext: RenderContext,
  144. libraryContext: LibraryContext<T>
  145. ): Source;
  146. renderStartup(
  147. source: Source,
  148. module: Module,
  149. renderContext: StartupRenderContext,
  150. libraryContext: LibraryContext<T>
  151. ): Source;
  152. chunkHash(
  153. chunk: Chunk,
  154. hash: Hash,
  155. chunkHashContext: ChunkHashContext,
  156. libraryContext: LibraryContext<T>
  157. ): void;
  158. static COMMON_LIBRARY_NAME_MESSAGE: string;
  159. }
  160. declare interface AdditionalData {
  161. [index: string]: any;
  162. webpackAST: object;
  163. }
  164. declare class AggressiveMergingPlugin {
  165. constructor(options?: any);
  166. options: any;
  167. /**
  168. * Apply the plugin
  169. */
  170. apply(compiler: Compiler): void;
  171. }
  172. declare class AggressiveSplittingPlugin {
  173. constructor(options?: AggressiveSplittingPluginOptions);
  174. options: AggressiveSplittingPluginOptions;
  175. /**
  176. * Apply the plugin
  177. */
  178. apply(compiler: Compiler): void;
  179. static wasChunkRecorded(chunk: Chunk): boolean;
  180. }
  181. declare interface AggressiveSplittingPluginOptions {
  182. /**
  183. * Extra cost for each chunk (Default: 9.8kiB).
  184. */
  185. chunkOverhead?: number;
  186. /**
  187. * Extra cost multiplicator for entry chunks (Default: 10).
  188. */
  189. entryChunkMultiplicator?: number;
  190. /**
  191. * Byte, max size of per file (Default: 50kiB).
  192. */
  193. maxSize?: number;
  194. /**
  195. * Byte, split point. (Default: 30kiB).
  196. */
  197. minSize?: number;
  198. }
  199. declare interface AliasOption {
  200. alias: string | false | string[];
  201. name: string;
  202. onlyModule?: boolean;
  203. }
  204. type AliasOptionNewRequest = string | false | string[];
  205. declare interface AliasOptions {
  206. [index: string]: AliasOptionNewRequest;
  207. }
  208. declare interface Argument {
  209. description: string;
  210. simpleType: "string" | "number" | "boolean";
  211. multiple: boolean;
  212. configs: ArgumentConfig[];
  213. }
  214. declare interface ArgumentConfig {
  215. description: string;
  216. negatedDescription?: string;
  217. path: string;
  218. multiple: boolean;
  219. type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
  220. values?: any[];
  221. }
  222. declare interface Asset {
  223. /**
  224. * the filename of the asset
  225. */
  226. name: string;
  227. /**
  228. * source of the asset
  229. */
  230. source: Source;
  231. /**
  232. * info about the asset
  233. */
  234. info: AssetInfo;
  235. }
  236. declare interface AssetEmittedInfo {
  237. content: Buffer;
  238. source: Source;
  239. compilation: Compilation;
  240. outputPath: string;
  241. targetPath: string;
  242. }
  243. type AssetFilterItemTypes =
  244. | string
  245. | RegExp
  246. | ((name: string, asset: StatsAsset) => boolean);
  247. /**
  248. * Options object for data url generation.
  249. */
  250. declare interface AssetGeneratorDataUrlOptions {
  251. /**
  252. * Asset encoding (defaults to base64).
  253. */
  254. encoding?: false | "base64";
  255. /**
  256. * Asset mimetype (getting from file extension by default).
  257. */
  258. mimetype?: string;
  259. }
  260. type AssetGeneratorOptions = AssetInlineGeneratorOptions &
  261. AssetResourceGeneratorOptions;
  262. type AssetInfo = KnownAssetInfo & Record<string, any>;
  263. /**
  264. * Generator options for asset/inline modules.
  265. */
  266. declare interface AssetInlineGeneratorOptions {
  267. /**
  268. * The options for data url generator.
  269. */
  270. dataUrl?:
  271. | AssetGeneratorDataUrlOptions
  272. | ((
  273. source: string | Buffer,
  274. context: { filename: string; module: Module }
  275. ) => string);
  276. }
  277. /**
  278. * Options object for DataUrl condition.
  279. */
  280. declare interface AssetParserDataUrlOptions {
  281. /**
  282. * Maximum size of asset that should be inline as modules. Default: 8kb.
  283. */
  284. maxSize?: number;
  285. }
  286. /**
  287. * Parser options for asset modules.
  288. */
  289. declare interface AssetParserOptions {
  290. /**
  291. * The condition for inlining the asset as DataUrl.
  292. */
  293. dataUrlCondition?:
  294. | AssetParserDataUrlOptions
  295. | ((
  296. source: string | Buffer,
  297. context: { filename: string; module: Module }
  298. ) => boolean);
  299. }
  300. /**
  301. * Generator options for asset/resource modules.
  302. */
  303. declare interface AssetResourceGeneratorOptions {
  304. /**
  305. * Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.
  306. */
  307. emit?: boolean;
  308. /**
  309. * 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.
  310. */
  311. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  312. /**
  313. * 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.
  314. */
  315. outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  316. /**
  317. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  318. */
  319. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  320. }
  321. declare class AsyncDependenciesBlock extends DependenciesBlock {
  322. constructor(
  323. groupOptions: RawChunkGroupOptions & { name?: string } & {
  324. entryOptions?: EntryOptions;
  325. },
  326. loc?: SyntheticDependencyLocation | RealDependencyLocation,
  327. request?: string
  328. );
  329. groupOptions: RawChunkGroupOptions & { name?: string } & {
  330. entryOptions?: EntryOptions;
  331. };
  332. loc?: SyntheticDependencyLocation | RealDependencyLocation;
  333. request?: string;
  334. chunkName: string;
  335. module: any;
  336. }
  337. declare abstract class AsyncQueue<T, K, R> {
  338. hooks: {
  339. beforeAdd: AsyncSeriesHook<[T]>;
  340. added: SyncHook<[T]>;
  341. beforeStart: AsyncSeriesHook<[T]>;
  342. started: SyncHook<[T]>;
  343. result: SyncHook<[T, Error, R]>;
  344. };
  345. add(item: T, callback: CallbackAsyncQueue<R>): void;
  346. invalidate(item: T): void;
  347. /**
  348. * Waits for an already started item
  349. */
  350. waitFor(item: T, callback: CallbackAsyncQueue<R>): void;
  351. stop(): void;
  352. increaseParallelism(): void;
  353. decreaseParallelism(): void;
  354. isProcessing(item: T): boolean;
  355. isQueued(item: T): boolean;
  356. isDone(item: T): boolean;
  357. clear(): void;
  358. }
  359. declare class AsyncWebAssemblyModulesPlugin {
  360. constructor(options?: any);
  361. options: any;
  362. /**
  363. * Apply the plugin
  364. */
  365. apply(compiler: Compiler): void;
  366. renderModule(module?: any, renderContext?: any, hooks?: any): any;
  367. static getCompilationHooks(
  368. compilation: Compilation
  369. ): CompilationHooksAsyncWebAssemblyModulesPlugin;
  370. }
  371. declare class AutomaticPrefetchPlugin {
  372. constructor();
  373. /**
  374. * Apply the plugin
  375. */
  376. apply(compiler: Compiler): void;
  377. }
  378. type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
  379. declare interface BackendApi {
  380. dispose: (arg0?: Error) => void;
  381. module: (arg0: Module) => { client: string; data: string; active: boolean };
  382. }
  383. declare class BannerPlugin {
  384. constructor(options: BannerPluginArgument);
  385. options: BannerPluginOptions;
  386. banner: (data: { hash: string; chunk: Chunk; filename: string }) => string;
  387. /**
  388. * Apply the plugin
  389. */
  390. apply(compiler: Compiler): void;
  391. }
  392. type BannerPluginArgument =
  393. | string
  394. | BannerPluginOptions
  395. | ((data: { hash: string; chunk: Chunk; filename: string }) => string);
  396. declare interface BannerPluginOptions {
  397. /**
  398. * Specifies the banner.
  399. */
  400. banner:
  401. | string
  402. | ((data: { hash: string; chunk: Chunk; filename: string }) => string);
  403. /**
  404. * If true, the banner will only be added to the entry chunks.
  405. */
  406. entryOnly?: boolean;
  407. /**
  408. * Exclude all modules matching any of these conditions.
  409. */
  410. exclude?: string | RegExp | Rule[];
  411. /**
  412. * If true, banner will be placed at the end of the output.
  413. */
  414. footer?: boolean;
  415. /**
  416. * Include all modules matching any of these conditions.
  417. */
  418. include?: string | RegExp | Rule[];
  419. /**
  420. * If true, banner will not be wrapped in a comment.
  421. */
  422. raw?: boolean;
  423. /**
  424. * Include all modules that pass test assertion.
  425. */
  426. test?: string | RegExp | Rule[];
  427. }
  428. declare interface BaseResolveRequest {
  429. path: string | false;
  430. descriptionFilePath?: string;
  431. descriptionFileRoot?: string;
  432. descriptionFileData?: object;
  433. relativePath?: string;
  434. ignoreSymlinks?: boolean;
  435. fullySpecified?: boolean;
  436. }
  437. declare abstract class BasicEvaluatedExpression {
  438. type: number;
  439. range: [number, number];
  440. falsy: boolean;
  441. truthy: boolean;
  442. nullish?: boolean;
  443. sideEffects: boolean;
  444. bool?: boolean;
  445. number?: number;
  446. bigint?: bigint;
  447. regExp?: RegExp;
  448. string?: string;
  449. quasis?: BasicEvaluatedExpression[];
  450. parts?: BasicEvaluatedExpression[];
  451. array?: any[];
  452. items?: BasicEvaluatedExpression[];
  453. options?: BasicEvaluatedExpression[];
  454. prefix?: BasicEvaluatedExpression;
  455. postfix?: BasicEvaluatedExpression;
  456. wrappedInnerExpressions: any;
  457. identifier?: string | VariableInfoInterface;
  458. rootInfo: VariableInfoInterface;
  459. getMembers: () => string[];
  460. getMembersOptionals: () => boolean[];
  461. expression: NodeEstreeIndex;
  462. isUnknown(): boolean;
  463. isNull(): boolean;
  464. isUndefined(): boolean;
  465. isString(): boolean;
  466. isNumber(): boolean;
  467. isBigInt(): boolean;
  468. isBoolean(): boolean;
  469. isRegExp(): boolean;
  470. isConditional(): boolean;
  471. isArray(): boolean;
  472. isConstArray(): boolean;
  473. isIdentifier(): boolean;
  474. isWrapped(): boolean;
  475. isTemplateString(): boolean;
  476. /**
  477. * Is expression a primitive or an object type value?
  478. */
  479. isPrimitiveType(): undefined | boolean;
  480. /**
  481. * Is expression a runtime or compile-time value?
  482. */
  483. isCompileTimeValue(): boolean;
  484. /**
  485. * Gets the compile-time value of the expression
  486. */
  487. asCompileTimeValue(): any;
  488. isTruthy(): boolean;
  489. isFalsy(): boolean;
  490. isNullish(): undefined | boolean;
  491. /**
  492. * Can this expression have side effects?
  493. */
  494. couldHaveSideEffects(): boolean;
  495. asBool(): any;
  496. asNullish(): undefined | boolean;
  497. asString(): any;
  498. setString(string?: any): BasicEvaluatedExpression;
  499. setUndefined(): BasicEvaluatedExpression;
  500. setNull(): BasicEvaluatedExpression;
  501. setNumber(number?: any): BasicEvaluatedExpression;
  502. setBigInt(bigint?: any): BasicEvaluatedExpression;
  503. setBoolean(bool?: any): BasicEvaluatedExpression;
  504. setRegExp(regExp?: any): BasicEvaluatedExpression;
  505. setIdentifier(
  506. identifier?: any,
  507. rootInfo?: any,
  508. getMembers?: any,
  509. getMembersOptionals?: any
  510. ): BasicEvaluatedExpression;
  511. setWrapped(
  512. prefix?: any,
  513. postfix?: any,
  514. innerExpressions?: any
  515. ): BasicEvaluatedExpression;
  516. setOptions(options?: any): BasicEvaluatedExpression;
  517. addOptions(options?: any): BasicEvaluatedExpression;
  518. setItems(items?: any): BasicEvaluatedExpression;
  519. setArray(array?: any): BasicEvaluatedExpression;
  520. setTemplateString(
  521. quasis?: any,
  522. parts?: any,
  523. kind?: any
  524. ): BasicEvaluatedExpression;
  525. templateStringKind: any;
  526. setTruthy(): BasicEvaluatedExpression;
  527. setFalsy(): BasicEvaluatedExpression;
  528. setNullish(value?: any): BasicEvaluatedExpression;
  529. setRange(range?: any): BasicEvaluatedExpression;
  530. setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression;
  531. setExpression(expression?: any): BasicEvaluatedExpression;
  532. }
  533. type BuildMeta = KnownBuildMeta & Record<string, any>;
  534. declare abstract class ByTypeGenerator extends Generator {
  535. map: any;
  536. }
  537. declare const CIRCULAR_CONNECTION: unique symbol;
  538. declare class Cache {
  539. constructor();
  540. hooks: {
  541. get: AsyncSeriesBailHook<
  542. [
  543. string,
  544. null | Etag,
  545. ((result: any, callback: (arg0?: Error) => void) => void)[]
  546. ],
  547. any
  548. >;
  549. store: AsyncParallelHook<[string, null | Etag, any]>;
  550. storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
  551. beginIdle: SyncHook<[]>;
  552. endIdle: AsyncParallelHook<[]>;
  553. shutdown: AsyncParallelHook<[]>;
  554. };
  555. get<T>(
  556. identifier: string,
  557. etag: null | Etag,
  558. callback: CallbackCache<T>
  559. ): void;
  560. store<T>(
  561. identifier: string,
  562. etag: null | Etag,
  563. data: T,
  564. callback: CallbackCache<void>
  565. ): void;
  566. /**
  567. * After this method has succeeded the cache can only be restored when build dependencies are
  568. */
  569. storeBuildDependencies(
  570. dependencies: Iterable<string>,
  571. callback: CallbackCache<void>
  572. ): void;
  573. beginIdle(): void;
  574. endIdle(callback: CallbackCache<void>): void;
  575. shutdown(callback: CallbackCache<void>): void;
  576. static STAGE_MEMORY: number;
  577. static STAGE_DEFAULT: number;
  578. static STAGE_DISK: number;
  579. static STAGE_NETWORK: number;
  580. }
  581. declare abstract class CacheFacade {
  582. getChildCache(name: string): CacheFacade;
  583. getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade;
  584. getLazyHashedEtag(obj: HashableObject): Etag;
  585. mergeEtags(a: Etag, b: Etag): Etag;
  586. get<T>(
  587. identifier: string,
  588. etag: null | Etag,
  589. callback: CallbackCache<T>
  590. ): void;
  591. getPromise<T>(identifier: string, etag: null | Etag): Promise<T>;
  592. store<T>(
  593. identifier: string,
  594. etag: null | Etag,
  595. data: T,
  596. callback: CallbackCache<void>
  597. ): void;
  598. storePromise<T>(
  599. identifier: string,
  600. etag: null | Etag,
  601. data: T
  602. ): Promise<void>;
  603. provide<T>(
  604. identifier: string,
  605. etag: null | Etag,
  606. computer: (arg0: CallbackNormalErrorCache<T>) => void,
  607. callback: CallbackNormalErrorCache<T>
  608. ): void;
  609. providePromise<T>(
  610. identifier: string,
  611. etag: null | Etag,
  612. computer: () => T | Promise<T>
  613. ): Promise<T>;
  614. }
  615. declare interface CacheGroupSource {
  616. key?: string;
  617. priority?: number;
  618. getName?: (
  619. module?: Module,
  620. chunks?: Chunk[],
  621. key?: string
  622. ) => undefined | string;
  623. chunksFilter?: (chunk: Chunk) => boolean;
  624. enforce?: boolean;
  625. minSize: SplitChunksSizes;
  626. minSizeReduction: SplitChunksSizes;
  627. minRemainingSize: SplitChunksSizes;
  628. enforceSizeThreshold: SplitChunksSizes;
  629. maxAsyncSize: SplitChunksSizes;
  630. maxInitialSize: SplitChunksSizes;
  631. minChunks?: number;
  632. maxAsyncRequests?: number;
  633. maxInitialRequests?: number;
  634. filename?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  635. idHint?: string;
  636. automaticNameDelimiter: string;
  637. reuseExistingChunk?: boolean;
  638. usedExports?: boolean;
  639. }
  640. declare interface CacheGroupsContext {
  641. moduleGraph: ModuleGraph;
  642. chunkGraph: ChunkGraph;
  643. }
  644. type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions;
  645. declare class CachedSource extends Source {
  646. constructor(source: Source);
  647. constructor(source: Source | (() => Source), cachedData?: any);
  648. original(): Source;
  649. originalLazy(): Source | (() => Source);
  650. getCachedData(): any;
  651. }
  652. type CallExpression = SimpleCallExpression | NewExpression;
  653. declare interface CallExpressionInfo {
  654. type: "call";
  655. call: CallExpression;
  656. calleeName: string;
  657. rootInfo: string | VariableInfo;
  658. getCalleeMembers: () => string[];
  659. name: string;
  660. getMembers: () => string[];
  661. getMembersOptionals: () => boolean[];
  662. }
  663. declare interface CallbackAsyncQueue<T> {
  664. (err?: null | WebpackError, result?: T): any;
  665. }
  666. declare interface CallbackCache<T> {
  667. (err?: null | WebpackError, result?: T): void;
  668. }
  669. declare interface CallbackFunction<T> {
  670. (err?: null | Error, result?: T): any;
  671. }
  672. declare interface CallbackNormalErrorCache<T> {
  673. (err?: null | Error, result?: T): void;
  674. }
  675. declare interface CallbackWebpack<T> {
  676. (err?: Error, stats?: T): void;
  677. }
  678. type Cell<T> = undefined | T;
  679. declare class Chunk {
  680. constructor(name?: string, backCompat?: boolean);
  681. id: null | string | number;
  682. ids: null | (string | number)[];
  683. debugId: number;
  684. name: string;
  685. idNameHints: SortableSet<string>;
  686. preventIntegration: boolean;
  687. filenameTemplate:
  688. | null
  689. | string
  690. | ((arg0: PathData, arg1?: AssetInfo) => string);
  691. cssFilenameTemplate:
  692. | null
  693. | string
  694. | ((arg0: PathData, arg1?: AssetInfo) => string);
  695. runtime: RuntimeSpec;
  696. files: Set<string>;
  697. auxiliaryFiles: Set<string>;
  698. rendered: boolean;
  699. hash?: string;
  700. contentHash: Record<string, string>;
  701. renderedHash?: string;
  702. chunkReason?: string;
  703. extraAsync: boolean;
  704. get entryModule(): Module;
  705. hasEntryModule(): boolean;
  706. addModule(module: Module): boolean;
  707. removeModule(module: Module): void;
  708. getNumberOfModules(): number;
  709. get modulesIterable(): Iterable<Module>;
  710. compareTo(otherChunk: Chunk): 0 | 1 | -1;
  711. containsModule(module: Module): boolean;
  712. getModules(): Module[];
  713. remove(): void;
  714. moveModule(module: Module, otherChunk: Chunk): void;
  715. integrate(otherChunk: Chunk): boolean;
  716. canBeIntegrated(otherChunk: Chunk): boolean;
  717. isEmpty(): boolean;
  718. modulesSize(): number;
  719. size(options?: ChunkSizeOptions): number;
  720. integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number;
  721. getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps;
  722. hasModuleInGraph(
  723. filterFn: (m: Module) => boolean,
  724. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  725. ): boolean;
  726. getChunkMaps(realHash: boolean): ChunkMaps;
  727. hasRuntime(): boolean;
  728. canBeInitial(): boolean;
  729. isOnlyInitial(): boolean;
  730. getEntryOptions(): undefined | EntryOptions;
  731. addGroup(chunkGroup: ChunkGroup): void;
  732. removeGroup(chunkGroup: ChunkGroup): void;
  733. isInGroup(chunkGroup: ChunkGroup): boolean;
  734. getNumberOfGroups(): number;
  735. get groupsIterable(): Iterable<ChunkGroup>;
  736. disconnectFromGroups(): void;
  737. split(newChunk: Chunk): void;
  738. updateHash(hash: Hash, chunkGraph: ChunkGraph): void;
  739. getAllAsyncChunks(): Set<Chunk>;
  740. getAllInitialChunks(): Set<Chunk>;
  741. getAllReferencedChunks(): Set<Chunk>;
  742. getAllReferencedAsyncEntrypoints(): Set<Entrypoint>;
  743. hasAsyncChunks(): boolean;
  744. getChildIdsByOrders(
  745. chunkGraph: ChunkGraph,
  746. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  747. ): Record<string, (string | number)[]>;
  748. getChildrenOfTypeInOrder(
  749. chunkGraph: ChunkGraph,
  750. type: string
  751. ): { onChunks: Chunk[]; chunks: Set<Chunk> }[];
  752. getChildIdsByOrdersMap(
  753. chunkGraph: ChunkGraph,
  754. includeDirectChildren?: boolean,
  755. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  756. ): Record<string | number, Record<string, (string | number)[]>>;
  757. }
  758. declare class ChunkGraph {
  759. constructor(moduleGraph: ModuleGraph, hashFunction?: string | typeof Hash);
  760. moduleGraph: ModuleGraph;
  761. connectChunkAndModule(chunk: Chunk, module: Module): void;
  762. disconnectChunkAndModule(chunk: Chunk, module: Module): void;
  763. disconnectChunk(chunk: Chunk): void;
  764. attachModules(chunk: Chunk, modules: Iterable<Module>): void;
  765. attachRuntimeModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  766. attachFullHashModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  767. attachDependentHashModules(
  768. chunk: Chunk,
  769. modules: Iterable<RuntimeModule>
  770. ): void;
  771. replaceModule(oldModule: Module, newModule: Module): void;
  772. isModuleInChunk(module: Module, chunk: Chunk): boolean;
  773. isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean;
  774. isEntryModule(module: Module): boolean;
  775. getModuleChunksIterable(module: Module): Iterable<Chunk>;
  776. getOrderedModuleChunksIterable(
  777. module: Module,
  778. sortFn: (arg0: Chunk, arg1: Chunk) => 0 | 1 | -1
  779. ): Iterable<Chunk>;
  780. getModuleChunks(module: Module): Chunk[];
  781. getNumberOfModuleChunks(module: Module): number;
  782. getModuleRuntimes(module: Module): RuntimeSpecSet;
  783. getNumberOfChunkModules(chunk: Chunk): number;
  784. getNumberOfChunkFullHashModules(chunk: Chunk): number;
  785. getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
  786. getChunkModulesIterableBySourceType(
  787. chunk: Chunk,
  788. sourceType: string
  789. ): undefined | Iterable<Module>;
  790. setChunkModuleSourceTypes(
  791. chunk: Chunk,
  792. module: Module,
  793. sourceTypes: Set<string>
  794. ): void;
  795. getChunkModuleSourceTypes(chunk: Chunk, module: Module): Set<string>;
  796. getModuleSourceTypes(module: Module): Set<string>;
  797. getOrderedChunkModulesIterable(
  798. chunk: Chunk,
  799. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  800. ): Iterable<Module>;
  801. getOrderedChunkModulesIterableBySourceType(
  802. chunk: Chunk,
  803. sourceType: string,
  804. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  805. ): undefined | Iterable<Module>;
  806. getChunkModules(chunk: Chunk): Module[];
  807. getOrderedChunkModules(
  808. chunk: Chunk,
  809. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  810. ): Module[];
  811. getChunkModuleIdMap(
  812. chunk: Chunk,
  813. filterFn: (m: Module) => boolean,
  814. includeAllChunks?: boolean
  815. ): Record<string | number, (string | number)[]>;
  816. getChunkModuleRenderedHashMap(
  817. chunk: Chunk,
  818. filterFn: (m: Module) => boolean,
  819. hashLength?: number,
  820. includeAllChunks?: boolean
  821. ): Record<string | number, Record<string | number, string>>;
  822. getChunkConditionMap(
  823. chunk: Chunk,
  824. filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  825. ): Record<string | number, boolean>;
  826. hasModuleInGraph(
  827. chunk: Chunk,
  828. filterFn: (m: Module) => boolean,
  829. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  830. ): boolean;
  831. compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1;
  832. getChunkModulesSize(chunk: Chunk): number;
  833. getChunkModulesSizes(chunk: Chunk): Record<string, number>;
  834. getChunkRootModules(chunk: Chunk): Module[];
  835. getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number;
  836. getIntegratedChunksSize(
  837. chunkA: Chunk,
  838. chunkB: Chunk,
  839. options?: ChunkSizeOptions
  840. ): number;
  841. canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean;
  842. integrateChunks(chunkA: Chunk, chunkB: Chunk): void;
  843. upgradeDependentToFullHashModules(chunk: Chunk): void;
  844. isEntryModuleInChunk(module: Module, chunk: Chunk): boolean;
  845. connectChunkAndEntryModule(
  846. chunk: Chunk,
  847. module: Module,
  848. entrypoint?: Entrypoint
  849. ): void;
  850. connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  851. addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  852. addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  853. disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void;
  854. disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  855. disconnectEntryModule(module: Module): void;
  856. disconnectEntries(chunk: Chunk): void;
  857. getNumberOfEntryModules(chunk: Chunk): number;
  858. getNumberOfRuntimeModules(chunk: Chunk): number;
  859. getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
  860. getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
  861. hasChunkEntryDependentChunks(chunk: Chunk): boolean;
  862. getChunkRuntimeModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
  863. getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[];
  864. getChunkFullHashModulesIterable(
  865. chunk: Chunk
  866. ): undefined | Iterable<RuntimeModule>;
  867. getChunkFullHashModulesSet(
  868. chunk: Chunk
  869. ): undefined | ReadonlySet<RuntimeModule>;
  870. getChunkDependentHashModulesIterable(
  871. chunk: Chunk
  872. ): undefined | Iterable<RuntimeModule>;
  873. getChunkEntryModulesWithChunkGroupIterable(
  874. chunk: Chunk
  875. ): Iterable<[Module, undefined | Entrypoint]>;
  876. getBlockChunkGroup(depBlock: AsyncDependenciesBlock): ChunkGroup;
  877. connectBlockAndChunkGroup(
  878. depBlock: AsyncDependenciesBlock,
  879. chunkGroup: ChunkGroup
  880. ): void;
  881. disconnectChunkGroup(chunkGroup: ChunkGroup): void;
  882. getModuleId(module: Module): string | number;
  883. setModuleId(module: Module, id: string | number): void;
  884. getRuntimeId(runtime: string): string | number;
  885. setRuntimeId(runtime: string, id: string | number): void;
  886. hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
  887. getModuleHash(module: Module, runtime: RuntimeSpec): string;
  888. getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
  889. setModuleHashes(
  890. module: Module,
  891. runtime: RuntimeSpec,
  892. hash: string,
  893. renderedHash: string
  894. ): void;
  895. addModuleRuntimeRequirements(
  896. module: Module,
  897. runtime: RuntimeSpec,
  898. items: Set<string>,
  899. transferOwnership?: boolean
  900. ): void;
  901. addChunkRuntimeRequirements(chunk: Chunk, items: Set<string>): void;
  902. addTreeRuntimeRequirements(chunk: Chunk, items: Iterable<string>): void;
  903. getModuleRuntimeRequirements(
  904. module: Module,
  905. runtime: RuntimeSpec
  906. ): ReadonlySet<string>;
  907. getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  908. getModuleGraphHash(
  909. module: Module,
  910. runtime: RuntimeSpec,
  911. withConnections?: boolean
  912. ): string;
  913. getModuleGraphHashBigInt(
  914. module: Module,
  915. runtime: RuntimeSpec,
  916. withConnections?: boolean
  917. ): bigint;
  918. getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  919. static getChunkGraphForModule(
  920. module: Module,
  921. deprecateMessage: string,
  922. deprecationCode: string
  923. ): ChunkGraph;
  924. static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void;
  925. static clearChunkGraphForModule(module: Module): void;
  926. static getChunkGraphForChunk(
  927. chunk: Chunk,
  928. deprecateMessage: string,
  929. deprecationCode: string
  930. ): ChunkGraph;
  931. static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void;
  932. static clearChunkGraphForChunk(chunk: Chunk): void;
  933. }
  934. declare abstract class ChunkGroup {
  935. groupDebugId: number;
  936. options: ChunkGroupOptions;
  937. chunks: Chunk[];
  938. origins: OriginRecord[];
  939. index: number;
  940. /**
  941. * when a new chunk is added to a chunkGroup, addingOptions will occur.
  942. */
  943. addOptions(options: ChunkGroupOptions): void;
  944. /**
  945. * returns the name of current ChunkGroup
  946. * sets a new name for current ChunkGroup
  947. */
  948. name?: string;
  949. /**
  950. * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's
  951. */
  952. get debugId(): string;
  953. /**
  954. * get a unique id for ChunkGroup, made up of its member Chunk id's
  955. */
  956. get id(): string;
  957. /**
  958. * Performs an unshift of a specific chunk
  959. */
  960. unshiftChunk(chunk: Chunk): boolean;
  961. /**
  962. * inserts a chunk before another existing chunk in group
  963. */
  964. insertChunk(chunk: Chunk, before: Chunk): boolean;
  965. /**
  966. * add a chunk into ChunkGroup. Is pushed on or prepended
  967. */
  968. pushChunk(chunk: Chunk): boolean;
  969. replaceChunk(oldChunk: Chunk, newChunk: Chunk): boolean;
  970. removeChunk(chunk: Chunk): boolean;
  971. isInitial(): boolean;
  972. addChild(group: ChunkGroup): boolean;
  973. getChildren(): ChunkGroup[];
  974. getNumberOfChildren(): number;
  975. get childrenIterable(): SortableSet<ChunkGroup>;
  976. removeChild(group: ChunkGroup): boolean;
  977. addParent(parentChunk: ChunkGroup): boolean;
  978. getParents(): ChunkGroup[];
  979. getNumberOfParents(): number;
  980. hasParent(parent: ChunkGroup): boolean;
  981. get parentsIterable(): SortableSet<ChunkGroup>;
  982. removeParent(chunkGroup: ChunkGroup): boolean;
  983. addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
  984. get asyncEntrypointsIterable(): SortableSet<ChunkGroup>;
  985. getBlocks(): any[];
  986. getNumberOfBlocks(): number;
  987. hasBlock(block?: any): boolean;
  988. get blocksIterable(): Iterable<AsyncDependenciesBlock>;
  989. addBlock(block: AsyncDependenciesBlock): boolean;
  990. addOrigin(module: Module, loc: DependencyLocation, request: string): void;
  991. getFiles(): string[];
  992. remove(): void;
  993. sortItems(): void;
  994. /**
  995. * Sorting predicate which allows current ChunkGroup to be compared against another.
  996. * Sorting values are based off of number of chunks in ChunkGroup.
  997. */
  998. compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1;
  999. getChildrenByOrders(
  1000. moduleGraph: ModuleGraph,
  1001. chunkGraph: ChunkGraph
  1002. ): Record<string, ChunkGroup[]>;
  1003. /**
  1004. * Sets the top-down index of a module in this ChunkGroup
  1005. */
  1006. setModulePreOrderIndex(module: Module, index: number): void;
  1007. /**
  1008. * Gets the top-down index of a module in this ChunkGroup
  1009. */
  1010. getModulePreOrderIndex(module: Module): number;
  1011. /**
  1012. * Sets the bottom-up index of a module in this ChunkGroup
  1013. */
  1014. setModulePostOrderIndex(module: Module, index: number): void;
  1015. /**
  1016. * Gets the bottom-up index of a module in this ChunkGroup
  1017. */
  1018. getModulePostOrderIndex(module: Module): number;
  1019. checkConstraints(): void;
  1020. getModuleIndex: (module: Module) => number;
  1021. getModuleIndex2: (module: Module) => number;
  1022. }
  1023. type ChunkGroupOptions = RawChunkGroupOptions & { name?: string };
  1024. declare interface ChunkHashContext {
  1025. /**
  1026. * results of code generation
  1027. */
  1028. codeGenerationResults: CodeGenerationResults;
  1029. /**
  1030. * the runtime template
  1031. */
  1032. runtimeTemplate: RuntimeTemplate;
  1033. /**
  1034. * the module graph
  1035. */
  1036. moduleGraph: ModuleGraph;
  1037. /**
  1038. * the chunk graph
  1039. */
  1040. chunkGraph: ChunkGraph;
  1041. }
  1042. declare interface ChunkMaps {
  1043. hash: Record<string | number, string>;
  1044. contentHash: Record<string | number, Record<string, string>>;
  1045. name: Record<string | number, string>;
  1046. }
  1047. declare class ChunkModuleIdRangePlugin {
  1048. constructor(options?: any);
  1049. options: any;
  1050. /**
  1051. * Apply the plugin
  1052. */
  1053. apply(compiler: Compiler): void;
  1054. }
  1055. declare interface ChunkModuleMaps {
  1056. id: Record<string | number, (string | number)[]>;
  1057. hash: Record<string | number, string>;
  1058. }
  1059. declare interface ChunkPathData {
  1060. id: string | number;
  1061. name?: string;
  1062. hash: string;
  1063. hashWithLength?: (arg0: number) => string;
  1064. contentHash?: Record<string, string>;
  1065. contentHashWithLength?: Record<string, (length: number) => string>;
  1066. }
  1067. declare class ChunkPrefetchPreloadPlugin {
  1068. constructor();
  1069. apply(compiler: Compiler): void;
  1070. }
  1071. declare interface ChunkRenderContext {
  1072. /**
  1073. * the chunk
  1074. */
  1075. chunk: Chunk;
  1076. /**
  1077. * the dependency templates
  1078. */
  1079. dependencyTemplates: DependencyTemplates;
  1080. /**
  1081. * the runtime template
  1082. */
  1083. runtimeTemplate: RuntimeTemplate;
  1084. /**
  1085. * the module graph
  1086. */
  1087. moduleGraph: ModuleGraph;
  1088. /**
  1089. * the chunk graph
  1090. */
  1091. chunkGraph: ChunkGraph;
  1092. /**
  1093. * results of code generation
  1094. */
  1095. codeGenerationResults: CodeGenerationResults;
  1096. /**
  1097. * init fragments for the chunk
  1098. */
  1099. chunkInitFragments: InitFragment<ChunkRenderContext>[];
  1100. /**
  1101. * rendering in strict context
  1102. */
  1103. strictMode: boolean;
  1104. }
  1105. declare interface ChunkSizeOptions {
  1106. /**
  1107. * constant overhead for a chunk
  1108. */
  1109. chunkOverhead?: number;
  1110. /**
  1111. * multiplicator for initial chunks
  1112. */
  1113. entryChunkMultiplicator?: number;
  1114. }
  1115. declare abstract class ChunkTemplate {
  1116. hooks: Readonly<{
  1117. renderManifest: { tap: (options?: any, fn?: any) => void };
  1118. modules: { tap: (options?: any, fn?: any) => void };
  1119. render: { tap: (options?: any, fn?: any) => void };
  1120. renderWithEntry: { tap: (options?: any, fn?: any) => void };
  1121. hash: { tap: (options?: any, fn?: any) => void };
  1122. hashForChunk: { tap: (options?: any, fn?: any) => void };
  1123. }>;
  1124. get outputOptions(): Output;
  1125. }
  1126. /**
  1127. * Advanced options for cleaning assets.
  1128. */
  1129. declare interface CleanOptions {
  1130. /**
  1131. * Log the assets that should be removed instead of deleting them.
  1132. */
  1133. dry?: boolean;
  1134. /**
  1135. * Keep these assets.
  1136. */
  1137. keep?: string | RegExp | ((filename: string) => boolean);
  1138. }
  1139. declare class CleanPlugin {
  1140. constructor(options?: CleanOptions);
  1141. options: {
  1142. /**
  1143. * Log the assets that should be removed instead of deleting them.
  1144. */
  1145. dry: boolean;
  1146. /**
  1147. * Keep these assets.
  1148. */
  1149. keep?: string | RegExp | ((filename: string) => boolean);
  1150. };
  1151. /**
  1152. * Apply the plugin
  1153. */
  1154. apply(compiler: Compiler): void;
  1155. static getCompilationHooks(
  1156. compilation: Compilation
  1157. ): CleanPluginCompilationHooks;
  1158. }
  1159. declare interface CleanPluginCompilationHooks {
  1160. /**
  1161. * when returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config
  1162. */
  1163. keep: SyncBailHook<[string], boolean>;
  1164. }
  1165. declare interface CodeGenerationContext {
  1166. /**
  1167. * the dependency templates
  1168. */
  1169. dependencyTemplates: DependencyTemplates;
  1170. /**
  1171. * the runtime template
  1172. */
  1173. runtimeTemplate: RuntimeTemplate;
  1174. /**
  1175. * the module graph
  1176. */
  1177. moduleGraph: ModuleGraph;
  1178. /**
  1179. * the chunk graph
  1180. */
  1181. chunkGraph: ChunkGraph;
  1182. /**
  1183. * the runtimes code should be generated for
  1184. */
  1185. runtime: RuntimeSpec;
  1186. /**
  1187. * when in concatenated module, information about other concatenated modules
  1188. */
  1189. concatenationScope?: ConcatenationScope;
  1190. /**
  1191. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  1192. */
  1193. codeGenerationResults: CodeGenerationResults;
  1194. /**
  1195. * the compilation
  1196. */
  1197. compilation?: Compilation;
  1198. /**
  1199. * source types
  1200. */
  1201. sourceTypes?: ReadonlySet<string>;
  1202. }
  1203. declare interface CodeGenerationResult {
  1204. /**
  1205. * the resulting sources for all source types
  1206. */
  1207. sources: Map<string, Source>;
  1208. /**
  1209. * the resulting data for all source types
  1210. */
  1211. data?: Map<string, any>;
  1212. /**
  1213. * the runtime requirements
  1214. */
  1215. runtimeRequirements: ReadonlySet<string>;
  1216. /**
  1217. * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
  1218. */
  1219. hash?: string;
  1220. }
  1221. declare abstract class CodeGenerationResults {
  1222. map: Map<Module, RuntimeSpecMap<CodeGenerationResult>>;
  1223. get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
  1224. has(module: Module, runtime: RuntimeSpec): boolean;
  1225. getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source;
  1226. getRuntimeRequirements(
  1227. module: Module,
  1228. runtime: RuntimeSpec
  1229. ): ReadonlySet<string>;
  1230. getData(module: Module, runtime: RuntimeSpec, key: string): any;
  1231. getHash(module: Module, runtime: RuntimeSpec): any;
  1232. add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void;
  1233. }
  1234. type CodeValue =
  1235. | undefined
  1236. | null
  1237. | string
  1238. | number
  1239. | bigint
  1240. | boolean
  1241. | Function
  1242. | RegExp
  1243. | RuntimeValue
  1244. | {
  1245. [index: string]: RecursiveArrayOrRecord<
  1246. | undefined
  1247. | null
  1248. | string
  1249. | number
  1250. | bigint
  1251. | boolean
  1252. | Function
  1253. | RegExp
  1254. | RuntimeValue
  1255. >;
  1256. }
  1257. | RecursiveArrayOrRecord<
  1258. | undefined
  1259. | null
  1260. | string
  1261. | number
  1262. | bigint
  1263. | boolean
  1264. | Function
  1265. | RegExp
  1266. | RuntimeValue
  1267. >[];
  1268. type CodeValuePrimitive =
  1269. | undefined
  1270. | null
  1271. | string
  1272. | number
  1273. | bigint
  1274. | boolean
  1275. | Function
  1276. | RegExp;
  1277. declare interface Comparator<T> {
  1278. (arg0: T, arg1: T): 0 | 1 | -1;
  1279. }
  1280. declare class CompatSource extends Source {
  1281. constructor(sourceLike: SourceLike);
  1282. static from(sourceLike: SourceLike): Source;
  1283. }
  1284. declare class Compilation {
  1285. /**
  1286. * Creates an instance of Compilation.
  1287. */
  1288. constructor(compiler: Compiler, params: CompilationParams);
  1289. hooks: Readonly<{
  1290. buildModule: SyncHook<[Module]>;
  1291. rebuildModule: SyncHook<[Module]>;
  1292. failedModule: SyncHook<[Module, WebpackError]>;
  1293. succeedModule: SyncHook<[Module]>;
  1294. stillValidModule: SyncHook<[Module]>;
  1295. addEntry: SyncHook<[Dependency, EntryOptions]>;
  1296. failedEntry: SyncHook<[Dependency, EntryOptions, Error]>;
  1297. succeedEntry: SyncHook<[Dependency, EntryOptions, Module]>;
  1298. dependencyReferencedExports: SyncWaterfallHook<
  1299. [(string[] | ReferencedExport)[], Dependency, RuntimeSpec]
  1300. >;
  1301. executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>;
  1302. prepareModuleExecution: AsyncParallelHook<
  1303. [ExecuteModuleArgument, ExecuteModuleContext]
  1304. >;
  1305. finishModules: AsyncSeriesHook<[Iterable<Module>]>;
  1306. finishRebuildingModule: AsyncSeriesHook<[Module]>;
  1307. unseal: SyncHook<[]>;
  1308. seal: SyncHook<[]>;
  1309. beforeChunks: SyncHook<[]>;
  1310. afterChunks: SyncHook<[Iterable<Chunk>]>;
  1311. optimizeDependencies: SyncBailHook<[Iterable<Module>], any>;
  1312. afterOptimizeDependencies: SyncHook<[Iterable<Module>]>;
  1313. optimize: SyncHook<[]>;
  1314. optimizeModules: SyncBailHook<[Iterable<Module>], any>;
  1315. afterOptimizeModules: SyncHook<[Iterable<Module>]>;
  1316. optimizeChunks: SyncBailHook<[Iterable<Chunk>, ChunkGroup[]], any>;
  1317. afterOptimizeChunks: SyncHook<[Iterable<Chunk>, ChunkGroup[]]>;
  1318. optimizeTree: AsyncSeriesHook<[Iterable<Chunk>, Iterable<Module>]>;
  1319. afterOptimizeTree: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1320. optimizeChunkModules: AsyncSeriesBailHook<
  1321. [Iterable<Chunk>, Iterable<Module>],
  1322. any
  1323. >;
  1324. afterOptimizeChunkModules: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1325. shouldRecord: SyncBailHook<[], boolean>;
  1326. additionalChunkRuntimeRequirements: SyncHook<
  1327. [Chunk, Set<string>, RuntimeRequirementsContext]
  1328. >;
  1329. runtimeRequirementInChunk: HookMap<
  1330. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], any>
  1331. >;
  1332. additionalModuleRuntimeRequirements: SyncHook<
  1333. [Module, Set<string>, RuntimeRequirementsContext]
  1334. >;
  1335. runtimeRequirementInModule: HookMap<
  1336. SyncBailHook<[Module, Set<string>, RuntimeRequirementsContext], any>
  1337. >;
  1338. additionalTreeRuntimeRequirements: SyncHook<
  1339. [Chunk, Set<string>, RuntimeRequirementsContext]
  1340. >;
  1341. runtimeRequirementInTree: HookMap<
  1342. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], any>
  1343. >;
  1344. runtimeModule: SyncHook<[RuntimeModule, Chunk]>;
  1345. reviveModules: SyncHook<[Iterable<Module>, any]>;
  1346. beforeModuleIds: SyncHook<[Iterable<Module>]>;
  1347. moduleIds: SyncHook<[Iterable<Module>]>;
  1348. optimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1349. afterOptimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1350. reviveChunks: SyncHook<[Iterable<Chunk>, any]>;
  1351. beforeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1352. chunkIds: SyncHook<[Iterable<Chunk>]>;
  1353. optimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1354. afterOptimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1355. recordModules: SyncHook<[Iterable<Module>, any]>;
  1356. recordChunks: SyncHook<[Iterable<Chunk>, any]>;
  1357. optimizeCodeGeneration: SyncHook<[Iterable<Module>]>;
  1358. beforeModuleHash: SyncHook<[]>;
  1359. afterModuleHash: SyncHook<[]>;
  1360. beforeCodeGeneration: SyncHook<[]>;
  1361. afterCodeGeneration: SyncHook<[]>;
  1362. beforeRuntimeRequirements: SyncHook<[]>;
  1363. afterRuntimeRequirements: SyncHook<[]>;
  1364. beforeHash: SyncHook<[]>;
  1365. contentHash: SyncHook<[Chunk]>;
  1366. afterHash: SyncHook<[]>;
  1367. recordHash: SyncHook<[any]>;
  1368. record: SyncHook<[Compilation, any]>;
  1369. beforeModuleAssets: SyncHook<[]>;
  1370. shouldGenerateChunkAssets: SyncBailHook<[], boolean>;
  1371. beforeChunkAssets: SyncHook<[]>;
  1372. additionalChunkAssets: FakeHook<
  1373. Pick<
  1374. AsyncSeriesHook<[Set<Chunk>]>,
  1375. "name" | "tap" | "tapAsync" | "tapPromise"
  1376. >
  1377. >;
  1378. additionalAssets: FakeHook<
  1379. Pick<AsyncSeriesHook<[]>, "name" | "tap" | "tapAsync" | "tapPromise">
  1380. >;
  1381. optimizeChunkAssets: FakeHook<
  1382. Pick<
  1383. AsyncSeriesHook<[Set<Chunk>]>,
  1384. "name" | "tap" | "tapAsync" | "tapPromise"
  1385. >
  1386. >;
  1387. afterOptimizeChunkAssets: FakeHook<
  1388. Pick<
  1389. AsyncSeriesHook<[Set<Chunk>]>,
  1390. "name" | "tap" | "tapAsync" | "tapPromise"
  1391. >
  1392. >;
  1393. optimizeAssets: AsyncSeriesHook<
  1394. [CompilationAssets],
  1395. ProcessAssetsAdditionalOptions
  1396. >;
  1397. afterOptimizeAssets: SyncHook<[CompilationAssets]>;
  1398. processAssets: AsyncSeriesHook<
  1399. [CompilationAssets],
  1400. ProcessAssetsAdditionalOptions
  1401. >;
  1402. afterProcessAssets: SyncHook<[CompilationAssets]>;
  1403. processAdditionalAssets: AsyncSeriesHook<[CompilationAssets]>;
  1404. needAdditionalSeal: SyncBailHook<[], boolean>;
  1405. afterSeal: AsyncSeriesHook<[]>;
  1406. renderManifest: SyncWaterfallHook<
  1407. [RenderManifestEntry[], RenderManifestOptions]
  1408. >;
  1409. fullHash: SyncHook<[Hash]>;
  1410. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  1411. moduleAsset: SyncHook<[Module, string]>;
  1412. chunkAsset: SyncHook<[Chunk, string]>;
  1413. assetPath: SyncWaterfallHook<[string, object, AssetInfo]>;
  1414. needAdditionalPass: SyncBailHook<[], boolean>;
  1415. childCompiler: SyncHook<[Compiler, string, number]>;
  1416. log: SyncBailHook<[string, LogEntry], true>;
  1417. processWarnings: SyncWaterfallHook<[WebpackError[]]>;
  1418. processErrors: SyncWaterfallHook<[WebpackError[]]>;
  1419. statsPreset: HookMap<
  1420. SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>
  1421. >;
  1422. statsNormalize: SyncHook<
  1423. [Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]
  1424. >;
  1425. statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
  1426. statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
  1427. get normalModuleLoader(): SyncHook<[object, NormalModule]>;
  1428. }>;
  1429. name?: string;
  1430. startTime: any;
  1431. endTime: any;
  1432. compiler: Compiler;
  1433. resolverFactory: ResolverFactory;
  1434. inputFileSystem: InputFileSystem;
  1435. fileSystemInfo: FileSystemInfo;
  1436. valueCacheVersions: Map<string, string | Set<string>>;
  1437. requestShortener: RequestShortener;
  1438. compilerPath: string;
  1439. logger: WebpackLogger;
  1440. options: WebpackOptionsNormalized;
  1441. outputOptions: OutputNormalized;
  1442. bail: boolean;
  1443. profile: boolean;
  1444. params: CompilationParams;
  1445. mainTemplate: MainTemplate;
  1446. chunkTemplate: ChunkTemplate;
  1447. runtimeTemplate: RuntimeTemplate;
  1448. moduleTemplates: { javascript: ModuleTemplate };
  1449. moduleMemCaches?: Map<Module, WeakTupleMap<any, any>>;
  1450. moduleMemCaches2?: Map<Module, WeakTupleMap<any, any>>;
  1451. moduleGraph: ModuleGraph;
  1452. chunkGraph: ChunkGraph;
  1453. codeGenerationResults: CodeGenerationResults;
  1454. processDependenciesQueue: AsyncQueue<Module, Module, Module>;
  1455. addModuleQueue: AsyncQueue<Module, string, Module>;
  1456. factorizeQueue: AsyncQueue<
  1457. FactorizeModuleOptions,
  1458. string,
  1459. Module | ModuleFactoryResult
  1460. >;
  1461. buildQueue: AsyncQueue<Module, Module, Module>;
  1462. rebuildQueue: AsyncQueue<Module, Module, Module>;
  1463. /**
  1464. * Modules in value are building during the build of Module in key.
  1465. * Means value blocking key from finishing.
  1466. * Needed to detect build cycles.
  1467. */
  1468. creatingModuleDuringBuild: WeakMap<Module, Set<Module>>;
  1469. entries: Map<string, EntryData>;
  1470. globalEntry: EntryData;
  1471. entrypoints: Map<string, Entrypoint>;
  1472. asyncEntrypoints: Entrypoint[];
  1473. chunks: Set<Chunk>;
  1474. chunkGroups: ChunkGroup[];
  1475. namedChunkGroups: Map<string, ChunkGroup>;
  1476. namedChunks: Map<string, Chunk>;
  1477. modules: Set<Module>;
  1478. records: any;
  1479. additionalChunkAssets: string[];
  1480. assets: CompilationAssets;
  1481. assetsInfo: Map<string, AssetInfo>;
  1482. errors: WebpackError[];
  1483. warnings: WebpackError[];
  1484. children: Compilation[];
  1485. logging: Map<string, LogEntry[]>;
  1486. dependencyFactories: Map<DepConstructor, ModuleFactory>;
  1487. dependencyTemplates: DependencyTemplates;
  1488. childrenCounters: object;
  1489. usedChunkIds: Set<string | number>;
  1490. usedModuleIds: Set<number>;
  1491. needAdditionalPass: boolean;
  1492. builtModules: WeakSet<Module>;
  1493. codeGeneratedModules: WeakSet<Module>;
  1494. buildTimeExecutedModules: WeakSet<Module>;
  1495. emittedAssets: Set<string>;
  1496. comparedForEmitAssets: Set<string>;
  1497. fileDependencies: LazySet<string>;
  1498. contextDependencies: LazySet<string>;
  1499. missingDependencies: LazySet<string>;
  1500. buildDependencies: LazySet<string>;
  1501. compilationDependencies: { add: (item?: any) => LazySet<string> };
  1502. getStats(): Stats;
  1503. createStatsOptions(
  1504. optionsOrPreset: string | StatsOptions,
  1505. context?: CreateStatsOptionsContext
  1506. ): NormalizedStatsOptions;
  1507. createStatsFactory(options?: any): StatsFactory;
  1508. createStatsPrinter(options?: any): StatsPrinter;
  1509. getCache(name: string): CacheFacade;
  1510. getLogger(name: string | (() => string)): WebpackLogger;
  1511. addModule(
  1512. module: Module,
  1513. callback: (err?: null | WebpackError, result?: Module) => void
  1514. ): void;
  1515. /**
  1516. * Fetches a module from a compilation by its identifier
  1517. */
  1518. getModule(module: Module): Module;
  1519. /**
  1520. * Attempts to search for a module by its identifier
  1521. */
  1522. findModule(identifier: string): undefined | Module;
  1523. /**
  1524. * Schedules a build of the module object
  1525. */
  1526. buildModule(
  1527. module: Module,
  1528. callback: (err?: null | WebpackError, result?: Module) => void
  1529. ): void;
  1530. processModuleDependencies(
  1531. module: Module,
  1532. callback: (err?: null | WebpackError, result?: Module) => void
  1533. ): void;
  1534. processModuleDependenciesNonRecursive(module: Module): void;
  1535. handleModuleCreation(
  1536. __0: HandleModuleCreationOptions,
  1537. callback: (err?: null | WebpackError, result?: Module) => void
  1538. ): void;
  1539. addModuleChain(
  1540. context: string,
  1541. dependency: Dependency,
  1542. callback: (err?: null | WebpackError, result?: Module) => void
  1543. ): void;
  1544. addModuleTree(
  1545. __0: {
  1546. /**
  1547. * context string path
  1548. */
  1549. context: string;
  1550. /**
  1551. * dependency used to create Module chain
  1552. */
  1553. dependency: Dependency;
  1554. /**
  1555. * additional context info for the root module
  1556. */
  1557. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  1558. },
  1559. callback: (err?: null | WebpackError, result?: Module) => void
  1560. ): void;
  1561. addEntry(
  1562. context: string,
  1563. entry: Dependency,
  1564. optionsOrName: string | EntryOptions,
  1565. callback: (err?: null | WebpackError, result?: Module) => void
  1566. ): void;
  1567. addInclude(
  1568. context: string,
  1569. dependency: Dependency,
  1570. options: EntryOptions,
  1571. callback: (err?: null | WebpackError, result?: Module) => void
  1572. ): void;
  1573. rebuildModule(
  1574. module: Module,
  1575. callback: (err?: null | WebpackError, result?: Module) => void
  1576. ): void;
  1577. finish(callback?: any): void;
  1578. unseal(): void;
  1579. seal(callback: (err?: null | WebpackError) => void): void;
  1580. reportDependencyErrorsAndWarnings(
  1581. module: Module,
  1582. blocks: DependenciesBlock[]
  1583. ): boolean;
  1584. codeGeneration(callback?: any): void;
  1585. processRuntimeRequirements(__0?: {
  1586. /**
  1587. * the chunk graph
  1588. */
  1589. chunkGraph?: ChunkGraph;
  1590. /**
  1591. * modules
  1592. */
  1593. modules?: Iterable<Module>;
  1594. /**
  1595. * chunks
  1596. */
  1597. chunks?: Iterable<Chunk>;
  1598. /**
  1599. * codeGenerationResults
  1600. */
  1601. codeGenerationResults?: CodeGenerationResults;
  1602. /**
  1603. * chunkGraphEntries
  1604. */
  1605. chunkGraphEntries?: Iterable<Chunk>;
  1606. }): void;
  1607. addRuntimeModule(
  1608. chunk: Chunk,
  1609. module: RuntimeModule,
  1610. chunkGraph?: ChunkGraph
  1611. ): void;
  1612. /**
  1613. * If `module` is passed, `loc` and `request` must also be passed.
  1614. */
  1615. addChunkInGroup(
  1616. groupOptions: string | ChunkGroupOptions,
  1617. module?: Module,
  1618. loc?: SyntheticDependencyLocation | RealDependencyLocation,
  1619. request?: string
  1620. ): ChunkGroup;
  1621. addAsyncEntrypoint(
  1622. options: EntryOptions,
  1623. module: Module,
  1624. loc: DependencyLocation,
  1625. request: string
  1626. ): Entrypoint;
  1627. /**
  1628. * This method first looks to see if a name is provided for a new chunk,
  1629. * and first looks to see if any named chunks already exist and reuse that chunk instead.
  1630. */
  1631. addChunk(name?: string): Chunk;
  1632. assignDepth(module: Module): void;
  1633. assignDepths(modules: Set<Module>): void;
  1634. getDependencyReferencedExports(
  1635. dependency: Dependency,
  1636. runtime: RuntimeSpec
  1637. ): (string[] | ReferencedExport)[];
  1638. removeReasonsOfDependencyBlock(
  1639. module: Module,
  1640. block: DependenciesBlockLike
  1641. ): void;
  1642. patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void;
  1643. removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void;
  1644. assignRuntimeIds(): void;
  1645. sortItemsWithChunkIds(): void;
  1646. summarizeDependencies(): void;
  1647. createModuleHashes(): void;
  1648. createHash(): {
  1649. module: Module;
  1650. hash: string;
  1651. runtime: RuntimeSpec;
  1652. runtimes: RuntimeSpec[];
  1653. }[];
  1654. fullHash?: string;
  1655. hash?: string;
  1656. emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
  1657. updateAsset(
  1658. file: string,
  1659. newSourceOrFunction: Source | ((arg0: Source) => Source),
  1660. assetInfoUpdateOrFunction?: AssetInfo | ((arg0?: AssetInfo) => AssetInfo)
  1661. ): void;
  1662. renameAsset(file?: any, newFile?: any): void;
  1663. deleteAsset(file: string): void;
  1664. getAssets(): Readonly<Asset>[];
  1665. getAsset(name: string): undefined | Readonly<Asset>;
  1666. clearAssets(): void;
  1667. createModuleAssets(): void;
  1668. getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
  1669. createChunkAssets(callback: (err?: null | WebpackError) => void): void;
  1670. getPath(
  1671. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1672. data?: PathData
  1673. ): string;
  1674. getPathWithInfo(
  1675. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1676. data?: PathData
  1677. ): { path: string; info: AssetInfo };
  1678. getAssetPath(
  1679. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1680. data: PathData
  1681. ): string;
  1682. getAssetPathWithInfo(
  1683. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1684. data: PathData
  1685. ): { path: string; info: AssetInfo };
  1686. getWarnings(): WebpackError[];
  1687. getErrors(): WebpackError[];
  1688. /**
  1689. * This function allows you to run another instance of webpack inside of webpack however as
  1690. * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins
  1691. * from parent (or top level compiler) and creates a child Compilation
  1692. */
  1693. createChildCompiler(
  1694. name: string,
  1695. outputOptions?: OutputNormalized,
  1696. plugins?: (
  1697. | ((this: Compiler, compiler: Compiler) => void)
  1698. | WebpackPluginInstance
  1699. )[]
  1700. ): Compiler;
  1701. executeModule(
  1702. module: Module,
  1703. options: ExecuteModuleOptions,
  1704. callback: (err?: null | WebpackError, result?: ExecuteModuleResult) => void
  1705. ): void;
  1706. checkConstraints(): void;
  1707. factorizeModule: {
  1708. (
  1709. options: FactorizeModuleOptions & { factoryResult?: false },
  1710. callback: (err?: null | WebpackError, result?: Module) => void
  1711. ): void;
  1712. (
  1713. options: FactorizeModuleOptions & { factoryResult: true },
  1714. callback: (
  1715. err?: null | WebpackError,
  1716. result?: ModuleFactoryResult
  1717. ) => void
  1718. ): void;
  1719. };
  1720. /**
  1721. * Add additional assets to the compilation.
  1722. */
  1723. static PROCESS_ASSETS_STAGE_ADDITIONAL: number;
  1724. /**
  1725. * Basic preprocessing of assets.
  1726. */
  1727. static PROCESS_ASSETS_STAGE_PRE_PROCESS: number;
  1728. /**
  1729. * Derive new assets from existing assets.
  1730. * Existing assets should not be treated as complete.
  1731. */
  1732. static PROCESS_ASSETS_STAGE_DERIVED: number;
  1733. /**
  1734. * Add additional sections to existing assets, like a banner or initialization code.
  1735. */
  1736. static PROCESS_ASSETS_STAGE_ADDITIONS: number;
  1737. /**
  1738. * Optimize existing assets in a general way.
  1739. */
  1740. static PROCESS_ASSETS_STAGE_OPTIMIZE: number;
  1741. /**
  1742. * Optimize the count of existing assets, e. g. by merging them.
  1743. * Only assets of the same type should be merged.
  1744. * For assets of different types see PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE.
  1745. */
  1746. static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number;
  1747. /**
  1748. * Optimize the compatibility of existing assets, e. g. add polyfills or vendor-prefixes.
  1749. */
  1750. static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number;
  1751. /**
  1752. * Optimize the size of existing assets, e. g. by minimizing or omitting whitespace.
  1753. */
  1754. static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number;
  1755. /**
  1756. * Add development tooling to assets, e. g. by extracting a SourceMap.
  1757. */
  1758. static PROCESS_ASSETS_STAGE_DEV_TOOLING: number;
  1759. /**
  1760. * Optimize the count of existing assets, e. g. by inlining assets of into other assets.
  1761. * Only assets of different types should be inlined.
  1762. * For assets of the same type see PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT.
  1763. */
  1764. static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number;
  1765. /**
  1766. * Summarize the list of existing assets
  1767. * e. g. creating an assets manifest of Service Workers.
  1768. */
  1769. static PROCESS_ASSETS_STAGE_SUMMARIZE: number;
  1770. /**
  1771. * Optimize the hashes of the assets, e. g. by generating real hashes of the asset content.
  1772. */
  1773. static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number;
  1774. /**
  1775. * Optimize the transfer of existing assets, e. g. by preparing a compressed (gzip) file as separate asset.
  1776. */
  1777. static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number;
  1778. /**
  1779. * Analyse existing assets.
  1780. */
  1781. static PROCESS_ASSETS_STAGE_ANALYSE: number;
  1782. /**
  1783. * Creating assets for reporting purposes.
  1784. */
  1785. static PROCESS_ASSETS_STAGE_REPORT: number;
  1786. }
  1787. declare interface CompilationAssets {
  1788. [index: string]: Source;
  1789. }
  1790. declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
  1791. renderModuleContent: SyncWaterfallHook<
  1792. [Source, Module, WebAssemblyRenderContext]
  1793. >;
  1794. }
  1795. declare interface CompilationHooksJavascriptModulesPlugin {
  1796. renderModuleContent: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
  1797. renderModuleContainer: SyncWaterfallHook<
  1798. [Source, Module, ChunkRenderContext]
  1799. >;
  1800. renderModulePackage: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
  1801. renderChunk: SyncWaterfallHook<[Source, RenderContext]>;
  1802. renderMain: SyncWaterfallHook<[Source, RenderContext]>;
  1803. renderContent: SyncWaterfallHook<[Source, RenderContext]>;
  1804. render: SyncWaterfallHook<[Source, RenderContext]>;
  1805. renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
  1806. renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
  1807. inlineInRuntimeBailout: SyncBailHook<
  1808. [Module, RenderBootstrapContext],
  1809. string
  1810. >;
  1811. embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string>;
  1812. strictRuntimeBailout: SyncBailHook<[RenderContext], string>;
  1813. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  1814. useSourceMap: SyncBailHook<[Chunk, RenderContext], boolean>;
  1815. }
  1816. declare interface CompilationHooksRealContentHashPlugin {
  1817. updateHash: SyncBailHook<[Buffer[], string], string>;
  1818. }
  1819. declare interface CompilationParams {
  1820. normalModuleFactory: NormalModuleFactory;
  1821. contextModuleFactory: ContextModuleFactory;
  1822. }
  1823. declare class Compiler {
  1824. constructor(context: string, options?: WebpackOptionsNormalized);
  1825. hooks: Readonly<{
  1826. initialize: SyncHook<[]>;
  1827. shouldEmit: SyncBailHook<[Compilation], boolean>;
  1828. done: AsyncSeriesHook<[Stats]>;
  1829. afterDone: SyncHook<[Stats]>;
  1830. additionalPass: AsyncSeriesHook<[]>;
  1831. beforeRun: AsyncSeriesHook<[Compiler]>;
  1832. run: AsyncSeriesHook<[Compiler]>;
  1833. emit: AsyncSeriesHook<[Compilation]>;
  1834. assetEmitted: AsyncSeriesHook<[string, AssetEmittedInfo]>;
  1835. afterEmit: AsyncSeriesHook<[Compilation]>;
  1836. thisCompilation: SyncHook<[Compilation, CompilationParams]>;
  1837. compilation: SyncHook<[Compilation, CompilationParams]>;
  1838. normalModuleFactory: SyncHook<[NormalModuleFactory]>;
  1839. contextModuleFactory: SyncHook<[ContextModuleFactory]>;
  1840. beforeCompile: AsyncSeriesHook<[CompilationParams]>;
  1841. compile: SyncHook<[CompilationParams]>;
  1842. make: AsyncParallelHook<[Compilation]>;
  1843. finishMake: AsyncParallelHook<[Compilation]>;
  1844. afterCompile: AsyncSeriesHook<[Compilation]>;
  1845. readRecords: AsyncSeriesHook<[]>;
  1846. emitRecords: AsyncSeriesHook<[]>;
  1847. watchRun: AsyncSeriesHook<[Compiler]>;
  1848. failed: SyncHook<[Error]>;
  1849. invalid: SyncHook<[null | string, number]>;
  1850. watchClose: SyncHook<[]>;
  1851. shutdown: AsyncSeriesHook<[]>;
  1852. infrastructureLog: SyncBailHook<[string, string, any[]], true>;
  1853. environment: SyncHook<[]>;
  1854. afterEnvironment: SyncHook<[]>;
  1855. afterPlugins: SyncHook<[Compiler]>;
  1856. afterResolvers: SyncHook<[Compiler]>;
  1857. entryOption: SyncBailHook<[string, EntryNormalized], boolean>;
  1858. }>;
  1859. webpack: typeof exports;
  1860. name?: string;
  1861. parentCompilation?: Compilation;
  1862. root: Compiler;
  1863. outputPath: string;
  1864. watching: Watching;
  1865. outputFileSystem: OutputFileSystem;
  1866. intermediateFileSystem: IntermediateFileSystem;
  1867. inputFileSystem: InputFileSystem;
  1868. watchFileSystem: WatchFileSystem;
  1869. recordsInputPath: null | string;
  1870. recordsOutputPath: null | string;
  1871. records: object;
  1872. managedPaths: Set<string | RegExp>;
  1873. immutablePaths: Set<string | RegExp>;
  1874. modifiedFiles: ReadonlySet<string>;
  1875. removedFiles: ReadonlySet<string>;
  1876. fileTimestamps: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
  1877. contextTimestamps: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
  1878. fsStartTime: number;
  1879. resolverFactory: ResolverFactory;
  1880. infrastructureLogger: any;
  1881. options: WebpackOptionsNormalized;
  1882. context: string;
  1883. requestShortener: RequestShortener;
  1884. cache: Cache;
  1885. moduleMemCaches?: Map<
  1886. Module,
  1887. {
  1888. buildInfo: object;
  1889. references: WeakMap<Dependency, Module>;
  1890. memCache: WeakTupleMap<any, any>;
  1891. }
  1892. >;
  1893. compilerPath: string;
  1894. running: boolean;
  1895. idle: boolean;
  1896. watchMode: boolean;
  1897. getCache(name: string): CacheFacade;
  1898. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  1899. watch(watchOptions: WatchOptions, handler: CallbackFunction<Stats>): Watching;
  1900. run(callback: CallbackFunction<Stats>): void;
  1901. runAsChild(
  1902. callback: (
  1903. err?: null | Error,
  1904. entries?: Chunk[],
  1905. compilation?: Compilation
  1906. ) => any
  1907. ): void;
  1908. purgeInputFileSystem(): void;
  1909. emitAssets(compilation: Compilation, callback: CallbackFunction<void>): void;
  1910. emitRecords(callback: CallbackFunction<void>): void;
  1911. readRecords(callback: CallbackFunction<void>): void;
  1912. createChildCompiler(
  1913. compilation: Compilation,
  1914. compilerName: string,
  1915. compilerIndex: number,
  1916. outputOptions?: OutputNormalized,
  1917. plugins?: WebpackPluginInstance[]
  1918. ): Compiler;
  1919. isChild(): boolean;
  1920. createCompilation(params?: any): Compilation;
  1921. newCompilation(params: CompilationParams): Compilation;
  1922. createNormalModuleFactory(): NormalModuleFactory;
  1923. createContextModuleFactory(): ContextModuleFactory;
  1924. newCompilationParams(): {
  1925. normalModuleFactory: NormalModuleFactory;
  1926. contextModuleFactory: ContextModuleFactory;
  1927. };
  1928. compile(callback: CallbackFunction<Compilation>): void;
  1929. close(callback: CallbackFunction<void>): void;
  1930. }
  1931. declare class ConcatSource extends Source {
  1932. constructor(...args: (string | Source)[]);
  1933. getChildren(): Source[];
  1934. add(item: string | Source): void;
  1935. addAllSkipOptimizing(items: Source[]): void;
  1936. }
  1937. declare interface ConcatenatedModuleInfo {
  1938. index: number;
  1939. module: Module;
  1940. /**
  1941. * mapping from export name to symbol
  1942. */
  1943. exportMap: Map<string, string>;
  1944. /**
  1945. * mapping from export name to symbol
  1946. */
  1947. rawExportMap: Map<string, string>;
  1948. namespaceExportSymbol?: string;
  1949. }
  1950. declare interface ConcatenationBailoutReasonContext {
  1951. /**
  1952. * the module graph
  1953. */
  1954. moduleGraph: ModuleGraph;
  1955. /**
  1956. * the chunk graph
  1957. */
  1958. chunkGraph: ChunkGraph;
  1959. }
  1960. declare class ConcatenationScope {
  1961. constructor(
  1962. modulesMap: ModuleInfo[] | Map<Module, ModuleInfo>,
  1963. currentModule: ConcatenatedModuleInfo
  1964. );
  1965. isModuleInScope(module: Module): boolean;
  1966. registerExport(exportName: string, symbol: string): void;
  1967. registerRawExport(exportName: string, expression: string): void;
  1968. registerNamespaceExport(symbol: string): void;
  1969. createModuleReference(
  1970. module: Module,
  1971. __1: Partial<ModuleReferenceOptions>
  1972. ): string;
  1973. static isModuleReference(name: string): boolean;
  1974. static matchModuleReference(
  1975. name: string
  1976. ): ModuleReferenceOptions & { index: number };
  1977. static DEFAULT_EXPORT: string;
  1978. static NAMESPACE_OBJECT_EXPORT: string;
  1979. }
  1980. /**
  1981. * Options object as provided by the user.
  1982. */
  1983. declare interface Configuration {
  1984. /**
  1985. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  1986. */
  1987. amd?: false | { [index: string]: any };
  1988. /**
  1989. * Report the first error as a hard error instead of tolerating it.
  1990. */
  1991. bail?: boolean;
  1992. /**
  1993. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  1994. */
  1995. cache?: boolean | FileCacheOptions | MemoryCacheOptions;
  1996. /**
  1997. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  1998. */
  1999. context?: string;
  2000. /**
  2001. * References to other configurations to depend on.
  2002. */
  2003. dependencies?: string[];
  2004. /**
  2005. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  2006. */
  2007. devtool?: string | false;
  2008. /**
  2009. * The entry point(s) of the compilation.
  2010. */
  2011. entry?:
  2012. | string
  2013. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  2014. | EntryObject
  2015. | string[];
  2016. /**
  2017. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  2018. */
  2019. experiments?: Experiments;
  2020. /**
  2021. * 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`.
  2022. */
  2023. externals?:
  2024. | string
  2025. | RegExp
  2026. | ExternalItem[]
  2027. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  2028. | ((
  2029. data: ExternalItemFunctionData,
  2030. callback: (
  2031. err?: Error,
  2032. result?: string | boolean | string[] | { [index: string]: any }
  2033. ) => void
  2034. ) => void)
  2035. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  2036. /**
  2037. * Enable presets of externals for specific targets.
  2038. */
  2039. externalsPresets?: ExternalsPresets;
  2040. /**
  2041. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  2042. */
  2043. externalsType?:
  2044. | "import"
  2045. | "var"
  2046. | "module"
  2047. | "assign"
  2048. | "this"
  2049. | "window"
  2050. | "self"
  2051. | "global"
  2052. | "commonjs"
  2053. | "commonjs2"
  2054. | "commonjs-module"
  2055. | "commonjs-static"
  2056. | "amd"
  2057. | "amd-require"
  2058. | "umd"
  2059. | "umd2"
  2060. | "jsonp"
  2061. | "system"
  2062. | "promise"
  2063. | "script"
  2064. | "node-commonjs";
  2065. /**
  2066. * Ignore specific warnings.
  2067. */
  2068. ignoreWarnings?: (
  2069. | RegExp
  2070. | {
  2071. /**
  2072. * A RegExp to select the origin file for the warning.
  2073. */
  2074. file?: RegExp;
  2075. /**
  2076. * A RegExp to select the warning message.
  2077. */
  2078. message?: RegExp;
  2079. /**
  2080. * A RegExp to select the origin module for the warning.
  2081. */
  2082. module?: RegExp;
  2083. }
  2084. | ((warning: WebpackError, compilation: Compilation) => boolean)
  2085. )[];
  2086. /**
  2087. * Options for infrastructure level logging.
  2088. */
  2089. infrastructureLogging?: InfrastructureLogging;
  2090. /**
  2091. * Custom values available in the loader context.
  2092. */
  2093. loader?: Loader;
  2094. /**
  2095. * Enable production optimizations or development hints.
  2096. */
  2097. mode?: "none" | "development" | "production";
  2098. /**
  2099. * Options affecting the normal modules (`NormalModuleFactory`).
  2100. */
  2101. module?: ModuleOptions;
  2102. /**
  2103. * Name of the configuration. Used when loading multiple configurations.
  2104. */
  2105. name?: string;
  2106. /**
  2107. * Include polyfills or mocks for various node stuff.
  2108. */
  2109. node?: false | NodeOptions;
  2110. /**
  2111. * Enables/Disables integrated optimizations.
  2112. */
  2113. optimization?: Optimization;
  2114. /**
  2115. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  2116. */
  2117. output?: Output;
  2118. /**
  2119. * The number of parallel processed modules in the compilation.
  2120. */
  2121. parallelism?: number;
  2122. /**
  2123. * Configuration for web performance recommendations.
  2124. */
  2125. performance?: false | PerformanceOptions;
  2126. /**
  2127. * Add additional plugins to the compiler.
  2128. */
  2129. plugins?: (
  2130. | ((this: Compiler, compiler: Compiler) => void)
  2131. | WebpackPluginInstance
  2132. )[];
  2133. /**
  2134. * Capture timing information for each module.
  2135. */
  2136. profile?: boolean;
  2137. /**
  2138. * Store compiler state to a json file.
  2139. */
  2140. recordsInputPath?: string | false;
  2141. /**
  2142. * Load compiler state from a json file.
  2143. */
  2144. recordsOutputPath?: string | false;
  2145. /**
  2146. * 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.
  2147. */
  2148. recordsPath?: string | false;
  2149. /**
  2150. * Options for the resolver.
  2151. */
  2152. resolve?: ResolveOptionsWebpackOptions;
  2153. /**
  2154. * Options for the resolver when resolving loaders.
  2155. */
  2156. resolveLoader?: ResolveOptionsWebpackOptions;
  2157. /**
  2158. * Options affecting how file system snapshots are created and validated.
  2159. */
  2160. snapshot?: SnapshotOptions;
  2161. /**
  2162. * Stats options object or preset name.
  2163. */
  2164. stats?:
  2165. | boolean
  2166. | StatsOptions
  2167. | "none"
  2168. | "verbose"
  2169. | "summary"
  2170. | "errors-only"
  2171. | "errors-warnings"
  2172. | "minimal"
  2173. | "normal"
  2174. | "detailed";
  2175. /**
  2176. * Environment to build for. An array of environments to build for all of them when possible.
  2177. */
  2178. target?: string | false | string[];
  2179. /**
  2180. * Enter watch mode, which rebuilds on file change.
  2181. */
  2182. watch?: boolean;
  2183. /**
  2184. * Options for the watcher.
  2185. */
  2186. watchOptions?: WatchOptions;
  2187. }
  2188. type ConnectionState =
  2189. | boolean
  2190. | typeof TRANSITIVE_ONLY
  2191. | typeof CIRCULAR_CONNECTION;
  2192. declare class ConstDependency extends NullDependency {
  2193. constructor(
  2194. expression: string,
  2195. range: number | [number, number],
  2196. runtimeRequirements?: string[]
  2197. );
  2198. expression: string;
  2199. range: number | [number, number];
  2200. runtimeRequirements: null | Set<string>;
  2201. static Template: typeof ConstDependencyTemplate;
  2202. static NO_EXPORTS_REFERENCED: string[][];
  2203. static EXPORTS_OBJECT_REFERENCED: string[][];
  2204. static TRANSITIVE: typeof TRANSITIVE;
  2205. }
  2206. declare class ConstDependencyTemplate extends NullDependencyTemplate {
  2207. constructor();
  2208. }
  2209. declare interface Constructor {
  2210. new (...params: any[]): any;
  2211. }
  2212. declare class ConsumeSharedPlugin {
  2213. constructor(options: ConsumeSharedPluginOptions);
  2214. /**
  2215. * Apply the plugin
  2216. */
  2217. apply(compiler: Compiler): void;
  2218. }
  2219. /**
  2220. * Options for consuming shared modules.
  2221. */
  2222. declare interface ConsumeSharedPluginOptions {
  2223. /**
  2224. * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.
  2225. */
  2226. consumes: Consumes;
  2227. /**
  2228. * Share scope name used for all consumed modules (defaults to 'default').
  2229. */
  2230. shareScope?: string;
  2231. }
  2232. type Consumes = (string | ConsumesObject)[] | ConsumesObject;
  2233. /**
  2234. * Advanced configuration for modules that should be consumed from share scope.
  2235. */
  2236. declare interface ConsumesConfig {
  2237. /**
  2238. * 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.
  2239. */
  2240. eager?: boolean;
  2241. /**
  2242. * Fallback module if no shared module is found in share scope. Defaults to the property name.
  2243. */
  2244. import?: string | false;
  2245. /**
  2246. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  2247. */
  2248. packageName?: string;
  2249. /**
  2250. * Version requirement from module in share scope.
  2251. */
  2252. requiredVersion?: string | false;
  2253. /**
  2254. * Module is looked up under this key from the share scope.
  2255. */
  2256. shareKey?: string;
  2257. /**
  2258. * Share scope name.
  2259. */
  2260. shareScope?: string;
  2261. /**
  2262. * Allow only a single version of the shared module in share scope (disabled by default).
  2263. */
  2264. singleton?: boolean;
  2265. /**
  2266. * 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).
  2267. */
  2268. strictVersion?: boolean;
  2269. }
  2270. /**
  2271. * 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.
  2272. */
  2273. declare interface ConsumesObject {
  2274. [index: string]: string | ConsumesConfig;
  2275. }
  2276. type ContainerOptionsFormat<T> =
  2277. | Record<string, string | string[] | T>
  2278. | (string | Record<string, string | string[] | T>)[];
  2279. declare class ContainerPlugin {
  2280. constructor(options: ContainerPluginOptions);
  2281. /**
  2282. * Apply the plugin
  2283. */
  2284. apply(compiler: Compiler): void;
  2285. }
  2286. declare interface ContainerPluginOptions {
  2287. /**
  2288. * 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.
  2289. */
  2290. exposes: Exposes;
  2291. /**
  2292. * The filename for this container relative path inside the `output.path` directory.
  2293. */
  2294. filename?: string;
  2295. /**
  2296. * Options for library.
  2297. */
  2298. library?: LibraryOptions;
  2299. /**
  2300. * The name for this container.
  2301. */
  2302. name: string;
  2303. /**
  2304. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  2305. */
  2306. runtime?: string | false;
  2307. /**
  2308. * The name of the share scope which is shared with the host (defaults to 'default').
  2309. */
  2310. shareScope?: string;
  2311. }
  2312. declare class ContainerReferencePlugin {
  2313. constructor(options: ContainerReferencePluginOptions);
  2314. /**
  2315. * Apply the plugin
  2316. */
  2317. apply(compiler: Compiler): void;
  2318. }
  2319. declare interface ContainerReferencePluginOptions {
  2320. /**
  2321. * The external type of the remote containers.
  2322. */
  2323. remoteType: ExternalsType;
  2324. /**
  2325. * 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.
  2326. */
  2327. remotes: Remotes;
  2328. /**
  2329. * The name of the share scope shared with all remotes (defaults to 'default').
  2330. */
  2331. shareScope?: string;
  2332. }
  2333. declare abstract class ContextElementDependency extends ModuleDependency {
  2334. referencedExports?: string[][];
  2335. }
  2336. declare class ContextExclusionPlugin {
  2337. constructor(negativeMatcher: RegExp);
  2338. negativeMatcher: RegExp;
  2339. /**
  2340. * Apply the plugin
  2341. */
  2342. apply(compiler: Compiler): void;
  2343. }
  2344. declare interface ContextFileSystemInfoEntry {
  2345. safeTime: number;
  2346. timestampHash?: string;
  2347. resolved?: ResolvedContextFileSystemInfoEntry;
  2348. symlinks?: Set<string>;
  2349. }
  2350. declare interface ContextHash {
  2351. hash: string;
  2352. resolved?: string;
  2353. symlinks?: Set<string>;
  2354. }
  2355. type ContextMode =
  2356. | "weak"
  2357. | "eager"
  2358. | "lazy"
  2359. | "lazy-once"
  2360. | "sync"
  2361. | "async-weak";
  2362. declare abstract class ContextModuleFactory extends ModuleFactory {
  2363. hooks: Readonly<{
  2364. beforeResolve: AsyncSeriesWaterfallHook<[any]>;
  2365. afterResolve: AsyncSeriesWaterfallHook<[any]>;
  2366. contextModuleFiles: SyncWaterfallHook<[string[]]>;
  2367. alternatives: FakeHook<
  2368. Pick<
  2369. AsyncSeriesWaterfallHook<[any[]]>,
  2370. "name" | "tap" | "tapAsync" | "tapPromise"
  2371. >
  2372. >;
  2373. alternativeRequests: AsyncSeriesWaterfallHook<
  2374. [any[], ContextModuleOptions]
  2375. >;
  2376. }>;
  2377. resolverFactory: ResolverFactory;
  2378. resolveDependencies(
  2379. fs: InputFileSystem,
  2380. options: ContextModuleOptions,
  2381. callback: (
  2382. err?: null | Error,
  2383. dependencies?: ContextElementDependency[]
  2384. ) => any
  2385. ): void;
  2386. }
  2387. declare interface ContextModuleOptions {
  2388. mode: ContextMode;
  2389. recursive: boolean;
  2390. regExp: RegExp;
  2391. namespaceObject?: boolean | "strict";
  2392. addon?: string;
  2393. chunkName?: string;
  2394. include?: RegExp;
  2395. exclude?: RegExp;
  2396. groupOptions?: RawChunkGroupOptions;
  2397. typePrefix?: string;
  2398. category?: string;
  2399. /**
  2400. * exports referenced from modules (won't be mangled)
  2401. */
  2402. referencedExports?: string[][];
  2403. resource: string | false | string[];
  2404. resourceQuery?: string;
  2405. resourceFragment?: string;
  2406. resolveOptions: any;
  2407. }
  2408. declare class ContextReplacementPlugin {
  2409. constructor(
  2410. resourceRegExp?: any,
  2411. newContentResource?: any,
  2412. newContentRecursive?: any,
  2413. newContentRegExp?: any
  2414. );
  2415. resourceRegExp: any;
  2416. newContentCallback: any;
  2417. newContentResource: any;
  2418. newContentCreateContextMap: any;
  2419. newContentRecursive: any;
  2420. newContentRegExp: any;
  2421. apply(compiler?: any): void;
  2422. }
  2423. declare interface ContextTimestampAndHash {
  2424. safeTime: number;
  2425. timestampHash?: string;
  2426. hash: string;
  2427. resolved?: ResolvedContextTimestampAndHash;
  2428. symlinks?: Set<string>;
  2429. }
  2430. type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
  2431. Record<string, any>;
  2432. /**
  2433. * Options for css handling.
  2434. */
  2435. declare interface CssExperimentOptions {
  2436. /**
  2437. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2438. */
  2439. exportsOnly?: boolean;
  2440. }
  2441. type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
  2442. declare class DefinePlugin {
  2443. /**
  2444. * Create a new define plugin
  2445. */
  2446. constructor(definitions: Record<string, CodeValue>);
  2447. definitions: Record<string, CodeValue>;
  2448. /**
  2449. * Apply the plugin
  2450. */
  2451. apply(compiler: Compiler): void;
  2452. static runtimeValue(
  2453. fn: (arg0: {
  2454. module: NormalModule;
  2455. key: string;
  2456. readonly version?: string;
  2457. }) => CodeValuePrimitive,
  2458. options?: true | string[] | RuntimeValueOptions
  2459. ): RuntimeValue;
  2460. }
  2461. declare class DelegatedPlugin {
  2462. constructor(options?: any);
  2463. options: any;
  2464. /**
  2465. * Apply the plugin
  2466. */
  2467. apply(compiler: Compiler): void;
  2468. }
  2469. declare interface DepConstructor {
  2470. new (...args: any[]): Dependency;
  2471. }
  2472. declare abstract class DependenciesBlock {
  2473. dependencies: Dependency[];
  2474. blocks: AsyncDependenciesBlock[];
  2475. parent: DependenciesBlock;
  2476. getRootBlock(): DependenciesBlock;
  2477. /**
  2478. * Adds a DependencyBlock to DependencyBlock relationship.
  2479. * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)
  2480. */
  2481. addBlock(block: AsyncDependenciesBlock): void;
  2482. addDependency(dependency: Dependency): void;
  2483. removeDependency(dependency: Dependency): void;
  2484. /**
  2485. * Removes all dependencies and blocks
  2486. */
  2487. clearDependenciesAndBlocks(): void;
  2488. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  2489. serialize(__0: { write: any }): void;
  2490. deserialize(__0: { read: any }): void;
  2491. }
  2492. declare interface DependenciesBlockLike {
  2493. dependencies: Dependency[];
  2494. blocks: AsyncDependenciesBlock[];
  2495. }
  2496. declare class Dependency {
  2497. constructor();
  2498. weak: boolean;
  2499. optional: boolean;
  2500. get type(): string;
  2501. get category(): string;
  2502. loc: DependencyLocation;
  2503. setLoc(
  2504. startLine?: any,
  2505. startColumn?: any,
  2506. endLine?: any,
  2507. endColumn?: any
  2508. ): void;
  2509. getContext(): undefined | string;
  2510. getResourceIdentifier(): null | string;
  2511. couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
  2512. /**
  2513. * Returns the referenced module and export
  2514. */
  2515. getReference(moduleGraph: ModuleGraph): never;
  2516. /**
  2517. * Returns list of exports referenced by this dependency
  2518. */
  2519. getReferencedExports(
  2520. moduleGraph: ModuleGraph,
  2521. runtime: RuntimeSpec
  2522. ): (string[] | ReferencedExport)[];
  2523. getCondition(
  2524. moduleGraph: ModuleGraph
  2525. ):
  2526. | null
  2527. | false
  2528. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
  2529. /**
  2530. * Returns the exported names
  2531. */
  2532. getExports(moduleGraph: ModuleGraph): undefined | ExportsSpec;
  2533. /**
  2534. * Returns warnings
  2535. */
  2536. getWarnings(moduleGraph: ModuleGraph): WebpackError[];
  2537. /**
  2538. * Returns errors
  2539. */
  2540. getErrors(moduleGraph: ModuleGraph): WebpackError[];
  2541. /**
  2542. * Update the hash
  2543. */
  2544. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  2545. /**
  2546. * implement this method to allow the occurrence order plugin to count correctly
  2547. */
  2548. getNumberOfIdOccurrences(): number;
  2549. getModuleEvaluationSideEffectsState(
  2550. moduleGraph: ModuleGraph
  2551. ): ConnectionState;
  2552. createIgnoredModule(context: string): Module;
  2553. serialize(__0: { write: any }): void;
  2554. deserialize(__0: { read: any }): void;
  2555. module: any;
  2556. get disconnect(): any;
  2557. static NO_EXPORTS_REFERENCED: string[][];
  2558. static EXPORTS_OBJECT_REFERENCED: string[][];
  2559. static TRANSITIVE: typeof TRANSITIVE;
  2560. }
  2561. declare interface DependencyConstructor {
  2562. new (...args: any[]): Dependency;
  2563. }
  2564. type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
  2565. declare class DependencyTemplate {
  2566. constructor();
  2567. apply(
  2568. dependency: Dependency,
  2569. source: ReplaceSource,
  2570. templateContext: DependencyTemplateContext
  2571. ): void;
  2572. }
  2573. declare interface DependencyTemplateContext {
  2574. /**
  2575. * the runtime template
  2576. */
  2577. runtimeTemplate: RuntimeTemplate;
  2578. /**
  2579. * the dependency templates
  2580. */
  2581. dependencyTemplates: DependencyTemplates;
  2582. /**
  2583. * the module graph
  2584. */
  2585. moduleGraph: ModuleGraph;
  2586. /**
  2587. * the chunk graph
  2588. */
  2589. chunkGraph: ChunkGraph;
  2590. /**
  2591. * the requirements for runtime
  2592. */
  2593. runtimeRequirements: Set<string>;
  2594. /**
  2595. * current module
  2596. */
  2597. module: Module;
  2598. /**
  2599. * current runtimes, for which code is generated
  2600. */
  2601. runtime: RuntimeSpec;
  2602. /**
  2603. * mutable array of init fragments for the current module
  2604. */
  2605. initFragments: InitFragment<GenerateContext>[];
  2606. /**
  2607. * when in a concatenated module, information about other concatenated modules
  2608. */
  2609. concatenationScope?: ConcatenationScope;
  2610. /**
  2611. * the code generation results
  2612. */
  2613. codeGenerationResults: CodeGenerationResults;
  2614. }
  2615. declare abstract class DependencyTemplates {
  2616. get(dependency: DependencyConstructor): DependencyTemplate;
  2617. set(
  2618. dependency: DependencyConstructor,
  2619. dependencyTemplate: DependencyTemplate
  2620. ): void;
  2621. updateHash(part: string): void;
  2622. getHash(): string;
  2623. clone(): DependencyTemplates;
  2624. }
  2625. declare class DeterministicChunkIdsPlugin {
  2626. constructor(options?: any);
  2627. options: any;
  2628. /**
  2629. * Apply the plugin
  2630. */
  2631. apply(compiler: Compiler): void;
  2632. }
  2633. declare class DeterministicModuleIdsPlugin {
  2634. constructor(options?: {
  2635. /**
  2636. * context relative to which module identifiers are computed
  2637. */
  2638. context?: string;
  2639. /**
  2640. * selector function for modules
  2641. */
  2642. test?: (arg0: Module) => boolean;
  2643. /**
  2644. * maximum id length in digits (used as starting point)
  2645. */
  2646. maxLength?: number;
  2647. /**
  2648. * hash salt for ids
  2649. */
  2650. salt?: number;
  2651. /**
  2652. * do not increase the maxLength to find an optimal id space size
  2653. */
  2654. fixedLength?: boolean;
  2655. /**
  2656. * throw an error when id conflicts occur (instead of rehashing)
  2657. */
  2658. failOnConflict?: boolean;
  2659. });
  2660. options: {
  2661. /**
  2662. * context relative to which module identifiers are computed
  2663. */
  2664. context?: string;
  2665. /**
  2666. * selector function for modules
  2667. */
  2668. test?: (arg0: Module) => boolean;
  2669. /**
  2670. * maximum id length in digits (used as starting point)
  2671. */
  2672. maxLength?: number;
  2673. /**
  2674. * hash salt for ids
  2675. */
  2676. salt?: number;
  2677. /**
  2678. * do not increase the maxLength to find an optimal id space size
  2679. */
  2680. fixedLength?: boolean;
  2681. /**
  2682. * throw an error when id conflicts occur (instead of rehashing)
  2683. */
  2684. failOnConflict?: boolean;
  2685. };
  2686. /**
  2687. * Apply the plugin
  2688. */
  2689. apply(compiler: Compiler): void;
  2690. }
  2691. /**
  2692. * Options for the webpack-dev-server.
  2693. */
  2694. declare interface DevServer {
  2695. [index: string]: any;
  2696. }
  2697. declare class DllPlugin {
  2698. constructor(options: DllPluginOptions);
  2699. options: {
  2700. entryOnly: boolean;
  2701. /**
  2702. * Context of requests in the manifest file (defaults to the webpack context).
  2703. */
  2704. context?: string;
  2705. /**
  2706. * If true, manifest json file (output) will be formatted.
  2707. */
  2708. format?: boolean;
  2709. /**
  2710. * Name of the exposed dll function (external name, use value of 'output.library').
  2711. */
  2712. name?: string;
  2713. /**
  2714. * Absolute path to the manifest json file (output).
  2715. */
  2716. path: string;
  2717. /**
  2718. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  2719. */
  2720. type?: string;
  2721. };
  2722. /**
  2723. * Apply the plugin
  2724. */
  2725. apply(compiler: Compiler): void;
  2726. }
  2727. declare interface DllPluginOptions {
  2728. /**
  2729. * Context of requests in the manifest file (defaults to the webpack context).
  2730. */
  2731. context?: string;
  2732. /**
  2733. * If true, only entry points will be exposed (default: true).
  2734. */
  2735. entryOnly?: boolean;
  2736. /**
  2737. * If true, manifest json file (output) will be formatted.
  2738. */
  2739. format?: boolean;
  2740. /**
  2741. * Name of the exposed dll function (external name, use value of 'output.library').
  2742. */
  2743. name?: string;
  2744. /**
  2745. * Absolute path to the manifest json file (output).
  2746. */
  2747. path: string;
  2748. /**
  2749. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  2750. */
  2751. type?: string;
  2752. }
  2753. declare class DllReferencePlugin {
  2754. constructor(options: DllReferencePluginOptions);
  2755. options: DllReferencePluginOptions;
  2756. apply(compiler?: any): void;
  2757. }
  2758. type DllReferencePluginOptions =
  2759. | {
  2760. /**
  2761. * Context of requests in the manifest (or content property) as absolute path.
  2762. */
  2763. context?: string;
  2764. /**
  2765. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  2766. */
  2767. extensions?: string[];
  2768. /**
  2769. * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.
  2770. */
  2771. manifest: string | DllReferencePluginOptionsManifest;
  2772. /**
  2773. * The name where the dll is exposed (external name, defaults to manifest.name).
  2774. */
  2775. name?: string;
  2776. /**
  2777. * Prefix which is used for accessing the content of the dll.
  2778. */
  2779. scope?: string;
  2780. /**
  2781. * How the dll is exposed (libraryTarget, defaults to manifest.type).
  2782. */
  2783. sourceType?:
  2784. | "var"
  2785. | "assign"
  2786. | "this"
  2787. | "window"
  2788. | "global"
  2789. | "commonjs"
  2790. | "commonjs2"
  2791. | "commonjs-module"
  2792. | "amd"
  2793. | "amd-require"
  2794. | "umd"
  2795. | "umd2"
  2796. | "jsonp"
  2797. | "system";
  2798. /**
  2799. * The way how the export of the dll bundle is used.
  2800. */
  2801. type?: "object" | "require";
  2802. }
  2803. | {
  2804. /**
  2805. * The mappings from request to module info.
  2806. */
  2807. content: DllReferencePluginOptionsContent;
  2808. /**
  2809. * Context of requests in the manifest (or content property) as absolute path.
  2810. */
  2811. context?: string;
  2812. /**
  2813. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  2814. */
  2815. extensions?: string[];
  2816. /**
  2817. * The name where the dll is exposed (external name).
  2818. */
  2819. name: string;
  2820. /**
  2821. * Prefix which is used for accessing the content of the dll.
  2822. */
  2823. scope?: string;
  2824. /**
  2825. * How the dll is exposed (libraryTarget).
  2826. */
  2827. sourceType?:
  2828. | "var"
  2829. | "assign"
  2830. | "this"
  2831. | "window"
  2832. | "global"
  2833. | "commonjs"
  2834. | "commonjs2"
  2835. | "commonjs-module"
  2836. | "amd"
  2837. | "amd-require"
  2838. | "umd"
  2839. | "umd2"
  2840. | "jsonp"
  2841. | "system";
  2842. /**
  2843. * The way how the export of the dll bundle is used.
  2844. */
  2845. type?: "object" | "require";
  2846. };
  2847. /**
  2848. * The mappings from request to module info.
  2849. */
  2850. declare interface DllReferencePluginOptionsContent {
  2851. [index: string]: {
  2852. /**
  2853. * Meta information about the module.
  2854. */
  2855. buildMeta?: { [index: string]: any };
  2856. /**
  2857. * Information about the provided exports of the module.
  2858. */
  2859. exports?: true | string[];
  2860. /**
  2861. * Module ID.
  2862. */
  2863. id: string | number;
  2864. };
  2865. }
  2866. /**
  2867. * An object containing content, name and type.
  2868. */
  2869. declare interface DllReferencePluginOptionsManifest {
  2870. /**
  2871. * The mappings from request to module info.
  2872. */
  2873. content: DllReferencePluginOptionsContent;
  2874. /**
  2875. * The name where the dll is exposed (external name).
  2876. */
  2877. name?: string;
  2878. /**
  2879. * The type how the dll is exposed (external type).
  2880. */
  2881. type?:
  2882. | "var"
  2883. | "assign"
  2884. | "this"
  2885. | "window"
  2886. | "global"
  2887. | "commonjs"
  2888. | "commonjs2"
  2889. | "commonjs-module"
  2890. | "amd"
  2891. | "amd-require"
  2892. | "umd"
  2893. | "umd2"
  2894. | "jsonp"
  2895. | "system";
  2896. }
  2897. declare class DynamicEntryPlugin {
  2898. constructor(context: string, entry: () => Promise<EntryStaticNormalized>);
  2899. context: string;
  2900. entry: () => Promise<EntryStaticNormalized>;
  2901. /**
  2902. * Apply the plugin
  2903. */
  2904. apply(compiler: Compiler): void;
  2905. }
  2906. declare interface Effect {
  2907. type: string;
  2908. value: any;
  2909. }
  2910. declare class ElectronTargetPlugin {
  2911. constructor(context?: "main" | "preload" | "renderer");
  2912. /**
  2913. * Apply the plugin
  2914. */
  2915. apply(compiler: Compiler): void;
  2916. }
  2917. /**
  2918. * No generator options are supported for this module type.
  2919. */
  2920. declare interface EmptyGeneratorOptions {}
  2921. /**
  2922. * No parser options are supported for this module type.
  2923. */
  2924. declare interface EmptyParserOptions {}
  2925. declare class EnableChunkLoadingPlugin {
  2926. constructor(type: string);
  2927. type: string;
  2928. /**
  2929. * Apply the plugin
  2930. */
  2931. apply(compiler: Compiler): void;
  2932. static setEnabled(compiler: Compiler, type: string): void;
  2933. static checkEnabled(compiler: Compiler, type: string): void;
  2934. }
  2935. declare class EnableLibraryPlugin {
  2936. constructor(type: string);
  2937. type: string;
  2938. /**
  2939. * Apply the plugin
  2940. */
  2941. apply(compiler: Compiler): void;
  2942. static setEnabled(compiler: Compiler, type: string): void;
  2943. static checkEnabled(compiler: Compiler, type: string): void;
  2944. }
  2945. declare class EnableWasmLoadingPlugin {
  2946. constructor(type: string);
  2947. type: string;
  2948. /**
  2949. * Apply the plugin
  2950. */
  2951. apply(compiler: Compiler): void;
  2952. static setEnabled(compiler: Compiler, type: string): void;
  2953. static checkEnabled(compiler: Compiler, type: string): void;
  2954. }
  2955. type Entry =
  2956. | string
  2957. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  2958. | EntryObject
  2959. | string[];
  2960. declare interface EntryData {
  2961. /**
  2962. * dependencies of the entrypoint that should be evaluated at startup
  2963. */
  2964. dependencies: Dependency[];
  2965. /**
  2966. * dependencies of the entrypoint that should be included but not evaluated
  2967. */
  2968. includeDependencies: Dependency[];
  2969. /**
  2970. * options of the entrypoint
  2971. */
  2972. options: EntryOptions;
  2973. }
  2974. declare abstract class EntryDependency extends ModuleDependency {}
  2975. /**
  2976. * An object with entry point description.
  2977. */
  2978. declare interface EntryDescription {
  2979. /**
  2980. * Enable/disable creating async chunks that are loaded on demand.
  2981. */
  2982. asyncChunks?: boolean;
  2983. /**
  2984. * Base uri for this entry.
  2985. */
  2986. baseUri?: string;
  2987. /**
  2988. * 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).
  2989. */
  2990. chunkLoading?: string | false;
  2991. /**
  2992. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  2993. */
  2994. dependOn?: string | string[];
  2995. /**
  2996. * 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.
  2997. */
  2998. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  2999. /**
  3000. * Module(s) that are loaded upon startup.
  3001. */
  3002. import: EntryItem;
  3003. /**
  3004. * Specifies the layer in which modules of this entrypoint are placed.
  3005. */
  3006. layer?: null | string;
  3007. /**
  3008. * Options for library.
  3009. */
  3010. library?: LibraryOptions;
  3011. /**
  3012. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  3013. */
  3014. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3015. /**
  3016. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3017. */
  3018. runtime?: string | false;
  3019. /**
  3020. * 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).
  3021. */
  3022. wasmLoading?: string | false;
  3023. }
  3024. /**
  3025. * An object with entry point description.
  3026. */
  3027. declare interface EntryDescriptionNormalized {
  3028. /**
  3029. * Enable/disable creating async chunks that are loaded on demand.
  3030. */
  3031. asyncChunks?: boolean;
  3032. /**
  3033. * Base uri for this entry.
  3034. */
  3035. baseUri?: string;
  3036. /**
  3037. * 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).
  3038. */
  3039. chunkLoading?: string | false;
  3040. /**
  3041. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  3042. */
  3043. dependOn?: string[];
  3044. /**
  3045. * 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.
  3046. */
  3047. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3048. /**
  3049. * Module(s) that are loaded upon startup. The last one is exported.
  3050. */
  3051. import?: string[];
  3052. /**
  3053. * Specifies the layer in which modules of this entrypoint are placed.
  3054. */
  3055. layer?: null | string;
  3056. /**
  3057. * Options for library.
  3058. */
  3059. library?: LibraryOptions;
  3060. /**
  3061. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  3062. */
  3063. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3064. /**
  3065. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3066. */
  3067. runtime?: string | false;
  3068. /**
  3069. * 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).
  3070. */
  3071. wasmLoading?: string | false;
  3072. }
  3073. type EntryItem = string | string[];
  3074. type EntryNormalized =
  3075. | (() => Promise<EntryStaticNormalized>)
  3076. | EntryStaticNormalized;
  3077. /**
  3078. * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.
  3079. */
  3080. declare interface EntryObject {
  3081. [index: string]: string | string[] | EntryDescription;
  3082. }
  3083. declare class EntryOptionPlugin {
  3084. constructor();
  3085. apply(compiler: Compiler): void;
  3086. static applyEntryOption(
  3087. compiler: Compiler,
  3088. context: string,
  3089. entry: EntryNormalized
  3090. ): void;
  3091. static entryDescriptionToOptions(
  3092. compiler: Compiler,
  3093. name: string,
  3094. desc: EntryDescriptionNormalized
  3095. ): EntryOptions;
  3096. }
  3097. type EntryOptions = { name?: string } & Omit<
  3098. EntryDescriptionNormalized,
  3099. "import"
  3100. >;
  3101. declare class EntryPlugin {
  3102. /**
  3103. * An entry plugin which will handle
  3104. * creation of the EntryDependency
  3105. */
  3106. constructor(context: string, entry: string, options?: string | EntryOptions);
  3107. context: string;
  3108. entry: string;
  3109. options: string | EntryOptions;
  3110. /**
  3111. * Apply the plugin
  3112. */
  3113. apply(compiler: Compiler): void;
  3114. static createDependency(
  3115. entry: string,
  3116. options: string | EntryOptions
  3117. ): EntryDependency;
  3118. }
  3119. type EntryStatic = string | EntryObject | string[];
  3120. /**
  3121. * Multiple entry bundles are created. The key is the entry name. The value is an entry description object.
  3122. */
  3123. declare interface EntryStaticNormalized {
  3124. [index: string]: EntryDescriptionNormalized;
  3125. }
  3126. declare abstract class Entrypoint extends ChunkGroup {
  3127. /**
  3128. * Sets the runtimeChunk for an entrypoint.
  3129. */
  3130. setRuntimeChunk(chunk: Chunk): void;
  3131. /**
  3132. * Fetches the chunk reference containing the webpack bootstrap code
  3133. */
  3134. getRuntimeChunk(): null | Chunk;
  3135. /**
  3136. * Sets the chunk with the entrypoint modules for an entrypoint.
  3137. */
  3138. setEntrypointChunk(chunk: Chunk): void;
  3139. /**
  3140. * Returns the chunk which contains the entrypoint modules
  3141. * (or at least the execution of them)
  3142. */
  3143. getEntrypointChunk(): Chunk;
  3144. }
  3145. /**
  3146. * The abilities of the environment where the webpack generated code should run.
  3147. */
  3148. declare interface Environment {
  3149. /**
  3150. * The environment supports arrow functions ('() => { ... }').
  3151. */
  3152. arrowFunction?: boolean;
  3153. /**
  3154. * The environment supports BigInt as literal (123n).
  3155. */
  3156. bigIntLiteral?: boolean;
  3157. /**
  3158. * The environment supports const and let for variable declarations.
  3159. */
  3160. const?: boolean;
  3161. /**
  3162. * The environment supports destructuring ('{ a, b } = obj').
  3163. */
  3164. destructuring?: boolean;
  3165. /**
  3166. * The environment supports an async import() function to import EcmaScript modules.
  3167. */
  3168. dynamicImport?: boolean;
  3169. /**
  3170. * The environment supports 'for of' iteration ('for (const x of array) { ... }').
  3171. */
  3172. forOf?: boolean;
  3173. /**
  3174. * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
  3175. */
  3176. module?: boolean;
  3177. /**
  3178. * The environment supports optional chaining ('obj?.a' or 'obj?.()').
  3179. */
  3180. optionalChaining?: boolean;
  3181. /**
  3182. * The environment supports template literals.
  3183. */
  3184. templateLiteral?: boolean;
  3185. }
  3186. declare class EnvironmentPlugin {
  3187. constructor(...keys: any[]);
  3188. keys: any[];
  3189. defaultValues: any;
  3190. /**
  3191. * Apply the plugin
  3192. */
  3193. apply(compiler: Compiler): void;
  3194. }
  3195. declare interface Etag {
  3196. toString: () => string;
  3197. }
  3198. declare class EvalDevToolModulePlugin {
  3199. constructor(options?: any);
  3200. namespace: any;
  3201. sourceUrlComment: any;
  3202. moduleFilenameTemplate: any;
  3203. /**
  3204. * Apply the plugin
  3205. */
  3206. apply(compiler: Compiler): void;
  3207. }
  3208. declare class EvalSourceMapDevToolPlugin {
  3209. constructor(inputOptions: string | SourceMapDevToolPluginOptions);
  3210. sourceMapComment: string;
  3211. moduleFilenameTemplate: string | Function;
  3212. namespace: string;
  3213. options: SourceMapDevToolPluginOptions;
  3214. /**
  3215. * Apply the plugin
  3216. */
  3217. apply(compiler: Compiler): void;
  3218. }
  3219. declare interface ExecuteModuleArgument {
  3220. module: Module;
  3221. moduleObject?: { id: string; exports: any; loaded: boolean };
  3222. preparedInfo: any;
  3223. codeGenerationResult: CodeGenerationResult;
  3224. }
  3225. declare interface ExecuteModuleContext {
  3226. assets: Map<string, { source: Source; info: AssetInfo }>;
  3227. chunk: Chunk;
  3228. chunkGraph: ChunkGraph;
  3229. __webpack_require__?: (arg0: string) => any;
  3230. }
  3231. declare interface ExecuteModuleOptions {
  3232. entryOptions?: EntryOptions;
  3233. }
  3234. declare interface ExecuteModuleResult {
  3235. exports: any;
  3236. cacheable: boolean;
  3237. assets: Map<string, { source: Source; info: AssetInfo }>;
  3238. fileDependencies: LazySet<string>;
  3239. contextDependencies: LazySet<string>;
  3240. missingDependencies: LazySet<string>;
  3241. buildDependencies: LazySet<string>;
  3242. }
  3243. type Experiments = ExperimentsCommon & ExperimentsExtra;
  3244. /**
  3245. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3246. */
  3247. declare interface ExperimentsCommon {
  3248. /**
  3249. * Support WebAssembly as asynchronous EcmaScript Module.
  3250. */
  3251. asyncWebAssembly?: boolean;
  3252. /**
  3253. * Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
  3254. */
  3255. backCompat?: boolean;
  3256. /**
  3257. * Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
  3258. */
  3259. cacheUnaffected?: boolean;
  3260. /**
  3261. * Apply defaults of next major version.
  3262. */
  3263. futureDefaults?: boolean;
  3264. /**
  3265. * Enable module layers.
  3266. */
  3267. layers?: boolean;
  3268. /**
  3269. * Allow output javascript files as module source type.
  3270. */
  3271. outputModule?: boolean;
  3272. /**
  3273. * Support WebAssembly as synchronous EcmaScript Module (outdated).
  3274. */
  3275. syncWebAssembly?: boolean;
  3276. /**
  3277. * Allow using top-level-await in EcmaScript Modules.
  3278. */
  3279. topLevelAwait?: boolean;
  3280. }
  3281. /**
  3282. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3283. */
  3284. declare interface ExperimentsExtra {
  3285. /**
  3286. * Build http(s): urls using a lockfile and resource content cache.
  3287. */
  3288. buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
  3289. /**
  3290. * Enable css support.
  3291. */
  3292. css?: boolean | CssExperimentOptions;
  3293. /**
  3294. * Compile entrypoints and import()s only when they are accessed.
  3295. */
  3296. lazyCompilation?: boolean | LazyCompilationOptions;
  3297. }
  3298. type ExperimentsNormalized = ExperimentsCommon & ExperimentsNormalizedExtra;
  3299. /**
  3300. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3301. */
  3302. declare interface ExperimentsNormalizedExtra {
  3303. /**
  3304. * Build http(s): urls using a lockfile and resource content cache.
  3305. */
  3306. buildHttp?: HttpUriOptions;
  3307. /**
  3308. * Enable css support.
  3309. */
  3310. css?: false | CssExperimentOptions;
  3311. /**
  3312. * Compile entrypoints and import()s only when they are accessed.
  3313. */
  3314. lazyCompilation?: false | LazyCompilationOptions;
  3315. }
  3316. declare abstract class ExportInfo {
  3317. name: string;
  3318. /**
  3319. * true: it is provided
  3320. * false: it is not provided
  3321. * null: only the runtime knows if it is provided
  3322. * undefined: it was not determined if it is provided
  3323. */
  3324. provided?: null | boolean;
  3325. /**
  3326. * is the export a terminal binding that should be checked for export star conflicts
  3327. */
  3328. terminalBinding: boolean;
  3329. /**
  3330. * true: it can be mangled
  3331. * false: is can not be mangled
  3332. * undefined: it was not determined if it can be mangled
  3333. */
  3334. canMangleProvide?: boolean;
  3335. /**
  3336. * true: it can be mangled
  3337. * false: is can not be mangled
  3338. * undefined: it was not determined if it can be mangled
  3339. */
  3340. canMangleUse?: boolean;
  3341. exportsInfoOwned: boolean;
  3342. exportsInfo?: ExportsInfo;
  3343. get canMangle(): boolean;
  3344. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  3345. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  3346. setHasUseInfo(): void;
  3347. setUsedConditionally(
  3348. condition: (arg0: UsageStateType) => boolean,
  3349. newValue: UsageStateType,
  3350. runtime: RuntimeSpec
  3351. ): boolean;
  3352. setUsed(newValue: UsageStateType, runtime: RuntimeSpec): boolean;
  3353. unsetTarget(key?: any): boolean;
  3354. setTarget(
  3355. key: any,
  3356. connection: ModuleGraphConnection,
  3357. exportName?: string[],
  3358. priority?: number
  3359. ): boolean;
  3360. getUsed(runtime: RuntimeSpec): UsageStateType;
  3361. /**
  3362. * get used name
  3363. */
  3364. getUsedName(
  3365. fallbackName: undefined | string,
  3366. runtime: RuntimeSpec
  3367. ): string | false;
  3368. hasUsedName(): boolean;
  3369. /**
  3370. * Sets the mangled name of this export
  3371. */
  3372. setUsedName(name: string): void;
  3373. getTerminalBinding(
  3374. moduleGraph: ModuleGraph,
  3375. resolveTargetFilter?: (arg0: {
  3376. module: Module;
  3377. export?: string[];
  3378. }) => boolean
  3379. ): undefined | ExportsInfo | ExportInfo;
  3380. isReexport(): undefined | boolean;
  3381. findTarget(
  3382. moduleGraph: ModuleGraph,
  3383. validTargetModuleFilter: (arg0: Module) => boolean
  3384. ): undefined | false | { module: Module; export?: string[] };
  3385. getTarget(
  3386. moduleGraph: ModuleGraph,
  3387. resolveTargetFilter?: (arg0: {
  3388. module: Module;
  3389. export?: string[];
  3390. }) => boolean
  3391. ): undefined | { module: Module; export?: string[] };
  3392. /**
  3393. * Move the target forward as long resolveTargetFilter is fulfilled
  3394. */
  3395. moveTarget(
  3396. moduleGraph: ModuleGraph,
  3397. resolveTargetFilter: (arg0: {
  3398. module: Module;
  3399. export?: string[];
  3400. }) => boolean,
  3401. updateOriginalConnection?: (arg0: {
  3402. module: Module;
  3403. export?: string[];
  3404. }) => ModuleGraphConnection
  3405. ): undefined | { module: Module; export?: string[] };
  3406. createNestedExportsInfo(): undefined | ExportsInfo;
  3407. getNestedExportsInfo(): undefined | ExportsInfo;
  3408. hasInfo(baseInfo?: any, runtime?: any): boolean;
  3409. updateHash(hash?: any, runtime?: any): void;
  3410. getUsedInfo(): string;
  3411. getProvidedInfo():
  3412. | "no provided info"
  3413. | "maybe provided (runtime-defined)"
  3414. | "provided"
  3415. | "not provided";
  3416. getRenameInfo(): string;
  3417. }
  3418. declare interface ExportSpec {
  3419. /**
  3420. * the name of the export
  3421. */
  3422. name: string;
  3423. /**
  3424. * can the export be renamed (defaults to true)
  3425. */
  3426. canMangle?: boolean;
  3427. /**
  3428. * is the export a terminal binding that should be checked for export star conflicts
  3429. */
  3430. terminalBinding?: boolean;
  3431. /**
  3432. * nested exports
  3433. */
  3434. exports?: (string | ExportSpec)[];
  3435. /**
  3436. * when reexported: from which module
  3437. */
  3438. from?: ModuleGraphConnection;
  3439. /**
  3440. * when reexported: from which export
  3441. */
  3442. export?: null | string[];
  3443. /**
  3444. * when reexported: with which priority
  3445. */
  3446. priority?: number;
  3447. /**
  3448. * export is not visible, because another export blends over it
  3449. */
  3450. hidden?: boolean;
  3451. }
  3452. type ExportedVariableInfo = string | ScopeInfo | VariableInfo;
  3453. declare abstract class ExportsInfo {
  3454. get ownedExports(): Iterable<ExportInfo>;
  3455. get orderedOwnedExports(): Iterable<ExportInfo>;
  3456. get exports(): Iterable<ExportInfo>;
  3457. get orderedExports(): Iterable<ExportInfo>;
  3458. get otherExportsInfo(): ExportInfo;
  3459. setRedirectNamedTo(exportsInfo?: any): boolean;
  3460. setHasProvideInfo(): void;
  3461. setHasUseInfo(): void;
  3462. getOwnExportInfo(name: string): ExportInfo;
  3463. getExportInfo(name: string): ExportInfo;
  3464. getReadOnlyExportInfo(name: string): ExportInfo;
  3465. getReadOnlyExportInfoRecursive(name: string[]): undefined | ExportInfo;
  3466. getNestedExportsInfo(name?: string[]): undefined | ExportsInfo;
  3467. setUnknownExportsProvided(
  3468. canMangle?: boolean,
  3469. excludeExports?: Set<string>,
  3470. targetKey?: any,
  3471. targetModule?: ModuleGraphConnection,
  3472. priority?: number
  3473. ): boolean;
  3474. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  3475. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  3476. setAllKnownExportsUsed(runtime: RuntimeSpec): boolean;
  3477. setUsedForSideEffectsOnly(runtime: RuntimeSpec): boolean;
  3478. isUsed(runtime: RuntimeSpec): boolean;
  3479. isModuleUsed(runtime: RuntimeSpec): boolean;
  3480. getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
  3481. getProvidedExports(): null | true | string[];
  3482. getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
  3483. isExportProvided(name: string | string[]): undefined | null | boolean;
  3484. getUsageKey(runtime: RuntimeSpec): string;
  3485. isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
  3486. getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
  3487. getUsedName(
  3488. name: string | string[],
  3489. runtime: RuntimeSpec
  3490. ): string | false | string[];
  3491. updateHash(hash: Hash, runtime: RuntimeSpec): void;
  3492. getRestoreProvidedData(): any;
  3493. restoreProvided(__0: {
  3494. otherProvided: any;
  3495. otherCanMangleProvide: any;
  3496. otherTerminalBinding: any;
  3497. exports: any;
  3498. }): void;
  3499. }
  3500. declare interface ExportsSpec {
  3501. /**
  3502. * exported names, true for unknown exports or null for no exports
  3503. */
  3504. exports: null | true | (string | ExportSpec)[];
  3505. /**
  3506. * when exports = true, list of unaffected exports
  3507. */
  3508. excludeExports?: Set<string>;
  3509. /**
  3510. * list of maybe prior exposed, but now hidden exports
  3511. */
  3512. hideExports?: Set<string>;
  3513. /**
  3514. * when reexported: from which module
  3515. */
  3516. from?: ModuleGraphConnection;
  3517. /**
  3518. * when reexported: with which priority
  3519. */
  3520. priority?: number;
  3521. /**
  3522. * can the export be renamed (defaults to true)
  3523. */
  3524. canMangle?: boolean;
  3525. /**
  3526. * are the exports terminal bindings that should be checked for export star conflicts
  3527. */
  3528. terminalBinding?: boolean;
  3529. /**
  3530. * module on which the result depends on
  3531. */
  3532. dependencies?: Module[];
  3533. }
  3534. type Exposes = (string | ExposesObject)[] | ExposesObject;
  3535. /**
  3536. * Advanced configuration for modules that should be exposed by this container.
  3537. */
  3538. declare interface ExposesConfig {
  3539. /**
  3540. * Request to a module that should be exposed by this container.
  3541. */
  3542. import: string | string[];
  3543. /**
  3544. * Custom chunk name for the exposed module.
  3545. */
  3546. name?: string;
  3547. }
  3548. /**
  3549. * Modules that should be exposed by this container. Property names are used as public paths.
  3550. */
  3551. declare interface ExposesObject {
  3552. [index: string]: string | ExposesConfig | string[];
  3553. }
  3554. type Expression =
  3555. | UnaryExpression
  3556. | ArrayExpression
  3557. | ArrowFunctionExpression
  3558. | AssignmentExpression
  3559. | AwaitExpression
  3560. | BinaryExpression
  3561. | SimpleCallExpression
  3562. | NewExpression
  3563. | ChainExpression
  3564. | ClassExpression
  3565. | ConditionalExpression
  3566. | FunctionExpression
  3567. | Identifier
  3568. | ImportExpression
  3569. | SimpleLiteral
  3570. | RegExpLiteral
  3571. | BigIntLiteral
  3572. | LogicalExpression
  3573. | MemberExpression
  3574. | MetaProperty
  3575. | ObjectExpression
  3576. | SequenceExpression
  3577. | TaggedTemplateExpression
  3578. | TemplateLiteral
  3579. | ThisExpression
  3580. | UpdateExpression
  3581. | YieldExpression;
  3582. declare interface ExpressionExpressionInfo {
  3583. type: "expression";
  3584. rootInfo: string | VariableInfo;
  3585. name: string;
  3586. getMembers: () => string[];
  3587. getMembersOptionals: () => boolean[];
  3588. }
  3589. declare interface ExtensionAliasOption {
  3590. alias: string | string[];
  3591. extension: string;
  3592. }
  3593. declare interface ExtensionAliasOptions {
  3594. [index: string]: string | string[];
  3595. }
  3596. type ExternalItem =
  3597. | string
  3598. | RegExp
  3599. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  3600. | ((
  3601. data: ExternalItemFunctionData,
  3602. callback: (
  3603. err?: Error,
  3604. result?: string | boolean | string[] | { [index: string]: any }
  3605. ) => void
  3606. ) => void)
  3607. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  3608. /**
  3609. * Data object passed as argument when a function is set for 'externals'.
  3610. */
  3611. declare interface ExternalItemFunctionData {
  3612. /**
  3613. * The directory in which the request is placed.
  3614. */
  3615. context?: string;
  3616. /**
  3617. * Contextual information.
  3618. */
  3619. contextInfo?: ModuleFactoryCreateDataContextInfo;
  3620. /**
  3621. * The category of the referencing dependencies.
  3622. */
  3623. dependencyType?: string;
  3624. /**
  3625. * Get a resolve function with the current resolver options.
  3626. */
  3627. getResolve?: (
  3628. options?: ResolveOptionsWebpackOptions
  3629. ) =>
  3630. | ((
  3631. context: string,
  3632. request: string,
  3633. callback: (err?: Error, result?: string) => void
  3634. ) => void)
  3635. | ((context: string, request: string) => Promise<string>);
  3636. /**
  3637. * The request as written by the user in the require/import expression/statement.
  3638. */
  3639. request?: string;
  3640. }
  3641. /**
  3642. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  3643. */
  3644. declare interface ExternalItemObjectKnown {
  3645. /**
  3646. * Specify externals depending on the layer.
  3647. */
  3648. byLayer?:
  3649. | { [index: string]: ExternalItem }
  3650. | ((layer: null | string) => ExternalItem);
  3651. }
  3652. /**
  3653. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  3654. */
  3655. declare interface ExternalItemObjectUnknown {
  3656. [index: string]: ExternalItemValue;
  3657. }
  3658. type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
  3659. declare class ExternalModule extends Module {
  3660. constructor(request?: any, type?: any, userRequest?: any);
  3661. request: string | string[] | Record<string, string | string[]>;
  3662. externalType: string;
  3663. userRequest: string;
  3664. restoreFromUnsafeCache(
  3665. unsafeCacheData?: any,
  3666. normalModuleFactory?: any
  3667. ): void;
  3668. }
  3669. declare interface ExternalModuleInfo {
  3670. index: number;
  3671. module: Module;
  3672. }
  3673. type Externals =
  3674. | string
  3675. | RegExp
  3676. | ExternalItem[]
  3677. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  3678. | ((
  3679. data: ExternalItemFunctionData,
  3680. callback: (
  3681. err?: Error,
  3682. result?: string | boolean | string[] | { [index: string]: any }
  3683. ) => void
  3684. ) => void)
  3685. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  3686. declare class ExternalsPlugin {
  3687. constructor(type: undefined | string, externals: Externals);
  3688. type?: string;
  3689. externals: Externals;
  3690. /**
  3691. * Apply the plugin
  3692. */
  3693. apply(compiler: Compiler): void;
  3694. }
  3695. /**
  3696. * Enable presets of externals for specific targets.
  3697. */
  3698. declare interface ExternalsPresets {
  3699. /**
  3700. * 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.
  3701. */
  3702. electron?: boolean;
  3703. /**
  3704. * Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.
  3705. */
  3706. electronMain?: boolean;
  3707. /**
  3708. * 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.
  3709. */
  3710. electronPreload?: boolean;
  3711. /**
  3712. * 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.
  3713. */
  3714. electronRenderer?: boolean;
  3715. /**
  3716. * Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.
  3717. */
  3718. node?: boolean;
  3719. /**
  3720. * Treat NW.js legacy nw.gui module as external and load it via require() when used.
  3721. */
  3722. nwjs?: boolean;
  3723. /**
  3724. * 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).
  3725. */
  3726. web?: boolean;
  3727. /**
  3728. * 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).
  3729. */
  3730. webAsync?: boolean;
  3731. }
  3732. type ExternalsType =
  3733. | "import"
  3734. | "var"
  3735. | "module"
  3736. | "assign"
  3737. | "this"
  3738. | "window"
  3739. | "self"
  3740. | "global"
  3741. | "commonjs"
  3742. | "commonjs2"
  3743. | "commonjs-module"
  3744. | "commonjs-static"
  3745. | "amd"
  3746. | "amd-require"
  3747. | "umd"
  3748. | "umd2"
  3749. | "jsonp"
  3750. | "system"
  3751. | "promise"
  3752. | "script"
  3753. | "node-commonjs";
  3754. declare interface FactorizeModuleOptions {
  3755. currentProfile: ModuleProfile;
  3756. factory: ModuleFactory;
  3757. dependencies: Dependency[];
  3758. /**
  3759. * return full ModuleFactoryResult instead of only module
  3760. */
  3761. factoryResult?: boolean;
  3762. originModule: null | Module;
  3763. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  3764. context?: string;
  3765. }
  3766. type FakeHook<T> = T & FakeHookMarker;
  3767. declare interface FakeHookMarker {}
  3768. declare interface FallbackCacheGroup {
  3769. chunksFilter: (chunk: Chunk) => boolean;
  3770. minSize: SplitChunksSizes;
  3771. maxAsyncSize: SplitChunksSizes;
  3772. maxInitialSize: SplitChunksSizes;
  3773. automaticNameDelimiter: string;
  3774. }
  3775. declare class FetchCompileAsyncWasmPlugin {
  3776. constructor();
  3777. /**
  3778. * Apply the plugin
  3779. */
  3780. apply(compiler: Compiler): void;
  3781. }
  3782. declare class FetchCompileWasmPlugin {
  3783. constructor(options?: any);
  3784. options: any;
  3785. /**
  3786. * Apply the plugin
  3787. */
  3788. apply(compiler: Compiler): void;
  3789. }
  3790. /**
  3791. * Options object for persistent file-based caching.
  3792. */
  3793. declare interface FileCacheOptions {
  3794. /**
  3795. * Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.
  3796. */
  3797. allowCollectingMemory?: boolean;
  3798. /**
  3799. * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').
  3800. */
  3801. buildDependencies?: { [index: string]: string[] };
  3802. /**
  3803. * Base directory for the cache (defaults to node_modules/.cache/webpack).
  3804. */
  3805. cacheDirectory?: string;
  3806. /**
  3807. * Locations for the cache (defaults to cacheDirectory / name).
  3808. */
  3809. cacheLocation?: string;
  3810. /**
  3811. * Compression type used for the cache files.
  3812. */
  3813. compression?: false | "gzip" | "brotli";
  3814. /**
  3815. * Algorithm used for generation the hash (see node.js crypto package).
  3816. */
  3817. hashAlgorithm?: string;
  3818. /**
  3819. * Time in ms after which idle period the cache storing should happen.
  3820. */
  3821. idleTimeout?: number;
  3822. /**
  3823. * 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).
  3824. */
  3825. idleTimeoutAfterLargeChanges?: number;
  3826. /**
  3827. * Time in ms after which idle period the initial cache storing should happen.
  3828. */
  3829. idleTimeoutForInitialStore?: number;
  3830. /**
  3831. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  3832. */
  3833. immutablePaths?: (string | RegExp)[];
  3834. /**
  3835. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  3836. */
  3837. managedPaths?: (string | RegExp)[];
  3838. /**
  3839. * Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).
  3840. */
  3841. maxAge?: number;
  3842. /**
  3843. * 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.
  3844. */
  3845. maxMemoryGenerations?: number;
  3846. /**
  3847. * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
  3848. */
  3849. memoryCacheUnaffected?: boolean;
  3850. /**
  3851. * Name for the cache. Different names will lead to different coexisting caches.
  3852. */
  3853. name?: string;
  3854. /**
  3855. * Track and log detailed timing information for individual cache items.
  3856. */
  3857. profile?: boolean;
  3858. /**
  3859. * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
  3860. */
  3861. store?: "pack";
  3862. /**
  3863. * Filesystem caching.
  3864. */
  3865. type: "filesystem";
  3866. /**
  3867. * 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.
  3868. */
  3869. version?: string;
  3870. }
  3871. declare interface FileSystem {
  3872. readFile: {
  3873. (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
  3874. (
  3875. arg0: string,
  3876. arg1: object,
  3877. arg2: FileSystemCallback<string | Buffer>
  3878. ): void;
  3879. };
  3880. readdir: (
  3881. arg0: string,
  3882. arg1?:
  3883. | null
  3884. | "ascii"
  3885. | "utf8"
  3886. | "utf16le"
  3887. | "ucs2"
  3888. | "latin1"
  3889. | "binary"
  3890. | ((
  3891. arg0?: null | NodeJS.ErrnoException,
  3892. arg1?: any[] | (string | Buffer)[]
  3893. ) => void)
  3894. | ReaddirOptions
  3895. | "utf-8"
  3896. | "ucs-2"
  3897. | "base64"
  3898. | "hex"
  3899. | "buffer",
  3900. arg2?: (
  3901. arg0?: null | NodeJS.ErrnoException,
  3902. arg1?: any[] | (string | Buffer)[]
  3903. ) => void
  3904. ) => void;
  3905. readJson?: {
  3906. (arg0: string, arg1: FileSystemCallback<object>): void;
  3907. (arg0: string, arg1: object, arg2: FileSystemCallback<object>): void;
  3908. };
  3909. readlink: {
  3910. (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
  3911. (
  3912. arg0: string,
  3913. arg1: object,
  3914. arg2: FileSystemCallback<string | Buffer>
  3915. ): void;
  3916. };
  3917. lstat?: {
  3918. (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
  3919. (
  3920. arg0: string,
  3921. arg1: object,
  3922. arg2: FileSystemCallback<string | Buffer>
  3923. ): void;
  3924. };
  3925. stat: {
  3926. (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
  3927. (
  3928. arg0: string,
  3929. arg1: object,
  3930. arg2: FileSystemCallback<string | Buffer>
  3931. ): void;
  3932. };
  3933. }
  3934. declare interface FileSystemCallback<T> {
  3935. (err?: null | (PossibleFileSystemError & Error), result?: T): any;
  3936. }
  3937. declare abstract class FileSystemInfo {
  3938. fs: InputFileSystem;
  3939. logger?: WebpackLogger;
  3940. fileTimestampQueue: AsyncQueue<string, string, null | FileSystemInfoEntry>;
  3941. fileHashQueue: AsyncQueue<string, string, null | string>;
  3942. contextTimestampQueue: AsyncQueue<
  3943. string,
  3944. string,
  3945. null | ContextFileSystemInfoEntry
  3946. >;
  3947. contextHashQueue: AsyncQueue<string, string, null | ContextHash>;
  3948. contextTshQueue: AsyncQueue<string, string, null | ContextTimestampAndHash>;
  3949. managedItemQueue: AsyncQueue<string, string, null | string>;
  3950. managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
  3951. managedPaths: (string | RegExp)[];
  3952. managedPathsWithSlash: string[];
  3953. managedPathsRegExps: RegExp[];
  3954. immutablePaths: (string | RegExp)[];
  3955. immutablePathsWithSlash: string[];
  3956. immutablePathsRegExps: RegExp[];
  3957. logStatistics(): void;
  3958. clear(): void;
  3959. addFileTimestamps(
  3960. map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
  3961. immutable?: boolean
  3962. ): void;
  3963. addContextTimestamps(
  3964. map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
  3965. immutable?: boolean
  3966. ): void;
  3967. getFileTimestamp(
  3968. path: string,
  3969. callback: (
  3970. arg0?: null | WebpackError,
  3971. arg1?: null | FileSystemInfoEntry | "ignore"
  3972. ) => void
  3973. ): void;
  3974. getContextTimestamp(
  3975. path: string,
  3976. callback: (
  3977. arg0?: null | WebpackError,
  3978. arg1?: null | "ignore" | ResolvedContextFileSystemInfoEntry
  3979. ) => void
  3980. ): void;
  3981. getFileHash(
  3982. path: string,
  3983. callback: (arg0?: null | WebpackError, arg1?: string) => void
  3984. ): void;
  3985. getContextHash(
  3986. path: string,
  3987. callback: (arg0?: null | WebpackError, arg1?: string) => void
  3988. ): void;
  3989. getContextTsh(
  3990. path: string,
  3991. callback: (
  3992. arg0?: null | WebpackError,
  3993. arg1?: ResolvedContextTimestampAndHash
  3994. ) => void
  3995. ): void;
  3996. resolveBuildDependencies(
  3997. context: string,
  3998. deps: Iterable<string>,
  3999. callback: (
  4000. arg0?: null | Error,
  4001. arg1?: ResolveBuildDependenciesResult
  4002. ) => void
  4003. ): void;
  4004. checkResolveResultsValid(
  4005. resolveResults: Map<string, string | false>,
  4006. callback: (arg0?: null | Error, arg1?: boolean) => void
  4007. ): void;
  4008. createSnapshot(
  4009. startTime: number,
  4010. files: Iterable<string>,
  4011. directories: Iterable<string>,
  4012. missing: Iterable<string>,
  4013. options: {
  4014. /**
  4015. * Use hashes of the content of the files/directories to determine invalidation.
  4016. */
  4017. hash?: boolean;
  4018. /**
  4019. * Use timestamps of the files/directories to determine invalidation.
  4020. */
  4021. timestamp?: boolean;
  4022. },
  4023. callback: (arg0?: null | WebpackError, arg1?: null | Snapshot) => void
  4024. ): void;
  4025. mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
  4026. checkSnapshotValid(
  4027. snapshot: Snapshot,
  4028. callback: (arg0?: null | WebpackError, arg1?: boolean) => void
  4029. ): void;
  4030. getDeprecatedFileTimestamps(): Map<any, any>;
  4031. getDeprecatedContextTimestamps(): Map<any, any>;
  4032. }
  4033. declare interface FileSystemInfoEntry {
  4034. safeTime: number;
  4035. timestamp?: number;
  4036. }
  4037. declare interface FileSystemStats {
  4038. isDirectory: () => boolean;
  4039. isFile: () => boolean;
  4040. }
  4041. type FilterItemTypes = string | RegExp | ((value: string) => boolean);
  4042. declare interface GenerateContext {
  4043. /**
  4044. * mapping from dependencies to templates
  4045. */
  4046. dependencyTemplates: DependencyTemplates;
  4047. /**
  4048. * the runtime template
  4049. */
  4050. runtimeTemplate: RuntimeTemplate;
  4051. /**
  4052. * the module graph
  4053. */
  4054. moduleGraph: ModuleGraph;
  4055. /**
  4056. * the chunk graph
  4057. */
  4058. chunkGraph: ChunkGraph;
  4059. /**
  4060. * the requirements for runtime
  4061. */
  4062. runtimeRequirements: Set<string>;
  4063. /**
  4064. * the runtime
  4065. */
  4066. runtime: RuntimeSpec;
  4067. /**
  4068. * when in concatenated module, information about other concatenated modules
  4069. */
  4070. concatenationScope?: ConcatenationScope;
  4071. /**
  4072. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  4073. */
  4074. codeGenerationResults?: CodeGenerationResults;
  4075. /**
  4076. * which kind of code should be generated
  4077. */
  4078. type: string;
  4079. /**
  4080. * get access to the code generation data
  4081. */
  4082. getData?: () => Map<string, any>;
  4083. }
  4084. declare class Generator {
  4085. constructor();
  4086. getTypes(module: NormalModule): Set<string>;
  4087. getSize(module: NormalModule, type?: string): number;
  4088. generate(module: NormalModule, __1: GenerateContext): Source;
  4089. getConcatenationBailoutReason(
  4090. module: NormalModule,
  4091. context: ConcatenationBailoutReasonContext
  4092. ): undefined | string;
  4093. updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
  4094. static byType(map?: any): ByTypeGenerator;
  4095. }
  4096. type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
  4097. GeneratorOptionsByModuleTypeUnknown;
  4098. /**
  4099. * Specify options for each generator.
  4100. */
  4101. declare interface GeneratorOptionsByModuleTypeKnown {
  4102. /**
  4103. * Generator options for asset modules.
  4104. */
  4105. asset?: AssetGeneratorOptions;
  4106. /**
  4107. * Generator options for asset/inline modules.
  4108. */
  4109. "asset/inline"?: AssetInlineGeneratorOptions;
  4110. /**
  4111. * Generator options for asset/resource modules.
  4112. */
  4113. "asset/resource"?: AssetResourceGeneratorOptions;
  4114. /**
  4115. * No generator options are supported for this module type.
  4116. */
  4117. javascript?: EmptyGeneratorOptions;
  4118. /**
  4119. * No generator options are supported for this module type.
  4120. */
  4121. "javascript/auto"?: EmptyGeneratorOptions;
  4122. /**
  4123. * No generator options are supported for this module type.
  4124. */
  4125. "javascript/dynamic"?: EmptyGeneratorOptions;
  4126. /**
  4127. * No generator options are supported for this module type.
  4128. */
  4129. "javascript/esm"?: EmptyGeneratorOptions;
  4130. }
  4131. /**
  4132. * Specify options for each generator.
  4133. */
  4134. declare interface GeneratorOptionsByModuleTypeUnknown {
  4135. [index: string]: { [index: string]: any };
  4136. }
  4137. declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
  4138. constructor(
  4139. contentType: string,
  4140. name: string,
  4141. global: string,
  4142. getFilenameForChunk: (
  4143. arg0: Chunk
  4144. ) => string | ((arg0: PathData, arg1?: AssetInfo) => string),
  4145. allChunks: boolean
  4146. );
  4147. contentType: string;
  4148. global: string;
  4149. getFilenameForChunk: (
  4150. arg0: Chunk
  4151. ) => string | ((arg0: PathData, arg1?: AssetInfo) => string);
  4152. allChunks: boolean;
  4153. /**
  4154. * Runtime modules without any dependencies to other runtime modules
  4155. */
  4156. static STAGE_NORMAL: number;
  4157. /**
  4158. * Runtime modules with simple dependencies on other runtime modules
  4159. */
  4160. static STAGE_BASIC: number;
  4161. /**
  4162. * Runtime modules which attach to handlers of other runtime modules
  4163. */
  4164. static STAGE_ATTACH: number;
  4165. /**
  4166. * Runtime modules which trigger actions on bootstrap
  4167. */
  4168. static STAGE_TRIGGER: number;
  4169. }
  4170. declare interface GroupConfig {
  4171. getKeys: (arg0?: any) => string[];
  4172. createGroup: (arg0: string, arg1: any[], arg2: any[]) => object;
  4173. getOptions?: (arg0: string, arg1: any[]) => GroupOptions;
  4174. }
  4175. declare interface GroupOptions {
  4176. groupChildren?: boolean;
  4177. force?: boolean;
  4178. targetGroupCount?: number;
  4179. }
  4180. declare interface HMRJavascriptParserHooks {
  4181. hotAcceptCallback: SyncBailHook<[any, string[]], void>;
  4182. hotAcceptWithoutCallback: SyncBailHook<[any, string[]], void>;
  4183. }
  4184. declare interface HandleModuleCreationOptions {
  4185. factory: ModuleFactory;
  4186. dependencies: Dependency[];
  4187. originModule: null | Module;
  4188. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  4189. context?: string;
  4190. /**
  4191. * recurse into dependencies of the created module
  4192. */
  4193. recursive?: boolean;
  4194. /**
  4195. * connect the resolved module with the origin module
  4196. */
  4197. connectOrigin?: boolean;
  4198. }
  4199. declare class HarmonyImportDependency extends ModuleDependency {
  4200. constructor(
  4201. request: string,
  4202. sourceOrder: number,
  4203. assertions?: Record<string, any>
  4204. );
  4205. sourceOrder: number;
  4206. getImportVar(moduleGraph: ModuleGraph): string;
  4207. getImportStatement(
  4208. update: boolean,
  4209. __1: DependencyTemplateContext
  4210. ): [string, string];
  4211. getLinkingErrors(
  4212. moduleGraph: ModuleGraph,
  4213. ids: string[],
  4214. additionalMessage: string
  4215. ): undefined | WebpackError[];
  4216. static Template: typeof HarmonyImportDependencyTemplate;
  4217. static ExportPresenceModes: {
  4218. NONE: 0;
  4219. WARN: 1;
  4220. AUTO: 2;
  4221. ERROR: 3;
  4222. fromUserOption(str?: any): 0 | 1 | 2 | 3;
  4223. };
  4224. static NO_EXPORTS_REFERENCED: string[][];
  4225. static EXPORTS_OBJECT_REFERENCED: string[][];
  4226. static TRANSITIVE: typeof TRANSITIVE;
  4227. }
  4228. declare class HarmonyImportDependencyTemplate extends DependencyTemplate {
  4229. constructor();
  4230. static getImportEmittedRuntime(
  4231. module: Module,
  4232. referencedModule: Module
  4233. ): undefined | string | boolean | SortableSet<string>;
  4234. }
  4235. declare class Hash {
  4236. constructor();
  4237. /**
  4238. * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
  4239. */
  4240. update(data: string | Buffer, inputEncoding?: string): Hash;
  4241. /**
  4242. * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
  4243. */
  4244. digest(encoding?: string): string | Buffer;
  4245. }
  4246. declare interface HashableObject {
  4247. updateHash: (arg0: Hash) => void;
  4248. }
  4249. declare class HashedModuleIdsPlugin {
  4250. constructor(options?: HashedModuleIdsPluginOptions);
  4251. options: HashedModuleIdsPluginOptions;
  4252. apply(compiler?: any): void;
  4253. }
  4254. declare interface HashedModuleIdsPluginOptions {
  4255. /**
  4256. * The context directory for creating names.
  4257. */
  4258. context?: string;
  4259. /**
  4260. * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
  4261. */
  4262. hashDigest?: "latin1" | "base64" | "hex";
  4263. /**
  4264. * The prefix length of the hash digest to use, defaults to 4.
  4265. */
  4266. hashDigestLength?: number;
  4267. /**
  4268. * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
  4269. */
  4270. hashFunction?: string | typeof Hash;
  4271. }
  4272. declare abstract class HelperRuntimeModule extends RuntimeModule {}
  4273. declare class HotModuleReplacementPlugin {
  4274. constructor(options?: any);
  4275. options: any;
  4276. /**
  4277. * Apply the plugin
  4278. */
  4279. apply(compiler: Compiler): void;
  4280. static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
  4281. }
  4282. /**
  4283. * These properties are added by the HotModuleReplacementPlugin
  4284. */
  4285. declare interface HotModuleReplacementPluginLoaderContext {
  4286. hot?: boolean;
  4287. }
  4288. declare class HotUpdateChunk extends Chunk {
  4289. constructor();
  4290. }
  4291. /**
  4292. * Options for building http resources.
  4293. */
  4294. declare interface HttpUriOptions {
  4295. /**
  4296. * List of allowed URIs (resp. the beginning of them).
  4297. */
  4298. allowedUris: (string | RegExp | ((uri: string) => boolean))[];
  4299. /**
  4300. * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
  4301. */
  4302. cacheLocation?: string | false;
  4303. /**
  4304. * When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
  4305. */
  4306. frozen?: boolean;
  4307. /**
  4308. * Location of the lockfile.
  4309. */
  4310. lockfileLocation?: string;
  4311. /**
  4312. * Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.
  4313. */
  4314. proxy?: string;
  4315. /**
  4316. * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
  4317. */
  4318. upgrade?: boolean;
  4319. }
  4320. declare class HttpUriPlugin {
  4321. constructor(options: HttpUriOptions);
  4322. /**
  4323. * Apply the plugin
  4324. */
  4325. apply(compiler: Compiler): void;
  4326. }
  4327. declare interface IDirent {
  4328. isFile: () => boolean;
  4329. isDirectory: () => boolean;
  4330. isBlockDevice: () => boolean;
  4331. isCharacterDevice: () => boolean;
  4332. isSymbolicLink: () => boolean;
  4333. isFIFO: () => boolean;
  4334. isSocket: () => boolean;
  4335. name: string | Buffer;
  4336. }
  4337. declare interface IStats {
  4338. isFile: () => boolean;
  4339. isDirectory: () => boolean;
  4340. isBlockDevice: () => boolean;
  4341. isCharacterDevice: () => boolean;
  4342. isSymbolicLink: () => boolean;
  4343. isFIFO: () => boolean;
  4344. isSocket: () => boolean;
  4345. dev: number | bigint;
  4346. ino: number | bigint;
  4347. mode: number | bigint;
  4348. nlink: number | bigint;
  4349. uid: number | bigint;
  4350. gid: number | bigint;
  4351. rdev: number | bigint;
  4352. size: number | bigint;
  4353. blksize: number | bigint;
  4354. blocks: number | bigint;
  4355. atimeMs: number | bigint;
  4356. mtimeMs: number | bigint;
  4357. ctimeMs: number | bigint;
  4358. birthtimeMs: number | bigint;
  4359. atime: Date;
  4360. mtime: Date;
  4361. ctime: Date;
  4362. birthtime: Date;
  4363. }
  4364. declare class IgnorePlugin {
  4365. constructor(options: IgnorePluginOptions);
  4366. options: IgnorePluginOptions;
  4367. /**
  4368. * Note that if "contextRegExp" is given, both the "resourceRegExp"
  4369. * and "contextRegExp" have to match.
  4370. */
  4371. checkIgnore(resolveData: ResolveData): undefined | false;
  4372. /**
  4373. * Apply the plugin
  4374. */
  4375. apply(compiler: Compiler): void;
  4376. }
  4377. type IgnorePluginOptions =
  4378. | {
  4379. /**
  4380. * A RegExp to test the context (directory) against.
  4381. */
  4382. contextRegExp?: RegExp;
  4383. /**
  4384. * A RegExp to test the request against.
  4385. */
  4386. resourceRegExp: RegExp;
  4387. }
  4388. | {
  4389. /**
  4390. * A filter function for resource and context.
  4391. */
  4392. checkResource: (resource: string, context: string) => boolean;
  4393. };
  4394. declare interface ImportModuleOptions {
  4395. /**
  4396. * the target layer
  4397. */
  4398. layer?: string;
  4399. /**
  4400. * the target public path
  4401. */
  4402. publicPath?: string;
  4403. /**
  4404. * target base uri
  4405. */
  4406. baseUri?: string;
  4407. }
  4408. type ImportSource =
  4409. | undefined
  4410. | null
  4411. | string
  4412. | SimpleLiteral
  4413. | RegExpLiteral
  4414. | BigIntLiteral;
  4415. /**
  4416. * Options for infrastructure level logging.
  4417. */
  4418. declare interface InfrastructureLogging {
  4419. /**
  4420. * 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.
  4421. */
  4422. appendOnly?: boolean;
  4423. /**
  4424. * Enables/Disables colorful output. This option is only used when no custom console is provided.
  4425. */
  4426. colors?: boolean;
  4427. /**
  4428. * Custom console used for logging.
  4429. */
  4430. console?: Console;
  4431. /**
  4432. * Enable debug logging for specific loggers.
  4433. */
  4434. debug?:
  4435. | string
  4436. | boolean
  4437. | RegExp
  4438. | FilterItemTypes[]
  4439. | ((value: string) => boolean);
  4440. /**
  4441. * Log level.
  4442. */
  4443. level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
  4444. /**
  4445. * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
  4446. */
  4447. stream?: NodeJS.WritableStream;
  4448. }
  4449. declare abstract class InitFragment<Context> {
  4450. content: string | Source;
  4451. stage: number;
  4452. position: number;
  4453. key?: string;
  4454. endContent?: string | Source;
  4455. getContent(context: Context): string | Source;
  4456. getEndContent(context: Context): undefined | string | Source;
  4457. serialize(context?: any): void;
  4458. deserialize(context?: any): void;
  4459. merge: any;
  4460. }
  4461. declare interface InputFileSystem {
  4462. readFile: (
  4463. arg0: string,
  4464. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
  4465. ) => void;
  4466. readJson?: (
  4467. arg0: string,
  4468. arg1: (arg0?: null | Error | NodeJS.ErrnoException, arg1?: any) => void
  4469. ) => void;
  4470. readlink: (
  4471. arg0: string,
  4472. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
  4473. ) => void;
  4474. readdir: (
  4475. arg0: string,
  4476. arg1: (
  4477. arg0?: null | NodeJS.ErrnoException,
  4478. arg1?: (string | Buffer)[] | IDirent[]
  4479. ) => void
  4480. ) => void;
  4481. stat: (
  4482. arg0: string,
  4483. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
  4484. ) => void;
  4485. lstat?: (
  4486. arg0: string,
  4487. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
  4488. ) => void;
  4489. realpath?: (
  4490. arg0: string,
  4491. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
  4492. ) => void;
  4493. purge?: (arg0?: string) => void;
  4494. join?: (arg0: string, arg1: string) => string;
  4495. relative?: (arg0: string, arg1: string) => string;
  4496. dirname?: (arg0: string) => string;
  4497. }
  4498. type IntermediateFileSystem = InputFileSystem &
  4499. OutputFileSystem &
  4500. IntermediateFileSystemExtras;
  4501. declare interface IntermediateFileSystemExtras {
  4502. mkdirSync: (arg0: string) => void;
  4503. createWriteStream: (arg0: string) => NodeJS.WritableStream;
  4504. open: (
  4505. arg0: string,
  4506. arg1: string,
  4507. arg2: (arg0?: null | NodeJS.ErrnoException, arg1?: number) => void
  4508. ) => void;
  4509. read: (
  4510. arg0: number,
  4511. arg1: Buffer,
  4512. arg2: number,
  4513. arg3: number,
  4514. arg4: number,
  4515. arg5: (arg0?: null | NodeJS.ErrnoException, arg1?: number) => void
  4516. ) => void;
  4517. close: (
  4518. arg0: number,
  4519. arg1: (arg0?: null | NodeJS.ErrnoException) => void
  4520. ) => void;
  4521. rename: (
  4522. arg0: string,
  4523. arg1: string,
  4524. arg2: (arg0?: null | NodeJS.ErrnoException) => void
  4525. ) => void;
  4526. }
  4527. type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
  4528. declare abstract class ItemCacheFacade {
  4529. get<T>(callback: CallbackCache<T>): void;
  4530. getPromise<T>(): Promise<T>;
  4531. store<T>(data: T, callback: CallbackCache<void>): void;
  4532. storePromise<T>(data: T): Promise<void>;
  4533. provide<T>(
  4534. computer: (arg0: CallbackNormalErrorCache<T>) => void,
  4535. callback: CallbackNormalErrorCache<T>
  4536. ): void;
  4537. providePromise<T>(computer: () => T | Promise<T>): Promise<T>;
  4538. }
  4539. declare class JavascriptModulesPlugin {
  4540. constructor(options?: object);
  4541. options: object;
  4542. /**
  4543. * Apply the plugin
  4544. */
  4545. apply(compiler: Compiler): void;
  4546. renderModule(
  4547. module: Module,
  4548. renderContext: ChunkRenderContext,
  4549. hooks: CompilationHooksJavascriptModulesPlugin,
  4550. factory: boolean
  4551. ): Source;
  4552. renderChunk(
  4553. renderContext: RenderContext,
  4554. hooks: CompilationHooksJavascriptModulesPlugin
  4555. ): Source;
  4556. renderMain(
  4557. renderContext: MainRenderContext,
  4558. hooks: CompilationHooksJavascriptModulesPlugin,
  4559. compilation: Compilation
  4560. ): Source;
  4561. updateHashWithBootstrap(
  4562. hash: Hash,
  4563. renderContext: RenderBootstrapContext,
  4564. hooks: CompilationHooksJavascriptModulesPlugin
  4565. ): void;
  4566. renderBootstrap(
  4567. renderContext: RenderBootstrapContext,
  4568. hooks: CompilationHooksJavascriptModulesPlugin
  4569. ): {
  4570. header: string[];
  4571. beforeStartup: string[];
  4572. startup: string[];
  4573. afterStartup: string[];
  4574. allowInlineStartup: boolean;
  4575. };
  4576. renderRequire(
  4577. renderContext: RenderBootstrapContext,
  4578. hooks: CompilationHooksJavascriptModulesPlugin
  4579. ): string;
  4580. static getCompilationHooks(
  4581. compilation: Compilation
  4582. ): CompilationHooksJavascriptModulesPlugin;
  4583. static getChunkFilenameTemplate(chunk?: any, outputOptions?: any): any;
  4584. static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
  4585. }
  4586. declare class JavascriptParser extends Parser {
  4587. constructor(sourceType?: "module" | "auto" | "script");
  4588. hooks: Readonly<{
  4589. evaluateTypeof: HookMap<
  4590. SyncBailHook<
  4591. [UnaryExpression],
  4592. undefined | null | BasicEvaluatedExpression
  4593. >
  4594. >;
  4595. evaluate: HookMap<
  4596. SyncBailHook<[Expression], undefined | null | BasicEvaluatedExpression>
  4597. >;
  4598. evaluateIdentifier: HookMap<
  4599. SyncBailHook<
  4600. [Identifier | MemberExpression | MetaProperty | ThisExpression],
  4601. undefined | null | BasicEvaluatedExpression
  4602. >
  4603. >;
  4604. evaluateDefinedIdentifier: HookMap<
  4605. SyncBailHook<
  4606. [Identifier | MemberExpression | ThisExpression],
  4607. undefined | null | BasicEvaluatedExpression
  4608. >
  4609. >;
  4610. evaluateNewExpression: HookMap<
  4611. SyncBailHook<[NewExpression], undefined | null | BasicEvaluatedExpression>
  4612. >;
  4613. evaluateCallExpression: HookMap<
  4614. SyncBailHook<
  4615. [CallExpression],
  4616. undefined | null | BasicEvaluatedExpression
  4617. >
  4618. >;
  4619. evaluateCallExpressionMember: HookMap<
  4620. SyncBailHook<
  4621. [CallExpression, undefined | BasicEvaluatedExpression],
  4622. undefined | null | BasicEvaluatedExpression
  4623. >
  4624. >;
  4625. isPure: HookMap<
  4626. SyncBailHook<
  4627. [
  4628. (
  4629. | UnaryExpression
  4630. | ArrayExpression
  4631. | ArrowFunctionExpression
  4632. | AssignmentExpression
  4633. | AwaitExpression
  4634. | BinaryExpression
  4635. | SimpleCallExpression
  4636. | NewExpression
  4637. | ChainExpression
  4638. | ClassExpression
  4639. | ConditionalExpression
  4640. | FunctionExpression
  4641. | Identifier
  4642. | ImportExpression
  4643. | SimpleLiteral
  4644. | RegExpLiteral
  4645. | BigIntLiteral
  4646. | LogicalExpression
  4647. | MemberExpression
  4648. | MetaProperty
  4649. | ObjectExpression
  4650. | SequenceExpression
  4651. | TaggedTemplateExpression
  4652. | TemplateLiteral
  4653. | ThisExpression
  4654. | UpdateExpression
  4655. | YieldExpression
  4656. | FunctionDeclaration
  4657. | VariableDeclaration
  4658. | ClassDeclaration
  4659. | PrivateIdentifier
  4660. ),
  4661. number
  4662. ],
  4663. boolean | void
  4664. >
  4665. >;
  4666. preStatement: SyncBailHook<
  4667. [
  4668. | FunctionDeclaration
  4669. | VariableDeclaration
  4670. | ClassDeclaration
  4671. | ExpressionStatement
  4672. | BlockStatement
  4673. | StaticBlock
  4674. | EmptyStatement
  4675. | DebuggerStatement
  4676. | WithStatement
  4677. | ReturnStatement
  4678. | LabeledStatement
  4679. | BreakStatement
  4680. | ContinueStatement
  4681. | IfStatement
  4682. | SwitchStatement
  4683. | ThrowStatement
  4684. | TryStatement
  4685. | WhileStatement
  4686. | DoWhileStatement
  4687. | ForStatement
  4688. | ForInStatement
  4689. | ForOfStatement
  4690. | ImportDeclaration
  4691. | ExportNamedDeclaration
  4692. | ExportDefaultDeclaration
  4693. | ExportAllDeclaration
  4694. ],
  4695. boolean | void
  4696. >;
  4697. blockPreStatement: SyncBailHook<
  4698. [
  4699. | FunctionDeclaration
  4700. | VariableDeclaration
  4701. | ClassDeclaration
  4702. | ExpressionStatement
  4703. | BlockStatement
  4704. | StaticBlock
  4705. | EmptyStatement
  4706. | DebuggerStatement
  4707. | WithStatement
  4708. | ReturnStatement
  4709. | LabeledStatement
  4710. | BreakStatement
  4711. | ContinueStatement
  4712. | IfStatement
  4713. | SwitchStatement
  4714. | ThrowStatement
  4715. | TryStatement
  4716. | WhileStatement
  4717. | DoWhileStatement
  4718. | ForStatement
  4719. | ForInStatement
  4720. | ForOfStatement
  4721. | ImportDeclaration
  4722. | ExportNamedDeclaration
  4723. | ExportDefaultDeclaration
  4724. | ExportAllDeclaration
  4725. ],
  4726. boolean | void
  4727. >;
  4728. statement: SyncBailHook<
  4729. [
  4730. | FunctionDeclaration
  4731. | VariableDeclaration
  4732. | ClassDeclaration
  4733. | ExpressionStatement
  4734. | BlockStatement
  4735. | StaticBlock
  4736. | EmptyStatement
  4737. | DebuggerStatement
  4738. | WithStatement
  4739. | ReturnStatement
  4740. | LabeledStatement
  4741. | BreakStatement
  4742. | ContinueStatement
  4743. | IfStatement
  4744. | SwitchStatement
  4745. | ThrowStatement
  4746. | TryStatement
  4747. | WhileStatement
  4748. | DoWhileStatement
  4749. | ForStatement
  4750. | ForInStatement
  4751. | ForOfStatement
  4752. | ImportDeclaration
  4753. | ExportNamedDeclaration
  4754. | ExportDefaultDeclaration
  4755. | ExportAllDeclaration
  4756. ],
  4757. boolean | void
  4758. >;
  4759. statementIf: SyncBailHook<[IfStatement], boolean | void>;
  4760. classExtendsExpression: SyncBailHook<
  4761. [Expression, ClassExpression | ClassDeclaration],
  4762. boolean | void
  4763. >;
  4764. classBodyElement: SyncBailHook<
  4765. [
  4766. MethodDefinition | PropertyDefinition,
  4767. ClassExpression | ClassDeclaration
  4768. ],
  4769. boolean | void
  4770. >;
  4771. classBodyValue: SyncBailHook<
  4772. [
  4773. Expression,
  4774. MethodDefinition | PropertyDefinition,
  4775. ClassExpression | ClassDeclaration
  4776. ],
  4777. boolean | void
  4778. >;
  4779. label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
  4780. import: SyncBailHook<[ImportDeclaration, ImportSource], boolean | void>;
  4781. importSpecifier: SyncBailHook<
  4782. [ImportDeclaration, ImportSource, string, string],
  4783. boolean | void
  4784. >;
  4785. export: SyncBailHook<
  4786. [ExportNamedDeclaration | ExportAllDeclaration],
  4787. boolean | void
  4788. >;
  4789. exportImport: SyncBailHook<
  4790. [ExportNamedDeclaration | ExportAllDeclaration, ImportSource],
  4791. boolean | void
  4792. >;
  4793. exportDeclaration: SyncBailHook<
  4794. [ExportNamedDeclaration | ExportAllDeclaration, Declaration],
  4795. boolean | void
  4796. >;
  4797. exportExpression: SyncBailHook<
  4798. [ExportDefaultDeclaration, Declaration],
  4799. boolean | void
  4800. >;
  4801. exportSpecifier: SyncBailHook<
  4802. [
  4803. ExportNamedDeclaration | ExportAllDeclaration,
  4804. string,
  4805. string,
  4806. undefined | number
  4807. ],
  4808. boolean | void
  4809. >;
  4810. exportImportSpecifier: SyncBailHook<
  4811. [
  4812. ExportNamedDeclaration | ExportAllDeclaration,
  4813. ImportSource,
  4814. string,
  4815. string,
  4816. undefined | number
  4817. ],
  4818. boolean | void
  4819. >;
  4820. preDeclarator: SyncBailHook<
  4821. [VariableDeclarator, Statement],
  4822. boolean | void
  4823. >;
  4824. declarator: SyncBailHook<[VariableDeclarator, Statement], boolean | void>;
  4825. varDeclaration: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  4826. varDeclarationLet: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  4827. varDeclarationConst: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  4828. varDeclarationVar: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  4829. pattern: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  4830. canRename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  4831. rename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  4832. assign: HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>;
  4833. assignMemberChain: HookMap<
  4834. SyncBailHook<[AssignmentExpression, string[]], boolean | void>
  4835. >;
  4836. typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
  4837. importCall: SyncBailHook<[Expression], boolean | void>;
  4838. topLevelAwait: SyncBailHook<[Expression], boolean | void>;
  4839. call: HookMap<SyncBailHook<[Expression], boolean | void>>;
  4840. callMemberChain: HookMap<
  4841. SyncBailHook<[CallExpression, string[], boolean[]], boolean | void>
  4842. >;
  4843. memberChainOfCallMemberChain: HookMap<
  4844. SyncBailHook<
  4845. [Expression, string[], CallExpression, string[]],
  4846. boolean | void
  4847. >
  4848. >;
  4849. callMemberChainOfCallMemberChain: HookMap<
  4850. SyncBailHook<
  4851. [Expression, string[], CallExpression, string[]],
  4852. boolean | void
  4853. >
  4854. >;
  4855. optionalChaining: SyncBailHook<[ChainExpression], boolean | void>;
  4856. new: HookMap<SyncBailHook<[NewExpression], boolean | void>>;
  4857. binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
  4858. expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
  4859. expressionMemberChain: HookMap<
  4860. SyncBailHook<[Expression, string[], boolean[]], boolean | void>
  4861. >;
  4862. unhandledExpressionMemberChain: HookMap<
  4863. SyncBailHook<[Expression, string[]], boolean | void>
  4864. >;
  4865. expressionConditionalOperator: SyncBailHook<[Expression], boolean | void>;
  4866. expressionLogicalOperator: SyncBailHook<[Expression], boolean | void>;
  4867. program: SyncBailHook<[Program, Comment[]], boolean | void>;
  4868. finish: SyncBailHook<[Program, Comment[]], boolean | void>;
  4869. }>;
  4870. sourceType: "module" | "auto" | "script";
  4871. scope: ScopeInfo;
  4872. state: ParserState;
  4873. comments: any;
  4874. semicolons: any;
  4875. statementPath: (
  4876. | UnaryExpression
  4877. | ArrayExpression
  4878. | ArrowFunctionExpression
  4879. | AssignmentExpression
  4880. | AwaitExpression
  4881. | BinaryExpression
  4882. | SimpleCallExpression
  4883. | NewExpression
  4884. | ChainExpression
  4885. | ClassExpression
  4886. | ConditionalExpression
  4887. | FunctionExpression
  4888. | Identifier
  4889. | ImportExpression
  4890. | SimpleLiteral
  4891. | RegExpLiteral
  4892. | BigIntLiteral
  4893. | LogicalExpression
  4894. | MemberExpression
  4895. | MetaProperty
  4896. | ObjectExpression
  4897. | SequenceExpression
  4898. | TaggedTemplateExpression
  4899. | TemplateLiteral
  4900. | ThisExpression
  4901. | UpdateExpression
  4902. | YieldExpression
  4903. | FunctionDeclaration
  4904. | VariableDeclaration
  4905. | ClassDeclaration
  4906. | ExpressionStatement
  4907. | BlockStatement
  4908. | StaticBlock
  4909. | EmptyStatement
  4910. | DebuggerStatement
  4911. | WithStatement
  4912. | ReturnStatement
  4913. | LabeledStatement
  4914. | BreakStatement
  4915. | ContinueStatement
  4916. | IfStatement
  4917. | SwitchStatement
  4918. | ThrowStatement
  4919. | TryStatement
  4920. | WhileStatement
  4921. | DoWhileStatement
  4922. | ForStatement
  4923. | ForInStatement
  4924. | ForOfStatement
  4925. )[];
  4926. prevStatement: any;
  4927. destructuringAssignmentProperties: WeakMap<Expression, Set<string>>;
  4928. currentTagData: any;
  4929. destructuringAssignmentPropertiesFor(
  4930. node: Expression
  4931. ): undefined | Set<string>;
  4932. getRenameIdentifier(expr?: any): undefined | string | VariableInfoInterface;
  4933. walkClass(classy: ClassExpression | ClassDeclaration): void;
  4934. preWalkStatements(statements?: any): void;
  4935. blockPreWalkStatements(statements?: any): void;
  4936. walkStatements(statements?: any): void;
  4937. preWalkStatement(statement?: any): void;
  4938. blockPreWalkStatement(statement?: any): void;
  4939. walkStatement(statement?: any): void;
  4940. /**
  4941. * Walks a statements that is nested within a parent statement
  4942. * and can potentially be a non-block statement.
  4943. * This enforces the nested statement to never be in ASI position.
  4944. */
  4945. walkNestedStatement(statement: Statement): void;
  4946. preWalkBlockStatement(statement?: any): void;
  4947. walkBlockStatement(statement?: any): void;
  4948. walkExpressionStatement(statement?: any): void;
  4949. preWalkIfStatement(statement?: any): void;
  4950. walkIfStatement(statement?: any): void;
  4951. preWalkLabeledStatement(statement?: any): void;
  4952. walkLabeledStatement(statement?: any): void;
  4953. preWalkWithStatement(statement?: any): void;
  4954. walkWithStatement(statement?: any): void;
  4955. preWalkSwitchStatement(statement?: any): void;
  4956. walkSwitchStatement(statement?: any): void;
  4957. walkTerminatingStatement(statement?: any): void;
  4958. walkReturnStatement(statement?: any): void;
  4959. walkThrowStatement(statement?: any): void;
  4960. preWalkTryStatement(statement?: any): void;
  4961. walkTryStatement(statement?: any): void;
  4962. preWalkWhileStatement(statement?: any): void;
  4963. walkWhileStatement(statement?: any): void;
  4964. preWalkDoWhileStatement(statement?: any): void;
  4965. walkDoWhileStatement(statement?: any): void;
  4966. preWalkForStatement(statement?: any): void;
  4967. walkForStatement(statement?: any): void;
  4968. preWalkForInStatement(statement?: any): void;
  4969. walkForInStatement(statement?: any): void;
  4970. preWalkForOfStatement(statement?: any): void;
  4971. walkForOfStatement(statement?: any): void;
  4972. preWalkFunctionDeclaration(statement?: any): void;
  4973. walkFunctionDeclaration(statement?: any): void;
  4974. blockPreWalkExpressionStatement(statement?: any): void;
  4975. preWalkAssignmentExpression(expression?: any): void;
  4976. blockPreWalkImportDeclaration(statement?: any): void;
  4977. enterDeclaration(declaration?: any, onIdent?: any): void;
  4978. blockPreWalkExportNamedDeclaration(statement?: any): void;
  4979. walkExportNamedDeclaration(statement?: any): void;
  4980. blockPreWalkExportDefaultDeclaration(statement?: any): void;
  4981. walkExportDefaultDeclaration(statement?: any): void;
  4982. blockPreWalkExportAllDeclaration(statement?: any): void;
  4983. preWalkVariableDeclaration(statement?: any): void;
  4984. blockPreWalkVariableDeclaration(statement?: any): void;
  4985. preWalkVariableDeclarator(declarator?: any): void;
  4986. walkVariableDeclaration(statement?: any): void;
  4987. blockPreWalkClassDeclaration(statement?: any): void;
  4988. walkClassDeclaration(statement?: any): void;
  4989. preWalkSwitchCases(switchCases?: any): void;
  4990. walkSwitchCases(switchCases?: any): void;
  4991. preWalkCatchClause(catchClause?: any): void;
  4992. walkCatchClause(catchClause?: any): void;
  4993. walkPattern(pattern?: any): void;
  4994. walkAssignmentPattern(pattern?: any): void;
  4995. walkObjectPattern(pattern?: any): void;
  4996. walkArrayPattern(pattern?: any): void;
  4997. walkRestElement(pattern?: any): void;
  4998. walkExpressions(expressions?: any): void;
  4999. walkExpression(expression?: any): void;
  5000. walkAwaitExpression(expression?: any): void;
  5001. walkArrayExpression(expression?: any): void;
  5002. walkSpreadElement(expression?: any): void;
  5003. walkObjectExpression(expression?: any): void;
  5004. walkProperty(prop?: any): void;
  5005. walkFunctionExpression(expression?: any): void;
  5006. walkArrowFunctionExpression(expression?: any): void;
  5007. walkSequenceExpression(expression: SequenceExpression): void;
  5008. walkUpdateExpression(expression?: any): void;
  5009. walkUnaryExpression(expression?: any): void;
  5010. walkLeftRightExpression(expression?: any): void;
  5011. walkBinaryExpression(expression?: any): void;
  5012. walkLogicalExpression(expression?: any): void;
  5013. walkAssignmentExpression(expression?: any): void;
  5014. walkConditionalExpression(expression?: any): void;
  5015. walkNewExpression(expression?: any): void;
  5016. walkYieldExpression(expression?: any): void;
  5017. walkTemplateLiteral(expression?: any): void;
  5018. walkTaggedTemplateExpression(expression?: any): void;
  5019. walkClassExpression(expression?: any): void;
  5020. walkChainExpression(expression: ChainExpression): void;
  5021. walkImportExpression(expression?: any): void;
  5022. walkCallExpression(expression?: any): void;
  5023. walkMemberExpression(expression?: any): void;
  5024. walkMemberExpressionWithExpressionName(
  5025. expression?: any,
  5026. name?: any,
  5027. rootInfo?: any,
  5028. members?: any,
  5029. onUnhandled?: any
  5030. ): void;
  5031. walkThisExpression(expression?: any): void;
  5032. walkIdentifier(expression?: any): void;
  5033. walkMetaProperty(metaProperty: MetaProperty): void;
  5034. callHooksForExpression(hookMap: any, expr: any, ...args: any[]): any;
  5035. callHooksForExpressionWithFallback<T, R>(
  5036. hookMap: HookMap<SyncBailHook<T, R>>,
  5037. expr: MemberExpression,
  5038. fallback: (
  5039. arg0: string,
  5040. arg1: string | ScopeInfo | VariableInfo,
  5041. arg2: () => string[]
  5042. ) => any,
  5043. defined: (arg0: string) => any,
  5044. ...args: AsArray<T>
  5045. ): R;
  5046. callHooksForName<T, R>(
  5047. hookMap: HookMap<SyncBailHook<T, R>>,
  5048. name: string,
  5049. ...args: AsArray<T>
  5050. ): R;
  5051. callHooksForInfo<T, R>(
  5052. hookMap: HookMap<SyncBailHook<T, R>>,
  5053. info: ExportedVariableInfo,
  5054. ...args: AsArray<T>
  5055. ): R;
  5056. callHooksForInfoWithFallback<T, R>(
  5057. hookMap: HookMap<SyncBailHook<T, R>>,
  5058. info: ExportedVariableInfo,
  5059. fallback: (arg0: string) => any,
  5060. defined: () => any,
  5061. ...args: AsArray<T>
  5062. ): R;
  5063. callHooksForNameWithFallback<T, R>(
  5064. hookMap: HookMap<SyncBailHook<T, R>>,
  5065. name: string,
  5066. fallback: (arg0: string) => any,
  5067. defined: () => any,
  5068. ...args: AsArray<T>
  5069. ): R;
  5070. inScope(params: any, fn: () => void): void;
  5071. inFunctionScope(hasThis?: any, params?: any, fn?: any): void;
  5072. inBlockScope(fn?: any): void;
  5073. detectMode(statements?: any): void;
  5074. enterPatterns(patterns?: any, onIdent?: any): void;
  5075. enterPattern(pattern?: any, onIdent?: any): void;
  5076. enterIdentifier(pattern?: any, onIdent?: any): void;
  5077. enterObjectPattern(pattern?: any, onIdent?: any): void;
  5078. enterArrayPattern(pattern?: any, onIdent?: any): void;
  5079. enterRestElement(pattern?: any, onIdent?: any): void;
  5080. enterAssignmentPattern(pattern?: any, onIdent?: any): void;
  5081. evaluateExpression(expression: Expression): BasicEvaluatedExpression;
  5082. parseString(expression?: any): any;
  5083. parseCalculatedString(expression?: any): any;
  5084. evaluate(source: string): BasicEvaluatedExpression;
  5085. isPure(
  5086. expr:
  5087. | undefined
  5088. | null
  5089. | UnaryExpression
  5090. | ArrayExpression
  5091. | ArrowFunctionExpression
  5092. | AssignmentExpression
  5093. | AwaitExpression
  5094. | BinaryExpression
  5095. | SimpleCallExpression
  5096. | NewExpression
  5097. | ChainExpression
  5098. | ClassExpression
  5099. | ConditionalExpression
  5100. | FunctionExpression
  5101. | Identifier
  5102. | ImportExpression
  5103. | SimpleLiteral
  5104. | RegExpLiteral
  5105. | BigIntLiteral
  5106. | LogicalExpression
  5107. | MemberExpression
  5108. | MetaProperty
  5109. | ObjectExpression
  5110. | SequenceExpression
  5111. | TaggedTemplateExpression
  5112. | TemplateLiteral
  5113. | ThisExpression
  5114. | UpdateExpression
  5115. | YieldExpression
  5116. | FunctionDeclaration
  5117. | VariableDeclaration
  5118. | ClassDeclaration
  5119. | PrivateIdentifier,
  5120. commentsStartPos: number
  5121. ): boolean;
  5122. getComments(range?: any): any[];
  5123. isAsiPosition(pos: number): boolean;
  5124. unsetAsiPosition(pos: number): void;
  5125. isStatementLevelExpression(expr?: any): boolean;
  5126. getTagData(name?: any, tag?: any): any;
  5127. tagVariable(name?: any, tag?: any, data?: any): void;
  5128. defineVariable(name?: any): void;
  5129. undefineVariable(name?: any): void;
  5130. isVariableDefined(name?: any): boolean;
  5131. getVariableInfo(name: string): ExportedVariableInfo;
  5132. setVariable(name: string, variableInfo: ExportedVariableInfo): void;
  5133. evaluatedVariable(tagInfo?: any): VariableInfo;
  5134. parseCommentOptions(
  5135. range?: any
  5136. ): { options: null; errors: null } | { options: object; errors: unknown[] };
  5137. extractMemberExpressionChain(expression: MemberExpression): {
  5138. members: string[];
  5139. object:
  5140. | UnaryExpression
  5141. | ArrayExpression
  5142. | ArrowFunctionExpression
  5143. | AssignmentExpression
  5144. | AwaitExpression
  5145. | BinaryExpression
  5146. | SimpleCallExpression
  5147. | NewExpression
  5148. | ChainExpression
  5149. | ClassExpression
  5150. | ConditionalExpression
  5151. | FunctionExpression
  5152. | Identifier
  5153. | ImportExpression
  5154. | SimpleLiteral
  5155. | RegExpLiteral
  5156. | BigIntLiteral
  5157. | LogicalExpression
  5158. | MemberExpression
  5159. | MetaProperty
  5160. | ObjectExpression
  5161. | SequenceExpression
  5162. | TaggedTemplateExpression
  5163. | TemplateLiteral
  5164. | ThisExpression
  5165. | UpdateExpression
  5166. | YieldExpression
  5167. | Super;
  5168. membersOptionals: boolean[];
  5169. };
  5170. getFreeInfoFromVariable(varName: string): {
  5171. name: string;
  5172. info: string | VariableInfo;
  5173. };
  5174. getMemberExpressionInfo(
  5175. expression: MemberExpression,
  5176. allowedTypes: number
  5177. ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
  5178. getNameForExpression(expression: MemberExpression): {
  5179. name: string;
  5180. rootInfo: ExportedVariableInfo;
  5181. getMembers: () => string[];
  5182. };
  5183. static ALLOWED_MEMBER_TYPES_ALL: 3;
  5184. static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
  5185. static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
  5186. }
  5187. /**
  5188. * Parser options for javascript modules.
  5189. */
  5190. declare interface JavascriptParserOptions {
  5191. [index: string]: any;
  5192. /**
  5193. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  5194. */
  5195. amd?: false | { [index: string]: any };
  5196. /**
  5197. * Enable/disable special handling for browserify bundles.
  5198. */
  5199. browserify?: boolean;
  5200. /**
  5201. * Enable/disable parsing of CommonJs syntax.
  5202. */
  5203. commonjs?: boolean;
  5204. /**
  5205. * Enable/disable parsing of magic comments in CommonJs syntax.
  5206. */
  5207. commonjsMagicComments?: boolean;
  5208. /**
  5209. * Enable/disable parsing "import { createRequire } from "module"" and evaluating createRequire().
  5210. */
  5211. createRequire?: string | boolean;
  5212. /**
  5213. * Specifies global mode for dynamic import.
  5214. */
  5215. dynamicImportMode?: "weak" | "eager" | "lazy" | "lazy-once";
  5216. /**
  5217. * Specifies global prefetch for dynamic import.
  5218. */
  5219. dynamicImportPrefetch?: number | boolean;
  5220. /**
  5221. * Specifies global preload for dynamic import.
  5222. */
  5223. dynamicImportPreload?: number | boolean;
  5224. /**
  5225. * Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
  5226. */
  5227. exportsPresence?: false | "auto" | "error" | "warn";
  5228. /**
  5229. * Enable warnings for full dynamic dependencies.
  5230. */
  5231. exprContextCritical?: boolean;
  5232. /**
  5233. * Enable recursive directory lookup for full dynamic dependencies.
  5234. */
  5235. exprContextRecursive?: boolean;
  5236. /**
  5237. * Sets the default regular expression for full dynamic dependencies.
  5238. */
  5239. exprContextRegExp?: boolean | RegExp;
  5240. /**
  5241. * Set the default request for full dynamic dependencies.
  5242. */
  5243. exprContextRequest?: string;
  5244. /**
  5245. * Enable/disable parsing of EcmaScript Modules syntax.
  5246. */
  5247. harmony?: boolean;
  5248. /**
  5249. * Enable/disable parsing of import() syntax.
  5250. */
  5251. import?: boolean;
  5252. /**
  5253. * Specifies the behavior of invalid export names in "import ... from ...".
  5254. */
  5255. importExportsPresence?: false | "auto" | "error" | "warn";
  5256. /**
  5257. * Enable/disable evaluating import.meta.
  5258. */
  5259. importMeta?: boolean;
  5260. /**
  5261. * Enable/disable evaluating import.meta.webpackContext.
  5262. */
  5263. importMetaContext?: boolean;
  5264. /**
  5265. * Include polyfills or mocks for various node stuff.
  5266. */
  5267. node?: false | NodeOptions;
  5268. /**
  5269. * 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.
  5270. */
  5271. reexportExportsPresence?: false | "auto" | "error" | "warn";
  5272. /**
  5273. * Enable/disable parsing of require.context syntax.
  5274. */
  5275. requireContext?: boolean;
  5276. /**
  5277. * Enable/disable parsing of require.ensure syntax.
  5278. */
  5279. requireEnsure?: boolean;
  5280. /**
  5281. * Enable/disable parsing of require.include syntax.
  5282. */
  5283. requireInclude?: boolean;
  5284. /**
  5285. * Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
  5286. */
  5287. requireJs?: boolean;
  5288. /**
  5289. * Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
  5290. */
  5291. strictExportPresence?: boolean;
  5292. /**
  5293. * Handle the this context correctly according to the spec for namespace objects.
  5294. */
  5295. strictThisContextOnImports?: boolean;
  5296. /**
  5297. * Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
  5298. */
  5299. system?: boolean;
  5300. /**
  5301. * Enable warnings when using the require function in a not statically analyse-able way.
  5302. */
  5303. unknownContextCritical?: boolean;
  5304. /**
  5305. * Enable recursive directory lookup when using the require function in a not statically analyse-able way.
  5306. */
  5307. unknownContextRecursive?: boolean;
  5308. /**
  5309. * Sets the regular expression when using the require function in a not statically analyse-able way.
  5310. */
  5311. unknownContextRegExp?: boolean | RegExp;
  5312. /**
  5313. * Sets the request when using the require function in a not statically analyse-able way.
  5314. */
  5315. unknownContextRequest?: string;
  5316. /**
  5317. * Enable/disable parsing of new URL() syntax.
  5318. */
  5319. url?: boolean | "relative";
  5320. /**
  5321. * Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
  5322. */
  5323. worker?: boolean | string[];
  5324. /**
  5325. * Enable warnings for partial dynamic dependencies.
  5326. */
  5327. wrappedContextCritical?: boolean;
  5328. /**
  5329. * Enable recursive directory lookup for partial dynamic dependencies.
  5330. */
  5331. wrappedContextRecursive?: boolean;
  5332. /**
  5333. * Set the inner regular expression for partial dynamic dependencies.
  5334. */
  5335. wrappedContextRegExp?: RegExp;
  5336. }
  5337. declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
  5338. constructor(runtimeRequirements?: any);
  5339. static getCompilationHooks(
  5340. compilation: Compilation
  5341. ): JsonpCompilationPluginHooks;
  5342. /**
  5343. * Runtime modules without any dependencies to other runtime modules
  5344. */
  5345. static STAGE_NORMAL: number;
  5346. /**
  5347. * Runtime modules with simple dependencies on other runtime modules
  5348. */
  5349. static STAGE_BASIC: number;
  5350. /**
  5351. * Runtime modules which attach to handlers of other runtime modules
  5352. */
  5353. static STAGE_ATTACH: number;
  5354. /**
  5355. * Runtime modules which trigger actions on bootstrap
  5356. */
  5357. static STAGE_TRIGGER: number;
  5358. }
  5359. declare interface JsonpCompilationPluginHooks {
  5360. linkPreload: SyncWaterfallHook<[string, Chunk]>;
  5361. linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
  5362. }
  5363. declare class JsonpTemplatePlugin {
  5364. constructor();
  5365. /**
  5366. * Apply the plugin
  5367. */
  5368. apply(compiler: Compiler): void;
  5369. static getCompilationHooks(
  5370. compilation: Compilation
  5371. ): JsonpCompilationPluginHooks;
  5372. }
  5373. declare interface KnownAssetInfo {
  5374. /**
  5375. * true, if the asset can be long term cached forever (contains a hash)
  5376. */
  5377. immutable?: boolean;
  5378. /**
  5379. * whether the asset is minimized
  5380. */
  5381. minimized?: boolean;
  5382. /**
  5383. * the value(s) of the full hash used for this asset
  5384. */
  5385. fullhash?: string | string[];
  5386. /**
  5387. * the value(s) of the chunk hash used for this asset
  5388. */
  5389. chunkhash?: string | string[];
  5390. /**
  5391. * the value(s) of the module hash used for this asset
  5392. */
  5393. modulehash?: string | string[];
  5394. /**
  5395. * the value(s) of the content hash used for this asset
  5396. */
  5397. contenthash?: string | string[];
  5398. /**
  5399. * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
  5400. */
  5401. sourceFilename?: string;
  5402. /**
  5403. * size in bytes, only set after asset has been emitted
  5404. */
  5405. size?: number;
  5406. /**
  5407. * true, when asset is only used for development and doesn't count towards user-facing assets
  5408. */
  5409. development?: boolean;
  5410. /**
  5411. * true, when asset ships data for updating an existing application (HMR)
  5412. */
  5413. hotModuleReplacement?: boolean;
  5414. /**
  5415. * true, when asset is javascript and an ESM
  5416. */
  5417. javascriptModule?: boolean;
  5418. /**
  5419. * object of pointers to other assets, keyed by type of relation (only points from parent to child)
  5420. */
  5421. related?: Record<string, string | string[]>;
  5422. }
  5423. declare interface KnownBuildMeta {
  5424. moduleArgument?: string;
  5425. exportsArgument?: string;
  5426. strict?: boolean;
  5427. moduleConcatenationBailout?: string;
  5428. exportsType?: "namespace" | "dynamic" | "default" | "flagged";
  5429. defaultObject?: false | "redirect" | "redirect-warn";
  5430. strictHarmonyModule?: boolean;
  5431. async?: boolean;
  5432. sideEffectFree?: boolean;
  5433. }
  5434. declare interface KnownCreateStatsOptionsContext {
  5435. forToString?: boolean;
  5436. }
  5437. declare interface KnownNormalizedStatsOptions {
  5438. context: string;
  5439. requestShortener: RequestShortener;
  5440. chunksSort: string;
  5441. modulesSort: string;
  5442. chunkModulesSort: string;
  5443. nestedModulesSort: string;
  5444. assetsSort: string;
  5445. ids: boolean;
  5446. cachedAssets: boolean;
  5447. groupAssetsByEmitStatus: boolean;
  5448. groupAssetsByPath: boolean;
  5449. groupAssetsByExtension: boolean;
  5450. assetsSpace: number;
  5451. excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
  5452. excludeModules: ((
  5453. name: string,
  5454. module: StatsModule,
  5455. type: "module" | "chunk" | "root-of-chunk" | "nested"
  5456. ) => boolean)[];
  5457. warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
  5458. cachedModules: boolean;
  5459. orphanModules: boolean;
  5460. dependentModules: boolean;
  5461. runtimeModules: boolean;
  5462. groupModulesByCacheStatus: boolean;
  5463. groupModulesByLayer: boolean;
  5464. groupModulesByAttributes: boolean;
  5465. groupModulesByPath: boolean;
  5466. groupModulesByExtension: boolean;
  5467. groupModulesByType: boolean;
  5468. entrypoints: boolean | "auto";
  5469. chunkGroups: boolean;
  5470. chunkGroupAuxiliary: boolean;
  5471. chunkGroupChildren: boolean;
  5472. chunkGroupMaxAssets: number;
  5473. modulesSpace: number;
  5474. chunkModulesSpace: number;
  5475. nestedModulesSpace: number;
  5476. logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
  5477. loggingDebug: ((value: string) => boolean)[];
  5478. loggingTrace: boolean;
  5479. }
  5480. declare interface KnownStatsAsset {
  5481. type: string;
  5482. name: string;
  5483. info: AssetInfo;
  5484. size: number;
  5485. emitted: boolean;
  5486. comparedForEmit: boolean;
  5487. cached: boolean;
  5488. related?: StatsAsset[];
  5489. chunkNames?: (string | number)[];
  5490. chunkIdHints?: (string | number)[];
  5491. chunks?: (string | number)[];
  5492. auxiliaryChunkNames?: (string | number)[];
  5493. auxiliaryChunks?: (string | number)[];
  5494. auxiliaryChunkIdHints?: (string | number)[];
  5495. filteredRelated?: number;
  5496. isOverSizeLimit?: boolean;
  5497. }
  5498. declare interface KnownStatsChunk {
  5499. rendered: boolean;
  5500. initial: boolean;
  5501. entry: boolean;
  5502. recorded: boolean;
  5503. reason?: string;
  5504. size: number;
  5505. sizes?: Record<string, number>;
  5506. names?: string[];
  5507. idHints?: string[];
  5508. runtime?: string[];
  5509. files?: string[];
  5510. auxiliaryFiles?: string[];
  5511. hash: string;
  5512. childrenByOrder?: Record<string, (string | number)[]>;
  5513. id?: string | number;
  5514. siblings?: (string | number)[];
  5515. parents?: (string | number)[];
  5516. children?: (string | number)[];
  5517. modules?: StatsModule[];
  5518. filteredModules?: number;
  5519. origins?: StatsChunkOrigin[];
  5520. }
  5521. declare interface KnownStatsChunkGroup {
  5522. name?: string;
  5523. chunks?: (string | number)[];
  5524. assets?: { name: string; size?: number }[];
  5525. filteredAssets?: number;
  5526. assetsSize?: number;
  5527. auxiliaryAssets?: { name: string; size?: number }[];
  5528. filteredAuxiliaryAssets?: number;
  5529. auxiliaryAssetsSize?: number;
  5530. children?: { [index: string]: StatsChunkGroup[] };
  5531. childAssets?: { [index: string]: string[] };
  5532. isOverSizeLimit?: boolean;
  5533. }
  5534. declare interface KnownStatsChunkOrigin {
  5535. module?: string;
  5536. moduleIdentifier?: string;
  5537. moduleName?: string;
  5538. loc?: string;
  5539. request?: string;
  5540. moduleId?: string | number;
  5541. }
  5542. declare interface KnownStatsCompilation {
  5543. env?: any;
  5544. name?: string;
  5545. hash?: string;
  5546. version?: string;
  5547. time?: number;
  5548. builtAt?: number;
  5549. needAdditionalPass?: boolean;
  5550. publicPath?: string;
  5551. outputPath?: string;
  5552. assetsByChunkName?: Record<string, string[]>;
  5553. assets?: StatsAsset[];
  5554. filteredAssets?: number;
  5555. chunks?: StatsChunk[];
  5556. modules?: StatsModule[];
  5557. filteredModules?: number;
  5558. entrypoints?: Record<string, StatsChunkGroup>;
  5559. namedChunkGroups?: Record<string, StatsChunkGroup>;
  5560. errors?: StatsError[];
  5561. errorsCount?: number;
  5562. warnings?: StatsError[];
  5563. warningsCount?: number;
  5564. children?: StatsCompilation[];
  5565. logging?: Record<string, StatsLogging>;
  5566. }
  5567. declare interface KnownStatsError {
  5568. message: string;
  5569. chunkName?: string;
  5570. chunkEntry?: boolean;
  5571. chunkInitial?: boolean;
  5572. file?: string;
  5573. moduleIdentifier?: string;
  5574. moduleName?: string;
  5575. loc?: string;
  5576. chunkId?: string | number;
  5577. moduleId?: string | number;
  5578. moduleTrace?: StatsModuleTraceItem[];
  5579. details?: any;
  5580. stack?: string;
  5581. }
  5582. declare interface KnownStatsFactoryContext {
  5583. type: string;
  5584. makePathsRelative?: (arg0: string) => string;
  5585. compilation?: Compilation;
  5586. rootModules?: Set<Module>;
  5587. compilationFileToChunks?: Map<string, Chunk[]>;
  5588. compilationAuxiliaryFileToChunks?: Map<string, Chunk[]>;
  5589. runtime?: RuntimeSpec;
  5590. cachedGetErrors?: (arg0: Compilation) => WebpackError[];
  5591. cachedGetWarnings?: (arg0: Compilation) => WebpackError[];
  5592. }
  5593. declare interface KnownStatsLogging {
  5594. entries: StatsLoggingEntry[];
  5595. filteredEntries: number;
  5596. debug: boolean;
  5597. }
  5598. declare interface KnownStatsLoggingEntry {
  5599. type: string;
  5600. message: string;
  5601. trace?: string[];
  5602. children?: StatsLoggingEntry[];
  5603. args?: any[];
  5604. time?: number;
  5605. }
  5606. declare interface KnownStatsModule {
  5607. type?: string;
  5608. moduleType?: string;
  5609. layer?: string;
  5610. identifier?: string;
  5611. name?: string;
  5612. nameForCondition?: string;
  5613. index?: number;
  5614. preOrderIndex?: number;
  5615. index2?: number;
  5616. postOrderIndex?: number;
  5617. size?: number;
  5618. sizes?: { [index: string]: number };
  5619. cacheable?: boolean;
  5620. built?: boolean;
  5621. codeGenerated?: boolean;
  5622. buildTimeExecuted?: boolean;
  5623. cached?: boolean;
  5624. optional?: boolean;
  5625. orphan?: boolean;
  5626. id?: string | number;
  5627. issuerId?: string | number;
  5628. chunks?: (string | number)[];
  5629. assets?: (string | number)[];
  5630. dependent?: boolean;
  5631. issuer?: string;
  5632. issuerName?: string;
  5633. issuerPath?: StatsModuleIssuer[];
  5634. failed?: boolean;
  5635. errors?: number;
  5636. warnings?: number;
  5637. profile?: StatsProfile;
  5638. reasons?: StatsModuleReason[];
  5639. usedExports?: boolean | string[];
  5640. providedExports?: string[];
  5641. optimizationBailout?: string[];
  5642. depth?: number;
  5643. modules?: StatsModule[];
  5644. filteredModules?: number;
  5645. source?: string | Buffer;
  5646. }
  5647. declare interface KnownStatsModuleIssuer {
  5648. identifier?: string;
  5649. name?: string;
  5650. id?: string | number;
  5651. profile?: StatsProfile;
  5652. }
  5653. declare interface KnownStatsModuleReason {
  5654. moduleIdentifier?: string;
  5655. module?: string;
  5656. moduleName?: string;
  5657. resolvedModuleIdentifier?: string;
  5658. resolvedModule?: string;
  5659. type?: string;
  5660. active: boolean;
  5661. explanation?: string;
  5662. userRequest?: string;
  5663. loc?: string;
  5664. moduleId?: string | number;
  5665. resolvedModuleId?: string | number;
  5666. }
  5667. declare interface KnownStatsModuleTraceDependency {
  5668. loc?: string;
  5669. }
  5670. declare interface KnownStatsModuleTraceItem {
  5671. originIdentifier?: string;
  5672. originName?: string;
  5673. moduleIdentifier?: string;
  5674. moduleName?: string;
  5675. dependencies?: StatsModuleTraceDependency[];
  5676. originId?: string | number;
  5677. moduleId?: string | number;
  5678. }
  5679. declare interface KnownStatsPrinterContext {
  5680. type?: string;
  5681. compilation?: StatsCompilation;
  5682. chunkGroup?: StatsChunkGroup;
  5683. asset?: StatsAsset;
  5684. module?: StatsModule;
  5685. chunk?: StatsChunk;
  5686. moduleReason?: StatsModuleReason;
  5687. bold?: (str: string) => string;
  5688. yellow?: (str: string) => string;
  5689. red?: (str: string) => string;
  5690. green?: (str: string) => string;
  5691. magenta?: (str: string) => string;
  5692. cyan?: (str: string) => string;
  5693. formatFilename?: (file: string, oversize?: boolean) => string;
  5694. formatModuleId?: (id: string) => string;
  5695. formatChunkId?: (
  5696. id: string,
  5697. direction?: "parent" | "child" | "sibling"
  5698. ) => string;
  5699. formatSize?: (size: number) => string;
  5700. formatDateTime?: (dateTime: number) => string;
  5701. formatFlag?: (flag: string) => string;
  5702. formatTime?: (time: number, boldQuantity?: boolean) => string;
  5703. chunkGroupKind?: string;
  5704. }
  5705. declare interface KnownStatsProfile {
  5706. total: number;
  5707. resolving: number;
  5708. restoring: number;
  5709. building: number;
  5710. integration: number;
  5711. storing: number;
  5712. additionalResolving: number;
  5713. additionalIntegration: number;
  5714. factory: number;
  5715. dependencies: number;
  5716. }
  5717. /**
  5718. * Options for the default backend.
  5719. */
  5720. declare interface LazyCompilationDefaultBackendOptions {
  5721. /**
  5722. * A custom client.
  5723. */
  5724. client?: string;
  5725. /**
  5726. * Specifies where to listen to from the server.
  5727. */
  5728. listen?: number | ListenOptions | ((server: typeof Server) => void);
  5729. /**
  5730. * Specifies the protocol the client should use to connect to the server.
  5731. */
  5732. protocol?: "http" | "https";
  5733. /**
  5734. * Specifies how to create the server handling the EventSource requests.
  5735. */
  5736. server?:
  5737. | ServerOptionsImport<typeof IncomingMessage>
  5738. | ServerOptionsHttps<typeof IncomingMessage, typeof ServerResponse>
  5739. | (() => typeof Server);
  5740. }
  5741. /**
  5742. * Options for compiling entrypoints and import()s only when they are accessed.
  5743. */
  5744. declare interface LazyCompilationOptions {
  5745. /**
  5746. * Specifies the backend that should be used for handling client keep alive.
  5747. */
  5748. backend?:
  5749. | ((
  5750. compiler: Compiler,
  5751. callback: (err?: Error, api?: BackendApi) => void
  5752. ) => void)
  5753. | ((compiler: Compiler) => Promise<BackendApi>)
  5754. | LazyCompilationDefaultBackendOptions;
  5755. /**
  5756. * Enable/disable lazy compilation for entries.
  5757. */
  5758. entries?: boolean;
  5759. /**
  5760. * Enable/disable lazy compilation for import() modules.
  5761. */
  5762. imports?: boolean;
  5763. /**
  5764. * Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.
  5765. */
  5766. test?: string | RegExp | ((module: Module) => boolean);
  5767. }
  5768. declare class LazySet<T> {
  5769. constructor(iterable?: Iterable<T>);
  5770. get size(): number;
  5771. add(item: T): LazySet<T>;
  5772. addAll(iterable: LazySet<T> | Iterable<T>): LazySet<T>;
  5773. clear(): void;
  5774. delete(value: T): boolean;
  5775. entries(): IterableIterator<[T, T]>;
  5776. forEach(
  5777. callbackFn: (arg0: T, arg1: T, arg2: Set<T>) => void,
  5778. thisArg?: any
  5779. ): void;
  5780. has(item: T): boolean;
  5781. keys(): IterableIterator<T>;
  5782. values(): IterableIterator<T>;
  5783. serialize(__0: { write: any }): void;
  5784. [Symbol.iterator](): IterableIterator<T>;
  5785. static deserialize(__0: { read: any }): LazySet<any>;
  5786. }
  5787. declare interface LibIdentOptions {
  5788. /**
  5789. * absolute context path to which lib ident is relative to
  5790. */
  5791. context: string;
  5792. /**
  5793. * object for caching
  5794. */
  5795. associatedObjectForCache?: Object;
  5796. }
  5797. declare class LibManifestPlugin {
  5798. constructor(options?: any);
  5799. options: any;
  5800. /**
  5801. * Apply the plugin
  5802. */
  5803. apply(compiler: Compiler): void;
  5804. }
  5805. declare interface LibraryContext<T> {
  5806. compilation: Compilation;
  5807. chunkGraph: ChunkGraph;
  5808. options: T;
  5809. }
  5810. /**
  5811. * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
  5812. */
  5813. declare interface LibraryCustomUmdCommentObject {
  5814. /**
  5815. * Set comment for `amd` section in UMD.
  5816. */
  5817. amd?: string;
  5818. /**
  5819. * Set comment for `commonjs` (exports) section in UMD.
  5820. */
  5821. commonjs?: string;
  5822. /**
  5823. * Set comment for `commonjs2` (module.exports) section in UMD.
  5824. */
  5825. commonjs2?: string;
  5826. /**
  5827. * Set comment for `root` (global variable) section in UMD.
  5828. */
  5829. root?: string;
  5830. }
  5831. /**
  5832. * Description object for all UMD variants of the library name.
  5833. */
  5834. declare interface LibraryCustomUmdObject {
  5835. /**
  5836. * Name of the exposed AMD library in the UMD.
  5837. */
  5838. amd?: string;
  5839. /**
  5840. * Name of the exposed commonjs export in the UMD.
  5841. */
  5842. commonjs?: string;
  5843. /**
  5844. * Name of the property exposed globally by a UMD library.
  5845. */
  5846. root?: string | string[];
  5847. }
  5848. type LibraryExport = string | string[];
  5849. type LibraryName = string | string[] | LibraryCustomUmdObject;
  5850. /**
  5851. * Options for library.
  5852. */
  5853. declare interface LibraryOptions {
  5854. /**
  5855. * Add a container for define/require functions in the AMD module.
  5856. */
  5857. amdContainer?: string;
  5858. /**
  5859. * Add a comment in the UMD wrapper.
  5860. */
  5861. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  5862. /**
  5863. * Specify which export should be exposed as library.
  5864. */
  5865. export?: string | string[];
  5866. /**
  5867. * The name of the library (some types allow unnamed libraries too).
  5868. */
  5869. name?: string | string[] | LibraryCustomUmdObject;
  5870. /**
  5871. * 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).
  5872. */
  5873. type: string;
  5874. /**
  5875. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  5876. */
  5877. umdNamedDefine?: boolean;
  5878. }
  5879. declare class LibraryTemplatePlugin {
  5880. constructor(
  5881. name: LibraryName,
  5882. target: string,
  5883. umdNamedDefine: boolean,
  5884. auxiliaryComment: AuxiliaryComment,
  5885. exportProperty: LibraryExport
  5886. );
  5887. library: {
  5888. type: string;
  5889. name: LibraryName;
  5890. umdNamedDefine: boolean;
  5891. auxiliaryComment: AuxiliaryComment;
  5892. export: LibraryExport;
  5893. };
  5894. /**
  5895. * Apply the plugin
  5896. */
  5897. apply(compiler: Compiler): void;
  5898. }
  5899. declare class LimitChunkCountPlugin {
  5900. constructor(options?: LimitChunkCountPluginOptions);
  5901. options?: LimitChunkCountPluginOptions;
  5902. apply(compiler: Compiler): void;
  5903. }
  5904. declare interface LimitChunkCountPluginOptions {
  5905. /**
  5906. * Constant overhead for a chunk.
  5907. */
  5908. chunkOverhead?: number;
  5909. /**
  5910. * Multiplicator for initial chunks.
  5911. */
  5912. entryChunkMultiplicator?: number;
  5913. /**
  5914. * Limit the maximum number of chunks using a value greater greater than or equal to 1.
  5915. */
  5916. maxChunks: number;
  5917. }
  5918. declare interface LoadScriptCompilationHooks {
  5919. createScript: SyncWaterfallHook<[string, Chunk]>;
  5920. }
  5921. declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
  5922. constructor(withCreateScriptUrl?: boolean);
  5923. static getCompilationHooks(
  5924. compilation: Compilation
  5925. ): LoadScriptCompilationHooks;
  5926. /**
  5927. * Runtime modules without any dependencies to other runtime modules
  5928. */
  5929. static STAGE_NORMAL: number;
  5930. /**
  5931. * Runtime modules with simple dependencies on other runtime modules
  5932. */
  5933. static STAGE_BASIC: number;
  5934. /**
  5935. * Runtime modules which attach to handlers of other runtime modules
  5936. */
  5937. static STAGE_ATTACH: number;
  5938. /**
  5939. * Runtime modules which trigger actions on bootstrap
  5940. */
  5941. static STAGE_TRIGGER: number;
  5942. }
  5943. /**
  5944. * Custom values available in the loader context.
  5945. */
  5946. declare interface Loader {
  5947. [index: string]: any;
  5948. }
  5949. type LoaderContext<OptionsType> = NormalModuleLoaderContext<OptionsType> &
  5950. LoaderRunnerLoaderContext<OptionsType> &
  5951. LoaderPluginLoaderContext &
  5952. HotModuleReplacementPluginLoaderContext;
  5953. type LoaderDefinition<
  5954. OptionsType = {},
  5955. ContextAdditions = {}
  5956. > = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  5957. raw?: false;
  5958. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  5959. };
  5960. declare interface LoaderDefinitionFunction<
  5961. OptionsType = {},
  5962. ContextAdditions = {}
  5963. > {
  5964. (
  5965. this: NormalModuleLoaderContext<OptionsType> &
  5966. LoaderRunnerLoaderContext<OptionsType> &
  5967. LoaderPluginLoaderContext &
  5968. HotModuleReplacementPluginLoaderContext &
  5969. ContextAdditions,
  5970. content: string,
  5971. sourceMap?: string | SourceMap,
  5972. additionalData?: AdditionalData
  5973. ): string | void | Buffer | Promise<string | Buffer>;
  5974. }
  5975. declare interface LoaderItem {
  5976. loader: string;
  5977. options: any;
  5978. ident: null | string;
  5979. type: null | string;
  5980. }
  5981. declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
  5982. default?:
  5983. | RawLoaderDefinitionFunction<OptionsType, ContextAdditions>
  5984. | LoaderDefinitionFunction<OptionsType, ContextAdditions>;
  5985. raw?: false;
  5986. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  5987. }
  5988. declare class LoaderOptionsPlugin {
  5989. constructor(options?: LoaderOptionsPluginOptions);
  5990. options: LoaderOptionsPluginOptions;
  5991. /**
  5992. * Apply the plugin
  5993. */
  5994. apply(compiler: Compiler): void;
  5995. }
  5996. declare interface LoaderOptionsPluginOptions {
  5997. [index: string]: any;
  5998. /**
  5999. * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3.
  6000. */
  6001. debug?: boolean;
  6002. /**
  6003. * Where loaders can be switched to minimize mode.
  6004. */
  6005. minimize?: boolean;
  6006. /**
  6007. * A configuration object that can be used to configure older loaders.
  6008. */
  6009. options?: {
  6010. [index: string]: any;
  6011. /**
  6012. * The context that can be used to configure older loaders.
  6013. */
  6014. context?: string;
  6015. };
  6016. }
  6017. /**
  6018. * These properties are added by the LoaderPlugin
  6019. */
  6020. declare interface LoaderPluginLoaderContext {
  6021. /**
  6022. * Resolves the given request to a module, applies all configured loaders and calls
  6023. * back with the generated source, the sourceMap and the module instance (usually an
  6024. * instance of NormalModule). Use this function if you need to know the source code
  6025. * of another module to generate the result.
  6026. */
  6027. loadModule(
  6028. request: string,
  6029. callback: (
  6030. err: null | Error,
  6031. source: string,
  6032. sourceMap: any,
  6033. module: NormalModule
  6034. ) => void
  6035. ): void;
  6036. importModule(
  6037. request: string,
  6038. options: ImportModuleOptions,
  6039. callback: (err?: null | Error, exports?: any) => any
  6040. ): void;
  6041. importModule(request: string, options?: ImportModuleOptions): Promise<any>;
  6042. }
  6043. /**
  6044. * The properties are added by https://github.com/webpack/loader-runner
  6045. */
  6046. declare interface LoaderRunnerLoaderContext<OptionsType> {
  6047. /**
  6048. * Add a directory as dependency of the loader result.
  6049. */
  6050. addContextDependency(context: string): void;
  6051. /**
  6052. * Adds a file as dependency of the loader result in order to make them watchable.
  6053. * For example, html-loader uses this technique as it finds src and src-set attributes.
  6054. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  6055. */
  6056. addDependency(file: string): void;
  6057. addMissingDependency(context: string): void;
  6058. /**
  6059. * Make this loader async.
  6060. */
  6061. async(): (
  6062. err?: null | Error,
  6063. content?: string | Buffer,
  6064. sourceMap?: string | SourceMap,
  6065. additionalData?: AdditionalData
  6066. ) => void;
  6067. /**
  6068. * Make this loader result cacheable. By default it's cacheable.
  6069. * A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed.
  6070. * This means the loader shouldn't have other dependencies than specified with this.addDependency.
  6071. * Most loaders are deterministic and cacheable.
  6072. */
  6073. cacheable(flag?: boolean): void;
  6074. callback: (
  6075. err?: null | Error,
  6076. content?: string | Buffer,
  6077. sourceMap?: string | SourceMap,
  6078. additionalData?: AdditionalData
  6079. ) => void;
  6080. /**
  6081. * Remove all dependencies of the loader result. Even initial dependencies and these of other loaders.
  6082. */
  6083. clearDependencies(): void;
  6084. /**
  6085. * The directory of the module. Can be used as context for resolving other stuff.
  6086. * eg '/workspaces/ts-loader/examples/vanilla/src'
  6087. */
  6088. context: string;
  6089. readonly currentRequest: string;
  6090. readonly data: any;
  6091. /**
  6092. * alias of addDependency
  6093. * Adds a file as dependency of the loader result in order to make them watchable.
  6094. * For example, html-loader uses this technique as it finds src and src-set attributes.
  6095. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  6096. */
  6097. dependency(file: string): void;
  6098. getContextDependencies(): string[];
  6099. getDependencies(): string[];
  6100. getMissingDependencies(): string[];
  6101. /**
  6102. * The index in the loaders array of the current loader.
  6103. * In the example: in loader1: 0, in loader2: 1
  6104. */
  6105. loaderIndex: number;
  6106. readonly previousRequest: string;
  6107. readonly query: string | OptionsType;
  6108. readonly remainingRequest: string;
  6109. readonly request: string;
  6110. /**
  6111. * An array of all the loaders. It is writeable in the pitch phase.
  6112. * loaders = [{request: string, path: string, query: string, module: function}]
  6113. * In the example:
  6114. * [
  6115. * { request: "/abc/loader1.js?xyz",
  6116. * path: "/abc/loader1.js",
  6117. * query: "?xyz",
  6118. * module: [Function]
  6119. * },
  6120. * { request: "/abc/node_modules/loader2/index.js",
  6121. * path: "/abc/node_modules/loader2/index.js",
  6122. * query: "",
  6123. * module: [Function]
  6124. * }
  6125. * ]
  6126. */
  6127. loaders: {
  6128. request: string;
  6129. path: string;
  6130. query: string;
  6131. fragment: string;
  6132. options?: string | object;
  6133. ident: string;
  6134. normal?: Function;
  6135. pitch?: Function;
  6136. raw?: boolean;
  6137. data?: object;
  6138. pitchExecuted: boolean;
  6139. normalExecuted: boolean;
  6140. type?: "module" | "commonjs";
  6141. }[];
  6142. /**
  6143. * The resource path.
  6144. * In the example: "/abc/resource.js"
  6145. */
  6146. resourcePath: string;
  6147. /**
  6148. * The resource query string.
  6149. * Example: "?query"
  6150. */
  6151. resourceQuery: string;
  6152. /**
  6153. * The resource fragment.
  6154. * Example: "#frag"
  6155. */
  6156. resourceFragment: string;
  6157. /**
  6158. * The resource inclusive query and fragment.
  6159. * Example: "/abc/resource.js?query#frag"
  6160. */
  6161. resource: string;
  6162. /**
  6163. * Target of compilation.
  6164. * Example: "web"
  6165. */
  6166. target: string;
  6167. }
  6168. declare class LoaderTargetPlugin {
  6169. constructor(target: string);
  6170. target: string;
  6171. /**
  6172. * Apply the plugin
  6173. */
  6174. apply(compiler: Compiler): void;
  6175. }
  6176. declare interface LogEntry {
  6177. type: string;
  6178. args: any[];
  6179. time: number;
  6180. trace?: string[];
  6181. }
  6182. declare const MEASURE_END_OPERATION: unique symbol;
  6183. declare const MEASURE_START_OPERATION: unique symbol;
  6184. declare interface MainRenderContext {
  6185. /**
  6186. * the chunk
  6187. */
  6188. chunk: Chunk;
  6189. /**
  6190. * the dependency templates
  6191. */
  6192. dependencyTemplates: DependencyTemplates;
  6193. /**
  6194. * the runtime template
  6195. */
  6196. runtimeTemplate: RuntimeTemplate;
  6197. /**
  6198. * the module graph
  6199. */
  6200. moduleGraph: ModuleGraph;
  6201. /**
  6202. * the chunk graph
  6203. */
  6204. chunkGraph: ChunkGraph;
  6205. /**
  6206. * results of code generation
  6207. */
  6208. codeGenerationResults: CodeGenerationResults;
  6209. /**
  6210. * hash to be used for render call
  6211. */
  6212. hash: string;
  6213. /**
  6214. * rendering in strict context
  6215. */
  6216. strictMode: boolean;
  6217. }
  6218. declare abstract class MainTemplate {
  6219. hooks: Readonly<{
  6220. renderManifest: { tap: (options?: any, fn?: any) => void };
  6221. modules: { tap: () => never };
  6222. moduleObj: { tap: () => never };
  6223. require: { tap: (options?: any, fn?: any) => void };
  6224. beforeStartup: { tap: () => never };
  6225. startup: { tap: () => never };
  6226. afterStartup: { tap: () => never };
  6227. render: { tap: (options?: any, fn?: any) => void };
  6228. renderWithEntry: { tap: (options?: any, fn?: any) => void };
  6229. assetPath: {
  6230. tap: (options?: any, fn?: any) => void;
  6231. call: (filename?: any, options?: any) => string;
  6232. };
  6233. hash: { tap: (options?: any, fn?: any) => void };
  6234. hashForChunk: { tap: (options?: any, fn?: any) => void };
  6235. globalHashPaths: { tap: () => void };
  6236. globalHash: { tap: () => void };
  6237. hotBootstrap: { tap: () => never };
  6238. bootstrap: SyncWaterfallHook<
  6239. [string, Chunk, string, ModuleTemplate, DependencyTemplates]
  6240. >;
  6241. localVars: SyncWaterfallHook<[string, Chunk, string]>;
  6242. requireExtensions: SyncWaterfallHook<[string, Chunk, string]>;
  6243. requireEnsure: SyncWaterfallHook<[string, Chunk, string, string]>;
  6244. get jsonpScript(): SyncWaterfallHook<[string, Chunk]>;
  6245. get linkPrefetch(): SyncWaterfallHook<[string, Chunk]>;
  6246. get linkPreload(): SyncWaterfallHook<[string, Chunk]>;
  6247. }>;
  6248. renderCurrentHashCode: (hash: string, length?: number) => string;
  6249. getPublicPath: (options: object) => string;
  6250. getAssetPath: (path?: any, options?: any) => string;
  6251. getAssetPathWithInfo: (
  6252. path?: any,
  6253. options?: any
  6254. ) => { path: string; info: AssetInfo };
  6255. get requireFn(): "__webpack_require__";
  6256. get outputOptions(): Output;
  6257. }
  6258. declare interface MapOptions {
  6259. columns?: boolean;
  6260. module?: boolean;
  6261. }
  6262. /**
  6263. * Options object for in-memory caching.
  6264. */
  6265. declare interface MemoryCacheOptions {
  6266. /**
  6267. * Additionally cache computation of modules that are unchanged and reference only unchanged modules.
  6268. */
  6269. cacheUnaffected?: boolean;
  6270. /**
  6271. * 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).
  6272. */
  6273. maxGenerations?: number;
  6274. /**
  6275. * In memory caching.
  6276. */
  6277. type: "memory";
  6278. }
  6279. declare class MemoryCachePlugin {
  6280. constructor();
  6281. /**
  6282. * Apply the plugin
  6283. */
  6284. apply(compiler: Compiler): void;
  6285. }
  6286. declare class MinChunkSizePlugin {
  6287. constructor(options: MinChunkSizePluginOptions);
  6288. options: MinChunkSizePluginOptions;
  6289. /**
  6290. * Apply the plugin
  6291. */
  6292. apply(compiler: Compiler): void;
  6293. }
  6294. declare interface MinChunkSizePluginOptions {
  6295. /**
  6296. * Constant overhead for a chunk.
  6297. */
  6298. chunkOverhead?: number;
  6299. /**
  6300. * Multiplicator for initial chunks.
  6301. */
  6302. entryChunkMultiplicator?: number;
  6303. /**
  6304. * Minimum number of characters.
  6305. */
  6306. minChunkSize: number;
  6307. }
  6308. declare class Module extends DependenciesBlock {
  6309. constructor(type: string, context?: string, layer?: string);
  6310. type: string;
  6311. context: null | string;
  6312. layer: null | string;
  6313. needId: boolean;
  6314. debugId: number;
  6315. resolveOptions: ResolveOptionsWebpackOptions;
  6316. factoryMeta?: object;
  6317. useSourceMap: boolean;
  6318. useSimpleSourceMap: boolean;
  6319. buildMeta: BuildMeta;
  6320. buildInfo: Record<string, any>;
  6321. presentationalDependencies?: Dependency[];
  6322. codeGenerationDependencies?: Dependency[];
  6323. id: string | number;
  6324. get hash(): string;
  6325. get renderedHash(): string;
  6326. profile: null | ModuleProfile;
  6327. index: number;
  6328. index2: number;
  6329. depth: number;
  6330. issuer: null | Module;
  6331. get usedExports(): null | boolean | SortableSet<string>;
  6332. get optimizationBailout(): (
  6333. | string
  6334. | ((requestShortener: RequestShortener) => string)
  6335. )[];
  6336. get optional(): boolean;
  6337. addChunk(chunk?: any): boolean;
  6338. removeChunk(chunk?: any): void;
  6339. isInChunk(chunk?: any): boolean;
  6340. isEntryModule(): boolean;
  6341. getChunks(): Chunk[];
  6342. getNumberOfChunks(): number;
  6343. get chunksIterable(): Iterable<Chunk>;
  6344. isProvided(exportName: string): null | boolean;
  6345. get exportsArgument(): string;
  6346. get moduleArgument(): string;
  6347. getExportsType(
  6348. moduleGraph: ModuleGraph,
  6349. strict: boolean
  6350. ): "namespace" | "default-only" | "default-with-named" | "dynamic";
  6351. addPresentationalDependency(presentationalDependency: Dependency): void;
  6352. addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
  6353. addWarning(warning: WebpackError): void;
  6354. getWarnings(): undefined | Iterable<WebpackError>;
  6355. getNumberOfWarnings(): number;
  6356. addError(error: WebpackError): void;
  6357. getErrors(): undefined | Iterable<WebpackError>;
  6358. getNumberOfErrors(): number;
  6359. /**
  6360. * removes all warnings and errors
  6361. */
  6362. clearWarningsAndErrors(): void;
  6363. isOptional(moduleGraph: ModuleGraph): boolean;
  6364. isAccessibleInChunk(
  6365. chunkGraph: ChunkGraph,
  6366. chunk: Chunk,
  6367. ignoreChunk?: Chunk
  6368. ): boolean;
  6369. isAccessibleInChunkGroup(
  6370. chunkGraph: ChunkGraph,
  6371. chunkGroup: ChunkGroup,
  6372. ignoreChunk?: Chunk
  6373. ): boolean;
  6374. hasReasonForChunk(
  6375. chunk: Chunk,
  6376. moduleGraph: ModuleGraph,
  6377. chunkGraph: ChunkGraph
  6378. ): boolean;
  6379. hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
  6380. needBuild(
  6381. context: NeedBuildContext,
  6382. callback: (arg0?: null | WebpackError, arg1?: boolean) => void
  6383. ): void;
  6384. needRebuild(
  6385. fileTimestamps: Map<string, null | number>,
  6386. contextTimestamps: Map<string, null | number>
  6387. ): boolean;
  6388. invalidateBuild(): void;
  6389. identifier(): string;
  6390. readableIdentifier(requestShortener: RequestShortener): string;
  6391. build(
  6392. options: WebpackOptionsNormalized,
  6393. compilation: Compilation,
  6394. resolver: ResolverWithOptions,
  6395. fs: InputFileSystem,
  6396. callback: (arg0?: WebpackError) => void
  6397. ): void;
  6398. getSourceTypes(): Set<string>;
  6399. source(
  6400. dependencyTemplates: DependencyTemplates,
  6401. runtimeTemplate: RuntimeTemplate,
  6402. type?: string
  6403. ): Source;
  6404. size(type?: string): number;
  6405. libIdent(options: LibIdentOptions): null | string;
  6406. nameForCondition(): null | string;
  6407. getConcatenationBailoutReason(
  6408. context: ConcatenationBailoutReasonContext
  6409. ): undefined | string;
  6410. getSideEffectsConnectionState(moduleGraph: ModuleGraph): ConnectionState;
  6411. codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
  6412. chunkCondition(chunk: Chunk, compilation: Compilation): boolean;
  6413. hasChunkCondition(): boolean;
  6414. /**
  6415. * Assuming this module is in the cache. Update the (cached) module with
  6416. * the fresh module from the factory. Usually updates internal references
  6417. * and properties.
  6418. */
  6419. updateCacheModule(module: Module): void;
  6420. /**
  6421. * Module should be unsafe cached. Get data that's needed for that.
  6422. * This data will be passed to restoreFromUnsafeCache later.
  6423. */
  6424. getUnsafeCacheData(): object;
  6425. /**
  6426. * Assuming this module is in the cache. Remove internal references to allow freeing some memory.
  6427. */
  6428. cleanupForCache(): void;
  6429. originalSource(): null | Source;
  6430. addCacheDependencies(
  6431. fileDependencies: LazySet<string>,
  6432. contextDependencies: LazySet<string>,
  6433. missingDependencies: LazySet<string>,
  6434. buildDependencies: LazySet<string>
  6435. ): void;
  6436. get hasEqualsChunks(): any;
  6437. get isUsed(): any;
  6438. get errors(): any;
  6439. get warnings(): any;
  6440. used: any;
  6441. }
  6442. declare class ModuleConcatenationPlugin {
  6443. constructor(options?: any);
  6444. options: any;
  6445. /**
  6446. * Apply the plugin
  6447. */
  6448. apply(compiler: Compiler): void;
  6449. }
  6450. declare class ModuleDependency extends Dependency {
  6451. constructor(request: string);
  6452. request: string;
  6453. userRequest: string;
  6454. range: any;
  6455. assertions?: Record<string, any>;
  6456. static Template: typeof DependencyTemplate;
  6457. static NO_EXPORTS_REFERENCED: string[][];
  6458. static EXPORTS_OBJECT_REFERENCED: string[][];
  6459. static TRANSITIVE: typeof TRANSITIVE;
  6460. }
  6461. declare abstract class ModuleFactory {
  6462. create(
  6463. data: ModuleFactoryCreateData,
  6464. callback: (arg0?: Error, arg1?: ModuleFactoryResult) => void
  6465. ): void;
  6466. }
  6467. declare interface ModuleFactoryCreateData {
  6468. contextInfo: ModuleFactoryCreateDataContextInfo;
  6469. resolveOptions?: ResolveOptionsWebpackOptions;
  6470. context: string;
  6471. dependencies: Dependency[];
  6472. }
  6473. declare interface ModuleFactoryCreateDataContextInfo {
  6474. issuer: string;
  6475. issuerLayer?: null | string;
  6476. compiler: string;
  6477. }
  6478. declare interface ModuleFactoryResult {
  6479. /**
  6480. * the created module or unset if no module was created
  6481. */
  6482. module?: Module;
  6483. fileDependencies?: Set<string>;
  6484. contextDependencies?: Set<string>;
  6485. missingDependencies?: Set<string>;
  6486. /**
  6487. * allow to use the unsafe cache
  6488. */
  6489. cacheable?: boolean;
  6490. }
  6491. declare class ModuleFederationPlugin {
  6492. constructor(options: ModuleFederationPluginOptions);
  6493. /**
  6494. * Apply the plugin
  6495. */
  6496. apply(compiler: Compiler): void;
  6497. }
  6498. declare interface ModuleFederationPluginOptions {
  6499. /**
  6500. * 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.
  6501. */
  6502. exposes?: (string | ExposesObject)[] | ExposesObject;
  6503. /**
  6504. * The filename of the container as relative path inside the `output.path` directory.
  6505. */
  6506. filename?: string;
  6507. /**
  6508. * Options for library.
  6509. */
  6510. library?: LibraryOptions;
  6511. /**
  6512. * The name of the container.
  6513. */
  6514. name?: string;
  6515. /**
  6516. * The external type of the remote containers.
  6517. */
  6518. remoteType?:
  6519. | "import"
  6520. | "var"
  6521. | "module"
  6522. | "assign"
  6523. | "this"
  6524. | "window"
  6525. | "self"
  6526. | "global"
  6527. | "commonjs"
  6528. | "commonjs2"
  6529. | "commonjs-module"
  6530. | "commonjs-static"
  6531. | "amd"
  6532. | "amd-require"
  6533. | "umd"
  6534. | "umd2"
  6535. | "jsonp"
  6536. | "system"
  6537. | "promise"
  6538. | "script"
  6539. | "node-commonjs";
  6540. /**
  6541. * 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.
  6542. */
  6543. remotes?: (string | RemotesObject)[] | RemotesObject;
  6544. /**
  6545. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  6546. */
  6547. runtime?: string | false;
  6548. /**
  6549. * Share scope name used for all shared modules (defaults to 'default').
  6550. */
  6551. shareScope?: string;
  6552. /**
  6553. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  6554. */
  6555. shared?: (string | SharedObject)[] | SharedObject;
  6556. }
  6557. type ModuleFilterItemTypes =
  6558. | string
  6559. | RegExp
  6560. | ((
  6561. name: string,
  6562. module: StatsModule,
  6563. type: "module" | "chunk" | "root-of-chunk" | "nested"
  6564. ) => boolean);
  6565. declare class ModuleGraph {
  6566. constructor();
  6567. setParents(
  6568. dependency: Dependency,
  6569. block: DependenciesBlock,
  6570. module: Module,
  6571. indexInBlock?: number
  6572. ): void;
  6573. getParentModule(dependency: Dependency): Module;
  6574. getParentBlock(dependency: Dependency): DependenciesBlock;
  6575. getParentBlockIndex(dependency: Dependency): number;
  6576. setResolvedModule(
  6577. originModule: Module,
  6578. dependency: Dependency,
  6579. module: Module
  6580. ): void;
  6581. updateModule(dependency: Dependency, module: Module): void;
  6582. removeConnection(dependency: Dependency): void;
  6583. addExplanation(dependency: Dependency, explanation: string): void;
  6584. cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
  6585. removeModuleAttributes(module: Module): void;
  6586. removeAllModuleAttributes(): void;
  6587. moveModuleConnections(
  6588. oldModule: Module,
  6589. newModule: Module,
  6590. filterConnection: (arg0: ModuleGraphConnection) => boolean
  6591. ): void;
  6592. copyOutgoingModuleConnections(
  6593. oldModule: Module,
  6594. newModule: Module,
  6595. filterConnection: (arg0: ModuleGraphConnection) => boolean
  6596. ): void;
  6597. addExtraReason(module: Module, explanation: string): void;
  6598. getResolvedModule(dependency: Dependency): Module;
  6599. getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
  6600. getModule(dependency: Dependency): Module;
  6601. getOrigin(dependency: Dependency): Module;
  6602. getResolvedOrigin(dependency: Dependency): Module;
  6603. getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
  6604. getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
  6605. getIncomingConnectionsByOriginModule(
  6606. module: Module
  6607. ): Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
  6608. getOutgoingConnectionsByModule(
  6609. module: Module
  6610. ): undefined | Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
  6611. getProfile(module: Module): null | ModuleProfile;
  6612. setProfile(module: Module, profile: null | ModuleProfile): void;
  6613. getIssuer(module: Module): null | Module;
  6614. setIssuer(module: Module, issuer: null | Module): void;
  6615. setIssuerIfUnset(module: Module, issuer: null | Module): void;
  6616. getOptimizationBailout(
  6617. module: Module
  6618. ): (string | ((requestShortener: RequestShortener) => string))[];
  6619. getProvidedExports(module: Module): null | true | string[];
  6620. isExportProvided(
  6621. module: Module,
  6622. exportName: string | string[]
  6623. ): null | boolean;
  6624. getExportsInfo(module: Module): ExportsInfo;
  6625. getExportInfo(module: Module, exportName: string): ExportInfo;
  6626. getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
  6627. getUsedExports(
  6628. module: Module,
  6629. runtime: RuntimeSpec
  6630. ): null | boolean | SortableSet<string>;
  6631. getPreOrderIndex(module: Module): number;
  6632. getPostOrderIndex(module: Module): number;
  6633. setPreOrderIndex(module: Module, index: number): void;
  6634. setPreOrderIndexIfUnset(module: Module, index: number): boolean;
  6635. setPostOrderIndex(module: Module, index: number): void;
  6636. setPostOrderIndexIfUnset(module: Module, index: number): boolean;
  6637. getDepth(module: Module): number;
  6638. setDepth(module: Module, depth: number): void;
  6639. setDepthIfLower(module: Module, depth: number): boolean;
  6640. isAsync(module: Module): boolean;
  6641. setAsync(module: Module): void;
  6642. getMeta(thing?: any): Object;
  6643. getMetaIfExisting(thing?: any): Object;
  6644. freeze(cacheStage?: string): void;
  6645. unfreeze(): void;
  6646. cached<T extends any[], V>(
  6647. fn: (moduleGraph: ModuleGraph, ...args: T) => V,
  6648. ...args: T
  6649. ): V;
  6650. setModuleMemCaches(
  6651. moduleMemCaches: Map<Module, WeakTupleMap<any, any>>
  6652. ): void;
  6653. dependencyCacheProvide(dependency: Dependency, ...args: any[]): any;
  6654. static getModuleGraphForModule(
  6655. module: Module,
  6656. deprecateMessage: string,
  6657. deprecationCode: string
  6658. ): ModuleGraph;
  6659. static setModuleGraphForModule(
  6660. module: Module,
  6661. moduleGraph: ModuleGraph
  6662. ): void;
  6663. static clearModuleGraphForModule(module: Module): void;
  6664. static ModuleGraphConnection: typeof ModuleGraphConnection;
  6665. }
  6666. declare class ModuleGraphConnection {
  6667. constructor(
  6668. originModule: null | Module,
  6669. dependency: null | Dependency,
  6670. module: Module,
  6671. explanation?: string,
  6672. weak?: boolean,
  6673. condition?:
  6674. | false
  6675. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState)
  6676. );
  6677. originModule: null | Module;
  6678. resolvedOriginModule: null | Module;
  6679. dependency: null | Dependency;
  6680. resolvedModule: Module;
  6681. module: Module;
  6682. weak: boolean;
  6683. conditional: boolean;
  6684. condition: (
  6685. arg0: ModuleGraphConnection,
  6686. arg1: RuntimeSpec
  6687. ) => ConnectionState;
  6688. explanations: Set<string>;
  6689. clone(): ModuleGraphConnection;
  6690. addCondition(
  6691. condition: (
  6692. arg0: ModuleGraphConnection,
  6693. arg1: RuntimeSpec
  6694. ) => ConnectionState
  6695. ): void;
  6696. addExplanation(explanation: string): void;
  6697. get explanation(): string;
  6698. active: void;
  6699. isActive(runtime: RuntimeSpec): boolean;
  6700. isTargetActive(runtime: RuntimeSpec): boolean;
  6701. getActiveState(runtime: RuntimeSpec): ConnectionState;
  6702. setActive(value: boolean): void;
  6703. static addConnectionStates: (
  6704. a: ConnectionState,
  6705. b: ConnectionState
  6706. ) => ConnectionState;
  6707. static TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY;
  6708. static CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION;
  6709. }
  6710. type ModuleInfo = ConcatenatedModuleInfo | ExternalModuleInfo;
  6711. /**
  6712. * Options affecting the normal modules (`NormalModuleFactory`).
  6713. */
  6714. declare interface ModuleOptions {
  6715. /**
  6716. * An array of rules applied by default for modules.
  6717. */
  6718. defaultRules?: (RuleSetRule | "...")[];
  6719. /**
  6720. * Enable warnings for full dynamic dependencies.
  6721. */
  6722. exprContextCritical?: boolean;
  6723. /**
  6724. * Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.
  6725. */
  6726. exprContextRecursive?: boolean;
  6727. /**
  6728. * Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.
  6729. */
  6730. exprContextRegExp?: boolean | RegExp;
  6731. /**
  6732. * Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.
  6733. */
  6734. exprContextRequest?: string;
  6735. /**
  6736. * Specify options for each generator.
  6737. */
  6738. generator?: GeneratorOptionsByModuleType;
  6739. /**
  6740. * Don't parse files matching. It's matched against the full resolved request.
  6741. */
  6742. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  6743. /**
  6744. * Specify options for each parser.
  6745. */
  6746. parser?: ParserOptionsByModuleType;
  6747. /**
  6748. * An array of rules applied for modules.
  6749. */
  6750. rules?: (RuleSetRule | "...")[];
  6751. /**
  6752. * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
  6753. */
  6754. strictExportPresence?: boolean;
  6755. /**
  6756. * Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.
  6757. */
  6758. strictThisContextOnImports?: boolean;
  6759. /**
  6760. * Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.
  6761. */
  6762. unknownContextCritical?: boolean;
  6763. /**
  6764. * 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'.
  6765. */
  6766. unknownContextRecursive?: boolean;
  6767. /**
  6768. * 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'.
  6769. */
  6770. unknownContextRegExp?: boolean | RegExp;
  6771. /**
  6772. * 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'.
  6773. */
  6774. unknownContextRequest?: string;
  6775. /**
  6776. * Cache the resolving of module requests.
  6777. */
  6778. unsafeCache?: boolean | Function;
  6779. /**
  6780. * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
  6781. */
  6782. wrappedContextCritical?: boolean;
  6783. /**
  6784. * Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.
  6785. */
  6786. wrappedContextRecursive?: boolean;
  6787. /**
  6788. * Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.
  6789. */
  6790. wrappedContextRegExp?: RegExp;
  6791. }
  6792. /**
  6793. * Options affecting the normal modules (`NormalModuleFactory`).
  6794. */
  6795. declare interface ModuleOptionsNormalized {
  6796. /**
  6797. * An array of rules applied by default for modules.
  6798. */
  6799. defaultRules: (RuleSetRule | "...")[];
  6800. /**
  6801. * Specify options for each generator.
  6802. */
  6803. generator: GeneratorOptionsByModuleType;
  6804. /**
  6805. * Don't parse files matching. It's matched against the full resolved request.
  6806. */
  6807. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  6808. /**
  6809. * Specify options for each parser.
  6810. */
  6811. parser: ParserOptionsByModuleType;
  6812. /**
  6813. * An array of rules applied for modules.
  6814. */
  6815. rules: (RuleSetRule | "...")[];
  6816. /**
  6817. * Cache the resolving of module requests.
  6818. */
  6819. unsafeCache?: boolean | Function;
  6820. }
  6821. declare interface ModulePathData {
  6822. id: string | number;
  6823. hash: string;
  6824. hashWithLength?: (arg0: number) => string;
  6825. }
  6826. declare abstract class ModuleProfile {
  6827. startTime: number;
  6828. factoryStartTime: number;
  6829. factoryEndTime: number;
  6830. factory: number;
  6831. factoryParallelismFactor: number;
  6832. restoringStartTime: number;
  6833. restoringEndTime: number;
  6834. restoring: number;
  6835. restoringParallelismFactor: number;
  6836. integrationStartTime: number;
  6837. integrationEndTime: number;
  6838. integration: number;
  6839. integrationParallelismFactor: number;
  6840. buildingStartTime: number;
  6841. buildingEndTime: number;
  6842. building: number;
  6843. buildingParallelismFactor: number;
  6844. storingStartTime: number;
  6845. storingEndTime: number;
  6846. storing: number;
  6847. storingParallelismFactor: number;
  6848. additionalFactoryTimes: any;
  6849. additionalFactories: number;
  6850. additionalFactoriesParallelismFactor: number;
  6851. additionalIntegration: number;
  6852. markFactoryStart(): void;
  6853. markFactoryEnd(): void;
  6854. markRestoringStart(): void;
  6855. markRestoringEnd(): void;
  6856. markIntegrationStart(): void;
  6857. markIntegrationEnd(): void;
  6858. markBuildingStart(): void;
  6859. markBuildingEnd(): void;
  6860. markStoringStart(): void;
  6861. markStoringEnd(): void;
  6862. /**
  6863. * Merge this profile into another one
  6864. */
  6865. mergeInto(realProfile: ModuleProfile): void;
  6866. }
  6867. declare interface ModuleReferenceOptions {
  6868. /**
  6869. * the properties/exports of the module
  6870. */
  6871. ids: string[];
  6872. /**
  6873. * true, when this referenced export is called
  6874. */
  6875. call: boolean;
  6876. /**
  6877. * true, when this referenced export is directly imported (not via property access)
  6878. */
  6879. directImport: boolean;
  6880. /**
  6881. * if the position is ASI safe or unknown
  6882. */
  6883. asiSafe?: boolean;
  6884. }
  6885. declare interface ModuleSettings {
  6886. /**
  6887. * Specifies the layer in which the module should be placed in.
  6888. */
  6889. layer?: string;
  6890. /**
  6891. * Module type to use for the module.
  6892. */
  6893. type?: string;
  6894. /**
  6895. * Options for the resolver.
  6896. */
  6897. resolve?: ResolveOptionsWebpackOptions;
  6898. /**
  6899. * Options for parsing.
  6900. */
  6901. parser?: { [index: string]: any };
  6902. /**
  6903. * The options for the module generator.
  6904. */
  6905. generator?: { [index: string]: any };
  6906. /**
  6907. * Flags a module as with or without side effects.
  6908. */
  6909. sideEffects?: boolean;
  6910. }
  6911. declare abstract class ModuleTemplate {
  6912. type: string;
  6913. hooks: Readonly<{
  6914. content: { tap: (options?: any, fn?: any) => void };
  6915. module: { tap: (options?: any, fn?: any) => void };
  6916. render: { tap: (options?: any, fn?: any) => void };
  6917. package: { tap: (options?: any, fn?: any) => void };
  6918. hash: { tap: (options?: any, fn?: any) => void };
  6919. }>;
  6920. get runtimeTemplate(): any;
  6921. }
  6922. declare class MultiCompiler {
  6923. constructor(
  6924. compilers: Compiler[] | Record<string, Compiler>,
  6925. options: MultiCompilerOptions
  6926. );
  6927. hooks: Readonly<{
  6928. done: SyncHook<[MultiStats]>;
  6929. invalid: MultiHook<SyncHook<[null | string, number]>>;
  6930. run: MultiHook<AsyncSeriesHook<[Compiler]>>;
  6931. watchClose: SyncHook<[]>;
  6932. watchRun: MultiHook<AsyncSeriesHook<[Compiler]>>;
  6933. infrastructureLog: MultiHook<SyncBailHook<[string, string, any[]], true>>;
  6934. }>;
  6935. compilers: Compiler[];
  6936. dependencies: WeakMap<Compiler, string[]>;
  6937. running: boolean;
  6938. get options(): WebpackOptionsNormalized[] & MultiCompilerOptions;
  6939. get outputPath(): string;
  6940. inputFileSystem: InputFileSystem;
  6941. outputFileSystem: OutputFileSystem;
  6942. watchFileSystem: WatchFileSystem;
  6943. intermediateFileSystem: IntermediateFileSystem;
  6944. getInfrastructureLogger(name?: any): WebpackLogger;
  6945. setDependencies(compiler: Compiler, dependencies: string[]): void;
  6946. validateDependencies(callback: CallbackFunction<MultiStats>): boolean;
  6947. runWithDependencies(
  6948. compilers: Compiler[],
  6949. fn: (compiler: Compiler, callback: CallbackFunction<MultiStats>) => any,
  6950. callback: CallbackFunction<MultiStats>
  6951. ): void;
  6952. watch(
  6953. watchOptions: WatchOptions | WatchOptions[],
  6954. handler: CallbackFunction<MultiStats>
  6955. ): MultiWatching;
  6956. run(callback: CallbackFunction<MultiStats>): void;
  6957. purgeInputFileSystem(): void;
  6958. close(callback: CallbackFunction<void>): void;
  6959. }
  6960. declare interface MultiCompilerOptions {
  6961. /**
  6962. * how many Compilers are allows to run at the same time in parallel
  6963. */
  6964. parallelism?: number;
  6965. }
  6966. declare abstract class MultiStats {
  6967. stats: Stats[];
  6968. get hash(): string;
  6969. hasErrors(): boolean;
  6970. hasWarnings(): boolean;
  6971. toJson(options?: any): StatsCompilation;
  6972. toString(options?: any): string;
  6973. }
  6974. declare abstract class MultiWatching {
  6975. watchings: Watching[];
  6976. compiler: MultiCompiler;
  6977. invalidate(callback?: any): void;
  6978. suspend(): void;
  6979. resume(): void;
  6980. close(callback: CallbackFunction<void>): void;
  6981. }
  6982. declare class NamedChunkIdsPlugin {
  6983. constructor(options?: any);
  6984. delimiter: any;
  6985. context: any;
  6986. /**
  6987. * Apply the plugin
  6988. */
  6989. apply(compiler: Compiler): void;
  6990. }
  6991. declare class NamedModuleIdsPlugin {
  6992. constructor(options?: any);
  6993. options: any;
  6994. /**
  6995. * Apply the plugin
  6996. */
  6997. apply(compiler: Compiler): void;
  6998. }
  6999. declare class NaturalModuleIdsPlugin {
  7000. constructor();
  7001. /**
  7002. * Apply the plugin
  7003. */
  7004. apply(compiler: Compiler): void;
  7005. }
  7006. declare interface NeedBuildContext {
  7007. compilation: Compilation;
  7008. fileSystemInfo: FileSystemInfo;
  7009. valueCacheVersions: Map<string, string | Set<string>>;
  7010. }
  7011. declare class NoEmitOnErrorsPlugin {
  7012. constructor();
  7013. /**
  7014. * Apply the plugin
  7015. */
  7016. apply(compiler: Compiler): void;
  7017. }
  7018. declare class NodeEnvironmentPlugin {
  7019. constructor(options: {
  7020. /**
  7021. * infrastructure logging options
  7022. */
  7023. infrastructureLogging: InfrastructureLogging;
  7024. });
  7025. options: {
  7026. /**
  7027. * infrastructure logging options
  7028. */
  7029. infrastructureLogging: InfrastructureLogging;
  7030. };
  7031. /**
  7032. * Apply the plugin
  7033. */
  7034. apply(compiler: Compiler): void;
  7035. }
  7036. type NodeEstreeIndex =
  7037. | UnaryExpression
  7038. | ArrayExpression
  7039. | ArrowFunctionExpression
  7040. | AssignmentExpression
  7041. | AwaitExpression
  7042. | BinaryExpression
  7043. | SimpleCallExpression
  7044. | NewExpression
  7045. | ChainExpression
  7046. | ClassExpression
  7047. | ConditionalExpression
  7048. | FunctionExpression
  7049. | Identifier
  7050. | ImportExpression
  7051. | SimpleLiteral
  7052. | RegExpLiteral
  7053. | BigIntLiteral
  7054. | LogicalExpression
  7055. | MemberExpression
  7056. | MetaProperty
  7057. | ObjectExpression
  7058. | SequenceExpression
  7059. | TaggedTemplateExpression
  7060. | TemplateLiteral
  7061. | ThisExpression
  7062. | UpdateExpression
  7063. | YieldExpression
  7064. | FunctionDeclaration
  7065. | VariableDeclaration
  7066. | ClassDeclaration
  7067. | PrivateIdentifier
  7068. | ExpressionStatement
  7069. | BlockStatement
  7070. | StaticBlock
  7071. | EmptyStatement
  7072. | DebuggerStatement
  7073. | WithStatement
  7074. | ReturnStatement
  7075. | LabeledStatement
  7076. | BreakStatement
  7077. | ContinueStatement
  7078. | IfStatement
  7079. | SwitchStatement
  7080. | ThrowStatement
  7081. | TryStatement
  7082. | WhileStatement
  7083. | DoWhileStatement
  7084. | ForStatement
  7085. | ForInStatement
  7086. | ForOfStatement
  7087. | ImportDeclaration
  7088. | ExportNamedDeclaration
  7089. | ExportDefaultDeclaration
  7090. | ExportAllDeclaration
  7091. | MethodDefinition
  7092. | PropertyDefinition
  7093. | VariableDeclarator
  7094. | Program
  7095. | AssignmentProperty
  7096. | Property
  7097. | CatchClause
  7098. | ClassBody
  7099. | ImportSpecifier
  7100. | ImportDefaultSpecifier
  7101. | ImportNamespaceSpecifier
  7102. | ExportSpecifier
  7103. | ObjectPattern
  7104. | ArrayPattern
  7105. | RestElement
  7106. | AssignmentPattern
  7107. | SpreadElement
  7108. | Super
  7109. | SwitchCase
  7110. | TemplateElement;
  7111. /**
  7112. * Options object for node compatibility features.
  7113. */
  7114. declare interface NodeOptions {
  7115. /**
  7116. * Include a polyfill for the '__dirname' variable.
  7117. */
  7118. __dirname?: boolean | "warn-mock" | "mock" | "eval-only";
  7119. /**
  7120. * Include a polyfill for the '__filename' variable.
  7121. */
  7122. __filename?: boolean | "warn-mock" | "mock" | "eval-only";
  7123. /**
  7124. * Include a polyfill for the 'global' variable.
  7125. */
  7126. global?: boolean | "warn";
  7127. }
  7128. declare class NodeSourcePlugin {
  7129. constructor();
  7130. /**
  7131. * Apply the plugin
  7132. */
  7133. apply(compiler: Compiler): void;
  7134. }
  7135. declare class NodeTargetPlugin {
  7136. constructor();
  7137. /**
  7138. * Apply the plugin
  7139. */
  7140. apply(compiler: Compiler): void;
  7141. }
  7142. declare class NodeTemplatePlugin {
  7143. constructor(options?: any);
  7144. /**
  7145. * Apply the plugin
  7146. */
  7147. apply(compiler: Compiler): void;
  7148. }
  7149. type NodeWebpackOptions = false | NodeOptions;
  7150. declare class NormalModule extends Module {
  7151. constructor(__0: NormalModuleCreateData);
  7152. request: string;
  7153. userRequest: string;
  7154. rawRequest: string;
  7155. binary: boolean;
  7156. parser: Parser;
  7157. parserOptions?: Record<string, any>;
  7158. generator: Generator;
  7159. generatorOptions?: Record<string, any>;
  7160. resource: string;
  7161. resourceResolveData?: Record<string, any>;
  7162. matchResource?: string;
  7163. loaders: LoaderItem[];
  7164. error?: null | WebpackError;
  7165. restoreFromUnsafeCache(
  7166. unsafeCacheData?: any,
  7167. normalModuleFactory?: any
  7168. ): void;
  7169. createSourceForAsset(
  7170. context: string,
  7171. name: string,
  7172. content: string,
  7173. sourceMap?: any,
  7174. associatedObjectForCache?: Object
  7175. ): Source;
  7176. getCurrentLoader(loaderContext?: any, index?: any): null | LoaderItem;
  7177. createSource(
  7178. context: string,
  7179. content: string | Buffer,
  7180. sourceMap?: any,
  7181. associatedObjectForCache?: Object
  7182. ): Source;
  7183. markModuleAsErrored(error: WebpackError): void;
  7184. applyNoParseRule(rule?: any, content?: any): any;
  7185. shouldPreventParsing(noParseRule?: any, request?: any): any;
  7186. static getCompilationHooks(
  7187. compilation: Compilation
  7188. ): NormalModuleCompilationHooks;
  7189. static deserialize(context?: any): NormalModule;
  7190. }
  7191. declare interface NormalModuleCompilationHooks {
  7192. loader: SyncHook<[object, NormalModule]>;
  7193. beforeLoaders: SyncHook<[LoaderItem[], NormalModule, object]>;
  7194. beforeParse: SyncHook<[NormalModule]>;
  7195. beforeSnapshot: SyncHook<[NormalModule]>;
  7196. readResourceForScheme: HookMap<
  7197. AsyncSeriesBailHook<[string, NormalModule], string | Buffer>
  7198. >;
  7199. readResource: HookMap<AsyncSeriesBailHook<[object], string | Buffer>>;
  7200. needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
  7201. }
  7202. declare interface NormalModuleCreateData {
  7203. /**
  7204. * an optional layer in which the module is
  7205. */
  7206. layer?: string;
  7207. /**
  7208. * module type
  7209. */
  7210. type: string;
  7211. /**
  7212. * request string
  7213. */
  7214. request: string;
  7215. /**
  7216. * request intended by user (without loaders from config)
  7217. */
  7218. userRequest: string;
  7219. /**
  7220. * request without resolving
  7221. */
  7222. rawRequest: string;
  7223. /**
  7224. * list of loaders
  7225. */
  7226. loaders: LoaderItem[];
  7227. /**
  7228. * path + query of the real resource
  7229. */
  7230. resource: string;
  7231. /**
  7232. * resource resolve data
  7233. */
  7234. resourceResolveData?: Record<string, any>;
  7235. /**
  7236. * context directory for resolving
  7237. */
  7238. context: string;
  7239. /**
  7240. * path + query of the matched resource (virtual)
  7241. */
  7242. matchResource?: string;
  7243. /**
  7244. * the parser used
  7245. */
  7246. parser: Parser;
  7247. /**
  7248. * the options of the parser used
  7249. */
  7250. parserOptions?: Record<string, any>;
  7251. /**
  7252. * the generator used
  7253. */
  7254. generator: Generator;
  7255. /**
  7256. * the options of the generator used
  7257. */
  7258. generatorOptions?: Record<string, any>;
  7259. /**
  7260. * options used for resolving requests from this module
  7261. */
  7262. resolveOptions?: ResolveOptionsWebpackOptions;
  7263. }
  7264. declare abstract class NormalModuleFactory extends ModuleFactory {
  7265. hooks: Readonly<{
  7266. resolve: AsyncSeriesBailHook<[ResolveData], false | void | Module>;
  7267. resolveForScheme: HookMap<
  7268. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  7269. >;
  7270. resolveInScheme: HookMap<
  7271. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  7272. >;
  7273. factorize: AsyncSeriesBailHook<[ResolveData], Module>;
  7274. beforeResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  7275. afterResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  7276. createModule: AsyncSeriesBailHook<
  7277. [
  7278. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  7279. ResolveData
  7280. ],
  7281. void | Module
  7282. >;
  7283. module: SyncWaterfallHook<
  7284. [
  7285. Module,
  7286. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  7287. ResolveData
  7288. ],
  7289. Module
  7290. >;
  7291. createParser: HookMap<SyncBailHook<any, any>>;
  7292. parser: HookMap<SyncHook<any>>;
  7293. createGenerator: HookMap<SyncBailHook<any, any>>;
  7294. generator: HookMap<SyncHook<any>>;
  7295. }>;
  7296. resolverFactory: ResolverFactory;
  7297. ruleSet: RuleSet;
  7298. context: string;
  7299. fs: InputFileSystem;
  7300. parserCache: Map<string, WeakMap<Object, any>>;
  7301. generatorCache: Map<string, WeakMap<Object, Generator>>;
  7302. cleanupForCache(): void;
  7303. resolveResource(
  7304. contextInfo?: any,
  7305. context?: any,
  7306. unresolvedResource?: any,
  7307. resolver?: any,
  7308. resolveContext?: any,
  7309. callback?: any
  7310. ): void;
  7311. resolveRequestArray(
  7312. contextInfo?: any,
  7313. context?: any,
  7314. array?: any,
  7315. resolver?: any,
  7316. resolveContext?: any,
  7317. callback?: any
  7318. ): any;
  7319. getParser(type?: any, parserOptions?: object): any;
  7320. createParser(type: string, parserOptions?: { [index: string]: any }): Parser;
  7321. getGenerator(type?: any, generatorOptions?: object): undefined | Generator;
  7322. createGenerator(type?: any, generatorOptions?: object): any;
  7323. getResolver(type?: any, resolveOptions?: any): ResolverWithOptions;
  7324. }
  7325. /**
  7326. * These properties are added by the NormalModule
  7327. */
  7328. declare interface NormalModuleLoaderContext<OptionsType> {
  7329. version: number;
  7330. getOptions(): OptionsType;
  7331. getOptions(schema: Parameters<typeof validateFunction>[0]): OptionsType;
  7332. emitWarning(warning: Error): void;
  7333. emitError(error: Error): void;
  7334. getLogger(name?: string): WebpackLogger;
  7335. resolve(
  7336. context: string,
  7337. request: string,
  7338. callback: (
  7339. arg0: null | Error,
  7340. arg1?: string | false,
  7341. arg2?: ResolveRequest
  7342. ) => void
  7343. ): any;
  7344. getResolve(options?: ResolveOptionsWithDependencyType): {
  7345. (
  7346. context: string,
  7347. request: string,
  7348. callback: (
  7349. arg0: null | Error,
  7350. arg1?: string | false,
  7351. arg2?: ResolveRequest
  7352. ) => void
  7353. ): void;
  7354. (context: string, request: string): Promise<string>;
  7355. };
  7356. emitFile(
  7357. name: string,
  7358. content: string | Buffer,
  7359. sourceMap?: string,
  7360. assetInfo?: AssetInfo
  7361. ): void;
  7362. addBuildDependency(dep: string): void;
  7363. utils: {
  7364. absolutify: (context: string, request: string) => string;
  7365. contextify: (context: string, request: string) => string;
  7366. createHash: (algorithm?: string) => Hash;
  7367. };
  7368. rootContext: string;
  7369. fs: InputFileSystem;
  7370. sourceMap?: boolean;
  7371. mode: "none" | "development" | "production";
  7372. webpack?: boolean;
  7373. _module?: NormalModule;
  7374. _compilation?: Compilation;
  7375. _compiler?: Compiler;
  7376. }
  7377. declare class NormalModuleReplacementPlugin {
  7378. /**
  7379. * Create an instance of the plugin
  7380. */
  7381. constructor(
  7382. resourceRegExp: RegExp,
  7383. newResource: string | ((arg0: ResolveData) => void)
  7384. );
  7385. resourceRegExp: RegExp;
  7386. newResource: string | ((arg0: ResolveData) => void);
  7387. /**
  7388. * Apply the plugin
  7389. */
  7390. apply(compiler: Compiler): void;
  7391. }
  7392. type NormalizedStatsOptions = KnownNormalizedStatsOptions &
  7393. Omit<
  7394. StatsOptions,
  7395. | "context"
  7396. | "chunkGroups"
  7397. | "requestShortener"
  7398. | "chunksSort"
  7399. | "modulesSort"
  7400. | "chunkModulesSort"
  7401. | "nestedModulesSort"
  7402. | "assetsSort"
  7403. | "ids"
  7404. | "cachedAssets"
  7405. | "groupAssetsByEmitStatus"
  7406. | "groupAssetsByPath"
  7407. | "groupAssetsByExtension"
  7408. | "assetsSpace"
  7409. | "excludeAssets"
  7410. | "excludeModules"
  7411. | "warningsFilter"
  7412. | "cachedModules"
  7413. | "orphanModules"
  7414. | "dependentModules"
  7415. | "runtimeModules"
  7416. | "groupModulesByCacheStatus"
  7417. | "groupModulesByLayer"
  7418. | "groupModulesByAttributes"
  7419. | "groupModulesByPath"
  7420. | "groupModulesByExtension"
  7421. | "groupModulesByType"
  7422. | "entrypoints"
  7423. | "chunkGroupAuxiliary"
  7424. | "chunkGroupChildren"
  7425. | "chunkGroupMaxAssets"
  7426. | "modulesSpace"
  7427. | "chunkModulesSpace"
  7428. | "nestedModulesSpace"
  7429. | "logging"
  7430. | "loggingDebug"
  7431. | "loggingTrace"
  7432. | "_env"
  7433. > &
  7434. Record<string, any>;
  7435. declare class NullDependency extends Dependency {
  7436. constructor();
  7437. static Template: typeof NullDependencyTemplate;
  7438. static NO_EXPORTS_REFERENCED: string[][];
  7439. static EXPORTS_OBJECT_REFERENCED: string[][];
  7440. static TRANSITIVE: typeof TRANSITIVE;
  7441. }
  7442. declare class NullDependencyTemplate extends DependencyTemplate {
  7443. constructor();
  7444. }
  7445. declare interface ObjectDeserializerContext {
  7446. read: () => any;
  7447. }
  7448. declare interface ObjectSerializer {
  7449. serialize: (arg0: any, arg1: ObjectSerializerContext) => void;
  7450. deserialize: (arg0: ObjectDeserializerContext) => any;
  7451. }
  7452. declare interface ObjectSerializerContext {
  7453. write: (arg0?: any) => void;
  7454. }
  7455. declare class OccurrenceChunkIdsPlugin {
  7456. constructor(options?: OccurrenceChunkIdsPluginOptions);
  7457. options: OccurrenceChunkIdsPluginOptions;
  7458. /**
  7459. * Apply the plugin
  7460. */
  7461. apply(compiler: Compiler): void;
  7462. }
  7463. declare interface OccurrenceChunkIdsPluginOptions {
  7464. /**
  7465. * Prioritise initial size over total size.
  7466. */
  7467. prioritiseInitial?: boolean;
  7468. }
  7469. declare class OccurrenceModuleIdsPlugin {
  7470. constructor(options?: OccurrenceModuleIdsPluginOptions);
  7471. options: OccurrenceModuleIdsPluginOptions;
  7472. /**
  7473. * Apply the plugin
  7474. */
  7475. apply(compiler: Compiler): void;
  7476. }
  7477. declare interface OccurrenceModuleIdsPluginOptions {
  7478. /**
  7479. * Prioritise initial size over total size.
  7480. */
  7481. prioritiseInitial?: boolean;
  7482. }
  7483. /**
  7484. * Enables/Disables integrated optimizations.
  7485. */
  7486. declare interface Optimization {
  7487. /**
  7488. * Check for incompatible wasm types when importing/exporting from/to ESM.
  7489. */
  7490. checkWasmTypes?: boolean;
  7491. /**
  7492. * 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).
  7493. */
  7494. chunkIds?:
  7495. | false
  7496. | "natural"
  7497. | "named"
  7498. | "deterministic"
  7499. | "size"
  7500. | "total-size";
  7501. /**
  7502. * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
  7503. */
  7504. concatenateModules?: boolean;
  7505. /**
  7506. * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
  7507. */
  7508. emitOnErrors?: boolean;
  7509. /**
  7510. * Also flag chunks as loaded which contain a subset of the modules.
  7511. */
  7512. flagIncludedChunks?: boolean;
  7513. /**
  7514. * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
  7515. */
  7516. innerGraph?: boolean;
  7517. /**
  7518. * 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).
  7519. */
  7520. mangleExports?: boolean | "deterministic" | "size";
  7521. /**
  7522. * Reduce size of WASM by changing imports to shorter strings.
  7523. */
  7524. mangleWasmImports?: boolean;
  7525. /**
  7526. * Merge chunks which contain the same modules.
  7527. */
  7528. mergeDuplicateChunks?: boolean;
  7529. /**
  7530. * Enable minimizing the output. Uses optimization.minimizer.
  7531. */
  7532. minimize?: boolean;
  7533. /**
  7534. * Minimizer(s) to use for minimizing the output.
  7535. */
  7536. minimizer?: (
  7537. | ((this: Compiler, compiler: Compiler) => void)
  7538. | WebpackPluginInstance
  7539. | "..."
  7540. )[];
  7541. /**
  7542. * 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).
  7543. */
  7544. moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
  7545. /**
  7546. * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
  7547. */
  7548. noEmitOnErrors?: boolean;
  7549. /**
  7550. * Set process.env.NODE_ENV to a specific value.
  7551. */
  7552. nodeEnv?: string | false;
  7553. /**
  7554. * Generate records with relative paths to be able to move the context folder.
  7555. */
  7556. portableRecords?: boolean;
  7557. /**
  7558. * Figure out which exports are provided by modules to generate more efficient code.
  7559. */
  7560. providedExports?: boolean;
  7561. /**
  7562. * Use real [contenthash] based on final content of the assets.
  7563. */
  7564. realContentHash?: boolean;
  7565. /**
  7566. * Removes modules from chunks when these modules are already included in all parents.
  7567. */
  7568. removeAvailableModules?: boolean;
  7569. /**
  7570. * Remove chunks which are empty.
  7571. */
  7572. removeEmptyChunks?: boolean;
  7573. /**
  7574. * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
  7575. */
  7576. runtimeChunk?:
  7577. | boolean
  7578. | "single"
  7579. | "multiple"
  7580. | {
  7581. /**
  7582. * The name or name factory for the runtime chunks.
  7583. */
  7584. name?: string | Function;
  7585. };
  7586. /**
  7587. * 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).
  7588. */
  7589. sideEffects?: boolean | "flag";
  7590. /**
  7591. * Optimize duplication and caching by splitting chunks by shared modules and cache group.
  7592. */
  7593. splitChunks?: false | OptimizationSplitChunksOptions;
  7594. /**
  7595. * 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).
  7596. */
  7597. usedExports?: boolean | "global";
  7598. }
  7599. /**
  7600. * Options object for describing behavior of a cache group selecting modules that should be cached together.
  7601. */
  7602. declare interface OptimizationSplitChunksCacheGroup {
  7603. /**
  7604. * Sets the name delimiter for created chunks.
  7605. */
  7606. automaticNameDelimiter?: string;
  7607. /**
  7608. * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
  7609. */
  7610. chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  7611. /**
  7612. * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
  7613. */
  7614. enforce?: boolean;
  7615. /**
  7616. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  7617. */
  7618. enforceSizeThreshold?: number | { [index: string]: number };
  7619. /**
  7620. * Sets the template for the filename for created chunks.
  7621. */
  7622. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7623. /**
  7624. * Sets the hint for chunk id.
  7625. */
  7626. idHint?: string;
  7627. /**
  7628. * Assign modules to a cache group by module layer.
  7629. */
  7630. layer?: string | Function | RegExp;
  7631. /**
  7632. * Maximum number of requests which are accepted for on-demand loading.
  7633. */
  7634. maxAsyncRequests?: number;
  7635. /**
  7636. * Maximal size hint for the on-demand chunks.
  7637. */
  7638. maxAsyncSize?: number | { [index: string]: number };
  7639. /**
  7640. * Maximum number of initial chunks which are accepted for an entry point.
  7641. */
  7642. maxInitialRequests?: number;
  7643. /**
  7644. * Maximal size hint for the initial chunks.
  7645. */
  7646. maxInitialSize?: number | { [index: string]: number };
  7647. /**
  7648. * Maximal size hint for the created chunks.
  7649. */
  7650. maxSize?: number | { [index: string]: number };
  7651. /**
  7652. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  7653. */
  7654. minChunks?: number;
  7655. /**
  7656. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  7657. */
  7658. minRemainingSize?: number | { [index: string]: number };
  7659. /**
  7660. * Minimal size for the created chunk.
  7661. */
  7662. minSize?: number | { [index: string]: number };
  7663. /**
  7664. * Minimum size reduction due to the created chunk.
  7665. */
  7666. minSizeReduction?: number | { [index: string]: number };
  7667. /**
  7668. * Give chunks for this cache group a name (chunks with equal name are merged).
  7669. */
  7670. name?: string | false | Function;
  7671. /**
  7672. * Priority of this cache group.
  7673. */
  7674. priority?: number;
  7675. /**
  7676. * Try to reuse existing chunk (with name) when it has matching modules.
  7677. */
  7678. reuseExistingChunk?: boolean;
  7679. /**
  7680. * Assign modules to a cache group by module name.
  7681. */
  7682. test?: string | Function | RegExp;
  7683. /**
  7684. * Assign modules to a cache group by module type.
  7685. */
  7686. type?: string | Function | RegExp;
  7687. /**
  7688. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  7689. */
  7690. usedExports?: boolean;
  7691. }
  7692. /**
  7693. * Options object for splitting chunks into smaller chunks.
  7694. */
  7695. declare interface OptimizationSplitChunksOptions {
  7696. /**
  7697. * Sets the name delimiter for created chunks.
  7698. */
  7699. automaticNameDelimiter?: string;
  7700. /**
  7701. * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').
  7702. */
  7703. cacheGroups?: {
  7704. [index: string]:
  7705. | string
  7706. | false
  7707. | Function
  7708. | RegExp
  7709. | OptimizationSplitChunksCacheGroup;
  7710. };
  7711. /**
  7712. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  7713. */
  7714. chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  7715. /**
  7716. * Sets the size types which are used when a number is used for sizes.
  7717. */
  7718. defaultSizeTypes?: string[];
  7719. /**
  7720. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  7721. */
  7722. enforceSizeThreshold?: number | { [index: string]: number };
  7723. /**
  7724. * Options for modules not selected by any other cache group.
  7725. */
  7726. fallbackCacheGroup?: {
  7727. /**
  7728. * Sets the name delimiter for created chunks.
  7729. */
  7730. automaticNameDelimiter?: string;
  7731. /**
  7732. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  7733. */
  7734. chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  7735. /**
  7736. * Maximal size hint for the on-demand chunks.
  7737. */
  7738. maxAsyncSize?: number | { [index: string]: number };
  7739. /**
  7740. * Maximal size hint for the initial chunks.
  7741. */
  7742. maxInitialSize?: number | { [index: string]: number };
  7743. /**
  7744. * Maximal size hint for the created chunks.
  7745. */
  7746. maxSize?: number | { [index: string]: number };
  7747. /**
  7748. * Minimal size for the created chunk.
  7749. */
  7750. minSize?: number | { [index: string]: number };
  7751. /**
  7752. * Minimum size reduction due to the created chunk.
  7753. */
  7754. minSizeReduction?: number | { [index: string]: number };
  7755. };
  7756. /**
  7757. * Sets the template for the filename for created chunks.
  7758. */
  7759. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7760. /**
  7761. * Prevents exposing path info when creating names for parts splitted by maxSize.
  7762. */
  7763. hidePathInfo?: boolean;
  7764. /**
  7765. * Maximum number of requests which are accepted for on-demand loading.
  7766. */
  7767. maxAsyncRequests?: number;
  7768. /**
  7769. * Maximal size hint for the on-demand chunks.
  7770. */
  7771. maxAsyncSize?: number | { [index: string]: number };
  7772. /**
  7773. * Maximum number of initial chunks which are accepted for an entry point.
  7774. */
  7775. maxInitialRequests?: number;
  7776. /**
  7777. * Maximal size hint for the initial chunks.
  7778. */
  7779. maxInitialSize?: number | { [index: string]: number };
  7780. /**
  7781. * Maximal size hint for the created chunks.
  7782. */
  7783. maxSize?: number | { [index: string]: number };
  7784. /**
  7785. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  7786. */
  7787. minChunks?: number;
  7788. /**
  7789. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  7790. */
  7791. minRemainingSize?: number | { [index: string]: number };
  7792. /**
  7793. * Minimal size for the created chunks.
  7794. */
  7795. minSize?: number | { [index: string]: number };
  7796. /**
  7797. * Minimum size reduction due to the created chunk.
  7798. */
  7799. minSizeReduction?: number | { [index: string]: number };
  7800. /**
  7801. * Give chunks created a name (chunks with equal name are merged).
  7802. */
  7803. name?: string | false | Function;
  7804. /**
  7805. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  7806. */
  7807. usedExports?: boolean;
  7808. }
  7809. declare abstract class OptionsApply {
  7810. process(options?: any, compiler?: any): void;
  7811. }
  7812. declare interface OriginRecord {
  7813. module: Module;
  7814. loc: DependencyLocation;
  7815. request: string;
  7816. }
  7817. declare class OriginalSource extends Source {
  7818. constructor(source: string | Buffer, name: string);
  7819. getName(): string;
  7820. }
  7821. /**
  7822. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  7823. */
  7824. declare interface Output {
  7825. /**
  7826. * Add a container for define/require functions in the AMD module.
  7827. */
  7828. amdContainer?: string;
  7829. /**
  7830. * The filename of asset modules as relative path inside the 'output.path' directory.
  7831. */
  7832. assetModuleFilename?:
  7833. | string
  7834. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7835. /**
  7836. * Enable/disable creating async chunks that are loaded on demand.
  7837. */
  7838. asyncChunks?: boolean;
  7839. /**
  7840. * Add a comment in the UMD wrapper.
  7841. */
  7842. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  7843. /**
  7844. * Add charset attribute for script tag.
  7845. */
  7846. charset?: boolean;
  7847. /**
  7848. * 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.
  7849. */
  7850. chunkFilename?:
  7851. | string
  7852. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7853. /**
  7854. * 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).
  7855. */
  7856. chunkFormat?: string | false;
  7857. /**
  7858. * Number of milliseconds before chunk request expires.
  7859. */
  7860. chunkLoadTimeout?: number;
  7861. /**
  7862. * 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).
  7863. */
  7864. chunkLoading?: string | false;
  7865. /**
  7866. * The global variable used by webpack for loading of chunks.
  7867. */
  7868. chunkLoadingGlobal?: string;
  7869. /**
  7870. * Clean the output directory before emit.
  7871. */
  7872. clean?: boolean | CleanOptions;
  7873. /**
  7874. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  7875. */
  7876. compareBeforeEmit?: boolean;
  7877. /**
  7878. * This option enables cross-origin loading of chunks.
  7879. */
  7880. crossOriginLoading?: false | "anonymous" | "use-credentials";
  7881. /**
  7882. * 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.
  7883. */
  7884. cssChunkFilename?:
  7885. | string
  7886. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7887. /**
  7888. * 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.
  7889. */
  7890. cssFilename?:
  7891. | string
  7892. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7893. /**
  7894. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  7895. */
  7896. devtoolFallbackModuleFilenameTemplate?: string | Function;
  7897. /**
  7898. * Filename template string of function for the sources array in a generated SourceMap.
  7899. */
  7900. devtoolModuleFilenameTemplate?: string | Function;
  7901. /**
  7902. * 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.
  7903. */
  7904. devtoolNamespace?: string;
  7905. /**
  7906. * List of chunk loading types enabled for use by entry points.
  7907. */
  7908. enabledChunkLoadingTypes?: string[];
  7909. /**
  7910. * List of library types enabled for use by entry points.
  7911. */
  7912. enabledLibraryTypes?: string[];
  7913. /**
  7914. * List of wasm loading types enabled for use by entry points.
  7915. */
  7916. enabledWasmLoadingTypes?: string[];
  7917. /**
  7918. * The abilities of the environment where the webpack generated code should run.
  7919. */
  7920. environment?: Environment;
  7921. /**
  7922. * 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.
  7923. */
  7924. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7925. /**
  7926. * An expression which is used to address the global object/scope in runtime code.
  7927. */
  7928. globalObject?: string;
  7929. /**
  7930. * Digest type used for the hash.
  7931. */
  7932. hashDigest?: string;
  7933. /**
  7934. * Number of chars which are used for the hash.
  7935. */
  7936. hashDigestLength?: number;
  7937. /**
  7938. * Algorithm used for generation the hash (see node.js crypto package).
  7939. */
  7940. hashFunction?: string | typeof Hash;
  7941. /**
  7942. * Any string which is added to the hash to salt it.
  7943. */
  7944. hashSalt?: string;
  7945. /**
  7946. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  7947. */
  7948. hotUpdateChunkFilename?: string;
  7949. /**
  7950. * The global variable used by webpack for loading of hot update chunks.
  7951. */
  7952. hotUpdateGlobal?: string;
  7953. /**
  7954. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  7955. */
  7956. hotUpdateMainFilename?: string;
  7957. /**
  7958. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  7959. */
  7960. iife?: boolean;
  7961. /**
  7962. * The name of the native import() function (can be exchanged for a polyfill).
  7963. */
  7964. importFunctionName?: string;
  7965. /**
  7966. * The name of the native import.meta object (can be exchanged for a polyfill).
  7967. */
  7968. importMetaName?: string;
  7969. /**
  7970. * Make the output files a library, exporting the exports of the entry point.
  7971. */
  7972. library?: string | string[] | LibraryOptions | LibraryCustomUmdObject;
  7973. /**
  7974. * Specify which export should be exposed as library.
  7975. */
  7976. libraryExport?: string | string[];
  7977. /**
  7978. * 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).
  7979. */
  7980. libraryTarget?: string;
  7981. /**
  7982. * Output javascript files as module source type.
  7983. */
  7984. module?: boolean;
  7985. /**
  7986. * The output directory as **absolute path** (required).
  7987. */
  7988. path?: string;
  7989. /**
  7990. * Include comments with information about the modules.
  7991. */
  7992. pathinfo?: boolean | "verbose";
  7993. /**
  7994. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  7995. */
  7996. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7997. /**
  7998. * This option enables loading async chunks via a custom script type, such as script type="module".
  7999. */
  8000. scriptType?: false | "module" | "text/javascript";
  8001. /**
  8002. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  8003. */
  8004. sourceMapFilename?: string;
  8005. /**
  8006. * Prefixes every line of the source in the bundle with this string.
  8007. */
  8008. sourcePrefix?: string;
  8009. /**
  8010. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  8011. */
  8012. strictModuleErrorHandling?: boolean;
  8013. /**
  8014. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  8015. */
  8016. strictModuleExceptionHandling?: boolean;
  8017. /**
  8018. * 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.
  8019. */
  8020. trustedTypes?: string | true | TrustedTypes;
  8021. /**
  8022. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  8023. */
  8024. umdNamedDefine?: boolean;
  8025. /**
  8026. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  8027. */
  8028. uniqueName?: string;
  8029. /**
  8030. * 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).
  8031. */
  8032. wasmLoading?: string | false;
  8033. /**
  8034. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  8035. */
  8036. webassemblyModuleFilename?: string;
  8037. /**
  8038. * 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).
  8039. */
  8040. workerChunkLoading?: string | false;
  8041. /**
  8042. * 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.
  8043. */
  8044. workerPublicPath?: string;
  8045. /**
  8046. * 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).
  8047. */
  8048. workerWasmLoading?: string | false;
  8049. }
  8050. declare interface OutputFileSystem {
  8051. writeFile: (
  8052. arg0: string,
  8053. arg1: string | Buffer,
  8054. arg2: (arg0?: null | NodeJS.ErrnoException) => void
  8055. ) => void;
  8056. mkdir: (
  8057. arg0: string,
  8058. arg1: (arg0?: null | NodeJS.ErrnoException) => void
  8059. ) => void;
  8060. readdir?: (
  8061. arg0: string,
  8062. arg1: (
  8063. arg0?: null | NodeJS.ErrnoException,
  8064. arg1?: (string | Buffer)[] | IDirent[]
  8065. ) => void
  8066. ) => void;
  8067. rmdir?: (
  8068. arg0: string,
  8069. arg1: (arg0?: null | NodeJS.ErrnoException) => void
  8070. ) => void;
  8071. unlink?: (
  8072. arg0: string,
  8073. arg1: (arg0?: null | NodeJS.ErrnoException) => void
  8074. ) => void;
  8075. stat: (
  8076. arg0: string,
  8077. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
  8078. ) => void;
  8079. lstat?: (
  8080. arg0: string,
  8081. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
  8082. ) => void;
  8083. readFile: (
  8084. arg0: string,
  8085. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
  8086. ) => void;
  8087. join?: (arg0: string, arg1: string) => string;
  8088. relative?: (arg0: string, arg1: string) => string;
  8089. dirname?: (arg0: string) => string;
  8090. }
  8091. /**
  8092. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  8093. */
  8094. declare interface OutputNormalized {
  8095. /**
  8096. * The filename of asset modules as relative path inside the 'output.path' directory.
  8097. */
  8098. assetModuleFilename?:
  8099. | string
  8100. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8101. /**
  8102. * Enable/disable creating async chunks that are loaded on demand.
  8103. */
  8104. asyncChunks?: boolean;
  8105. /**
  8106. * Add charset attribute for script tag.
  8107. */
  8108. charset?: boolean;
  8109. /**
  8110. * 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.
  8111. */
  8112. chunkFilename?:
  8113. | string
  8114. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8115. /**
  8116. * 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).
  8117. */
  8118. chunkFormat?: string | false;
  8119. /**
  8120. * Number of milliseconds before chunk request expires.
  8121. */
  8122. chunkLoadTimeout?: number;
  8123. /**
  8124. * 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).
  8125. */
  8126. chunkLoading?: string | false;
  8127. /**
  8128. * The global variable used by webpack for loading of chunks.
  8129. */
  8130. chunkLoadingGlobal?: string;
  8131. /**
  8132. * Clean the output directory before emit.
  8133. */
  8134. clean?: boolean | CleanOptions;
  8135. /**
  8136. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  8137. */
  8138. compareBeforeEmit?: boolean;
  8139. /**
  8140. * This option enables cross-origin loading of chunks.
  8141. */
  8142. crossOriginLoading?: false | "anonymous" | "use-credentials";
  8143. /**
  8144. * 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.
  8145. */
  8146. cssChunkFilename?:
  8147. | string
  8148. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8149. /**
  8150. * 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.
  8151. */
  8152. cssFilename?:
  8153. | string
  8154. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8155. /**
  8156. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  8157. */
  8158. devtoolFallbackModuleFilenameTemplate?: string | Function;
  8159. /**
  8160. * Filename template string of function for the sources array in a generated SourceMap.
  8161. */
  8162. devtoolModuleFilenameTemplate?: string | Function;
  8163. /**
  8164. * 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.
  8165. */
  8166. devtoolNamespace?: string;
  8167. /**
  8168. * List of chunk loading types enabled for use by entry points.
  8169. */
  8170. enabledChunkLoadingTypes?: string[];
  8171. /**
  8172. * List of library types enabled for use by entry points.
  8173. */
  8174. enabledLibraryTypes?: string[];
  8175. /**
  8176. * List of wasm loading types enabled for use by entry points.
  8177. */
  8178. enabledWasmLoadingTypes?: string[];
  8179. /**
  8180. * The abilities of the environment where the webpack generated code should run.
  8181. */
  8182. environment?: Environment;
  8183. /**
  8184. * 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.
  8185. */
  8186. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8187. /**
  8188. * An expression which is used to address the global object/scope in runtime code.
  8189. */
  8190. globalObject?: string;
  8191. /**
  8192. * Digest type used for the hash.
  8193. */
  8194. hashDigest?: string;
  8195. /**
  8196. * Number of chars which are used for the hash.
  8197. */
  8198. hashDigestLength?: number;
  8199. /**
  8200. * Algorithm used for generation the hash (see node.js crypto package).
  8201. */
  8202. hashFunction?: string | typeof Hash;
  8203. /**
  8204. * Any string which is added to the hash to salt it.
  8205. */
  8206. hashSalt?: string;
  8207. /**
  8208. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  8209. */
  8210. hotUpdateChunkFilename?: string;
  8211. /**
  8212. * The global variable used by webpack for loading of hot update chunks.
  8213. */
  8214. hotUpdateGlobal?: string;
  8215. /**
  8216. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  8217. */
  8218. hotUpdateMainFilename?: string;
  8219. /**
  8220. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  8221. */
  8222. iife?: boolean;
  8223. /**
  8224. * The name of the native import() function (can be exchanged for a polyfill).
  8225. */
  8226. importFunctionName?: string;
  8227. /**
  8228. * The name of the native import.meta object (can be exchanged for a polyfill).
  8229. */
  8230. importMetaName?: string;
  8231. /**
  8232. * Options for library.
  8233. */
  8234. library?: LibraryOptions;
  8235. /**
  8236. * Output javascript files as module source type.
  8237. */
  8238. module?: boolean;
  8239. /**
  8240. * The output directory as **absolute path** (required).
  8241. */
  8242. path?: string;
  8243. /**
  8244. * Include comments with information about the modules.
  8245. */
  8246. pathinfo?: boolean | "verbose";
  8247. /**
  8248. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  8249. */
  8250. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8251. /**
  8252. * This option enables loading async chunks via a custom script type, such as script type="module".
  8253. */
  8254. scriptType?: false | "module" | "text/javascript";
  8255. /**
  8256. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  8257. */
  8258. sourceMapFilename?: string;
  8259. /**
  8260. * Prefixes every line of the source in the bundle with this string.
  8261. */
  8262. sourcePrefix?: string;
  8263. /**
  8264. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  8265. */
  8266. strictModuleErrorHandling?: boolean;
  8267. /**
  8268. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  8269. */
  8270. strictModuleExceptionHandling?: boolean;
  8271. /**
  8272. * Use a Trusted Types policy to create urls for chunks.
  8273. */
  8274. trustedTypes?: TrustedTypes;
  8275. /**
  8276. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  8277. */
  8278. uniqueName?: string;
  8279. /**
  8280. * 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).
  8281. */
  8282. wasmLoading?: string | false;
  8283. /**
  8284. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  8285. */
  8286. webassemblyModuleFilename?: string;
  8287. /**
  8288. * 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).
  8289. */
  8290. workerChunkLoading?: string | false;
  8291. /**
  8292. * 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.
  8293. */
  8294. workerPublicPath?: string;
  8295. /**
  8296. * 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).
  8297. */
  8298. workerWasmLoading?: string | false;
  8299. }
  8300. declare interface ParameterizedComparator<TArg, T> {
  8301. (arg0: TArg): Comparator<T>;
  8302. }
  8303. declare interface ParsedIdentifier {
  8304. request: string;
  8305. query: string;
  8306. fragment: string;
  8307. directory: boolean;
  8308. module: boolean;
  8309. file: boolean;
  8310. internal: boolean;
  8311. }
  8312. declare class Parser {
  8313. constructor();
  8314. parse(
  8315. source: string | Buffer | PreparsedAst,
  8316. state: ParserState
  8317. ): ParserState;
  8318. }
  8319. type ParserOptionsByModuleType = ParserOptionsByModuleTypeKnown &
  8320. ParserOptionsByModuleTypeUnknown;
  8321. /**
  8322. * Specify options for each parser.
  8323. */
  8324. declare interface ParserOptionsByModuleTypeKnown {
  8325. /**
  8326. * Parser options for asset modules.
  8327. */
  8328. asset?: AssetParserOptions;
  8329. /**
  8330. * No parser options are supported for this module type.
  8331. */
  8332. "asset/inline"?: EmptyParserOptions;
  8333. /**
  8334. * No parser options are supported for this module type.
  8335. */
  8336. "asset/resource"?: EmptyParserOptions;
  8337. /**
  8338. * No parser options are supported for this module type.
  8339. */
  8340. "asset/source"?: EmptyParserOptions;
  8341. /**
  8342. * Parser options for javascript modules.
  8343. */
  8344. javascript?: JavascriptParserOptions;
  8345. /**
  8346. * Parser options for javascript modules.
  8347. */
  8348. "javascript/auto"?: JavascriptParserOptions;
  8349. /**
  8350. * Parser options for javascript modules.
  8351. */
  8352. "javascript/dynamic"?: JavascriptParserOptions;
  8353. /**
  8354. * Parser options for javascript modules.
  8355. */
  8356. "javascript/esm"?: JavascriptParserOptions;
  8357. }
  8358. /**
  8359. * Specify options for each parser.
  8360. */
  8361. declare interface ParserOptionsByModuleTypeUnknown {
  8362. [index: string]: { [index: string]: any };
  8363. }
  8364. type ParserState = Record<string, any> & ParserStateBase;
  8365. declare interface ParserStateBase {
  8366. source: string | Buffer;
  8367. current: NormalModule;
  8368. module: NormalModule;
  8369. compilation: Compilation;
  8370. options: { [index: string]: any };
  8371. }
  8372. declare interface PathData {
  8373. chunkGraph?: ChunkGraph;
  8374. hash?: string;
  8375. hashWithLength?: (arg0: number) => string;
  8376. chunk?: Chunk | ChunkPathData;
  8377. module?: Module | ModulePathData;
  8378. runtime?: RuntimeSpec;
  8379. filename?: string;
  8380. basename?: string;
  8381. query?: string;
  8382. contentHashType?: string;
  8383. contentHash?: string;
  8384. contentHashWithLength?: (arg0: number) => string;
  8385. noChunkHash?: boolean;
  8386. url?: string;
  8387. }
  8388. /**
  8389. * Configuration object for web performance recommendations.
  8390. */
  8391. declare interface PerformanceOptions {
  8392. /**
  8393. * Filter function to select assets that are checked.
  8394. */
  8395. assetFilter?: Function;
  8396. /**
  8397. * Sets the format of the hints: warnings, errors or nothing at all.
  8398. */
  8399. hints?: false | "error" | "warning";
  8400. /**
  8401. * File size limit (in bytes) when exceeded, that webpack will provide performance hints.
  8402. */
  8403. maxAssetSize?: number;
  8404. /**
  8405. * Total size of an entry point (in bytes).
  8406. */
  8407. maxEntrypointSize?: number;
  8408. }
  8409. declare interface PitchLoaderDefinitionFunction<
  8410. OptionsType = {},
  8411. ContextAdditions = {}
  8412. > {
  8413. (
  8414. this: NormalModuleLoaderContext<OptionsType> &
  8415. LoaderRunnerLoaderContext<OptionsType> &
  8416. LoaderPluginLoaderContext &
  8417. HotModuleReplacementPluginLoaderContext &
  8418. ContextAdditions,
  8419. remainingRequest: string,
  8420. previousRequest: string,
  8421. data: object
  8422. ): string | void | Buffer | Promise<string | Buffer>;
  8423. }
  8424. type Plugin =
  8425. | { apply: (arg0: Resolver) => void }
  8426. | ((this: Resolver, arg1: Resolver) => void);
  8427. declare interface PnpApiImpl {
  8428. resolveToUnqualified: (arg0: string, arg1: string, arg2: object) => string;
  8429. }
  8430. declare interface PossibleFileSystemError {
  8431. code?: string;
  8432. errno?: number;
  8433. path?: string;
  8434. syscall?: string;
  8435. }
  8436. declare class PrefetchPlugin {
  8437. constructor(context?: any, request?: any);
  8438. context: any;
  8439. request: any;
  8440. /**
  8441. * Apply the plugin
  8442. */
  8443. apply(compiler: Compiler): void;
  8444. }
  8445. declare class PrefixSource extends Source {
  8446. constructor(prefix: string, source: string | Source);
  8447. original(): Source;
  8448. getPrefix(): string;
  8449. }
  8450. declare interface PreparsedAst {
  8451. [index: string]: any;
  8452. }
  8453. declare interface PrintedElement {
  8454. element: string;
  8455. content: string;
  8456. }
  8457. declare interface Problem {
  8458. type: ProblemType;
  8459. path: string;
  8460. argument: string;
  8461. value?: any;
  8462. index?: number;
  8463. expected?: string;
  8464. }
  8465. type ProblemType =
  8466. | "unknown-argument"
  8467. | "unexpected-non-array-in-path"
  8468. | "unexpected-non-object-in-path"
  8469. | "multiple-values-unexpected"
  8470. | "invalid-value";
  8471. declare interface ProcessAssetsAdditionalOptions {
  8472. additionalAssets?: true | Function;
  8473. }
  8474. declare class Profiler {
  8475. constructor(inspector?: any);
  8476. session: any;
  8477. inspector: any;
  8478. hasSession(): boolean;
  8479. startProfiling(): Promise<void> | Promise<[any, any, any]>;
  8480. sendCommand(method?: any, params?: any): Promise<any>;
  8481. destroy(): Promise<void>;
  8482. stopProfiling(): Promise<{ profile: any }>;
  8483. }
  8484. declare class ProfilingPlugin {
  8485. constructor(options?: ProfilingPluginOptions);
  8486. outputPath: string;
  8487. apply(compiler?: any): void;
  8488. static Profiler: typeof Profiler;
  8489. }
  8490. declare interface ProfilingPluginOptions {
  8491. /**
  8492. * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.
  8493. */
  8494. outputPath?: string;
  8495. }
  8496. declare class ProgressPlugin {
  8497. constructor(options?: ProgressPluginArgument);
  8498. profile?: null | boolean;
  8499. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  8500. modulesCount?: number;
  8501. dependenciesCount?: number;
  8502. showEntries?: boolean;
  8503. showModules?: boolean;
  8504. showDependencies?: boolean;
  8505. showActiveModules?: boolean;
  8506. percentBy?: null | "modules" | "dependencies" | "entries";
  8507. apply(compiler: Compiler | MultiCompiler): void;
  8508. static getReporter(
  8509. compiler: Compiler
  8510. ): (p: number, ...args: string[]) => void;
  8511. static defaultOptions: {
  8512. profile: boolean;
  8513. modulesCount: number;
  8514. dependenciesCount: number;
  8515. modules: boolean;
  8516. dependencies: boolean;
  8517. activeModules: boolean;
  8518. entries: boolean;
  8519. };
  8520. }
  8521. type ProgressPluginArgument =
  8522. | ProgressPluginOptions
  8523. | ((percentage: number, msg: string, ...args: string[]) => void);
  8524. /**
  8525. * Options object for the ProgressPlugin.
  8526. */
  8527. declare interface ProgressPluginOptions {
  8528. /**
  8529. * Show active modules count and one active module in progress message.
  8530. */
  8531. activeModules?: boolean;
  8532. /**
  8533. * Show dependencies count in progress message.
  8534. */
  8535. dependencies?: boolean;
  8536. /**
  8537. * Minimum dependencies count to start with. For better progress calculation. Default: 10000.
  8538. */
  8539. dependenciesCount?: number;
  8540. /**
  8541. * Show entries count in progress message.
  8542. */
  8543. entries?: boolean;
  8544. /**
  8545. * Function that executes for every progress step.
  8546. */
  8547. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  8548. /**
  8549. * Show modules count in progress message.
  8550. */
  8551. modules?: boolean;
  8552. /**
  8553. * Minimum modules count to start with. For better progress calculation. Default: 5000.
  8554. */
  8555. modulesCount?: number;
  8556. /**
  8557. * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
  8558. */
  8559. percentBy?: null | "modules" | "dependencies" | "entries";
  8560. /**
  8561. * Collect profile data for progress steps. Default: false.
  8562. */
  8563. profile?: null | boolean;
  8564. }
  8565. declare class ProvidePlugin {
  8566. constructor(definitions: Record<string, string | string[]>);
  8567. definitions: Record<string, string | string[]>;
  8568. /**
  8569. * Apply the plugin
  8570. */
  8571. apply(compiler: Compiler): void;
  8572. }
  8573. declare class ProvideSharedPlugin {
  8574. constructor(options: ProvideSharedPluginOptions);
  8575. /**
  8576. * Apply the plugin
  8577. */
  8578. apply(compiler: Compiler): void;
  8579. }
  8580. declare interface ProvideSharedPluginOptions {
  8581. /**
  8582. * 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.
  8583. */
  8584. provides: Provides;
  8585. /**
  8586. * Share scope name used for all provided modules (defaults to 'default').
  8587. */
  8588. shareScope?: string;
  8589. }
  8590. type Provides = (string | ProvidesObject)[] | ProvidesObject;
  8591. /**
  8592. * Advanced configuration for modules that should be provided as shared modules to the share scope.
  8593. */
  8594. declare interface ProvidesConfig {
  8595. /**
  8596. * 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.
  8597. */
  8598. eager?: boolean;
  8599. /**
  8600. * Key in the share scope under which the shared modules should be stored.
  8601. */
  8602. shareKey?: string;
  8603. /**
  8604. * Share scope name.
  8605. */
  8606. shareScope?: string;
  8607. /**
  8608. * Version of the provided module. Will replace lower matching versions, but not higher.
  8609. */
  8610. version?: string | false;
  8611. }
  8612. /**
  8613. * Modules that should be provided as shared modules to the share scope. Property names are used as share keys.
  8614. */
  8615. declare interface ProvidesObject {
  8616. [index: string]: string | ProvidesConfig;
  8617. }
  8618. declare interface RawChunkGroupOptions {
  8619. preloadOrder?: number;
  8620. prefetchOrder?: number;
  8621. }
  8622. type RawLoaderDefinition<
  8623. OptionsType = {},
  8624. ContextAdditions = {}
  8625. > = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  8626. raw: true;
  8627. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  8628. };
  8629. declare interface RawLoaderDefinitionFunction<
  8630. OptionsType = {},
  8631. ContextAdditions = {}
  8632. > {
  8633. (
  8634. this: NormalModuleLoaderContext<OptionsType> &
  8635. LoaderRunnerLoaderContext<OptionsType> &
  8636. LoaderPluginLoaderContext &
  8637. HotModuleReplacementPluginLoaderContext &
  8638. ContextAdditions,
  8639. content: Buffer,
  8640. sourceMap?: string | SourceMap,
  8641. additionalData?: AdditionalData
  8642. ): string | void | Buffer | Promise<string | Buffer>;
  8643. }
  8644. declare class RawSource extends Source {
  8645. constructor(source: string | Buffer, convertToString?: boolean);
  8646. isBuffer(): boolean;
  8647. }
  8648. declare interface RawSourceMap {
  8649. version: number;
  8650. sources: string[];
  8651. names: string[];
  8652. sourceRoot?: string;
  8653. sourcesContent?: string[];
  8654. mappings: string;
  8655. file: string;
  8656. }
  8657. declare class ReadFileCompileWasmPlugin {
  8658. constructor(options?: any);
  8659. options: any;
  8660. /**
  8661. * Apply the plugin
  8662. */
  8663. apply(compiler: Compiler): void;
  8664. }
  8665. declare interface ReaddirOptions {
  8666. encoding?:
  8667. | null
  8668. | "ascii"
  8669. | "utf8"
  8670. | "utf16le"
  8671. | "ucs2"
  8672. | "latin1"
  8673. | "binary"
  8674. | "utf-8"
  8675. | "ucs-2"
  8676. | "base64"
  8677. | "hex"
  8678. | "buffer";
  8679. withFileTypes?: boolean;
  8680. }
  8681. declare class RealContentHashPlugin {
  8682. constructor(__0: { hashFunction: any; hashDigest: any });
  8683. /**
  8684. * Apply the plugin
  8685. */
  8686. apply(compiler: Compiler): void;
  8687. static getCompilationHooks(
  8688. compilation: Compilation
  8689. ): CompilationHooksRealContentHashPlugin;
  8690. }
  8691. declare interface RealDependencyLocation {
  8692. start: SourcePosition;
  8693. end?: SourcePosition;
  8694. index?: number;
  8695. }
  8696. type RecursiveArrayOrRecord<T> =
  8697. | { [index: string]: RecursiveArrayOrRecord<T> }
  8698. | RecursiveArrayOrRecord<T>[]
  8699. | T;
  8700. declare interface ReferencedExport {
  8701. /**
  8702. * name of the referenced export
  8703. */
  8704. name: string[];
  8705. /**
  8706. * when false, referenced export can not be mangled, defaults to true
  8707. */
  8708. canMangle?: boolean;
  8709. }
  8710. type Remotes = (string | RemotesObject)[] | RemotesObject;
  8711. /**
  8712. * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
  8713. */
  8714. declare interface RemotesConfig {
  8715. /**
  8716. * Container locations from which modules should be resolved and loaded at runtime.
  8717. */
  8718. external: string | string[];
  8719. /**
  8720. * The name of the share scope shared with this remote.
  8721. */
  8722. shareScope?: string;
  8723. }
  8724. /**
  8725. * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
  8726. */
  8727. declare interface RemotesObject {
  8728. [index: string]: string | RemotesConfig | string[];
  8729. }
  8730. declare interface RenderBootstrapContext {
  8731. /**
  8732. * the chunk
  8733. */
  8734. chunk: Chunk;
  8735. /**
  8736. * results of code generation
  8737. */
  8738. codeGenerationResults: CodeGenerationResults;
  8739. /**
  8740. * the runtime template
  8741. */
  8742. runtimeTemplate: RuntimeTemplate;
  8743. /**
  8744. * the module graph
  8745. */
  8746. moduleGraph: ModuleGraph;
  8747. /**
  8748. * the chunk graph
  8749. */
  8750. chunkGraph: ChunkGraph;
  8751. /**
  8752. * hash to be used for render call
  8753. */
  8754. hash: string;
  8755. }
  8756. declare interface RenderContext {
  8757. /**
  8758. * the chunk
  8759. */
  8760. chunk: Chunk;
  8761. /**
  8762. * the dependency templates
  8763. */
  8764. dependencyTemplates: DependencyTemplates;
  8765. /**
  8766. * the runtime template
  8767. */
  8768. runtimeTemplate: RuntimeTemplate;
  8769. /**
  8770. * the module graph
  8771. */
  8772. moduleGraph: ModuleGraph;
  8773. /**
  8774. * the chunk graph
  8775. */
  8776. chunkGraph: ChunkGraph;
  8777. /**
  8778. * results of code generation
  8779. */
  8780. codeGenerationResults: CodeGenerationResults;
  8781. /**
  8782. * rendering in strict context
  8783. */
  8784. strictMode: boolean;
  8785. }
  8786. type RenderManifestEntry =
  8787. | RenderManifestEntryTemplated
  8788. | RenderManifestEntryStatic;
  8789. declare interface RenderManifestEntryStatic {
  8790. render: () => Source;
  8791. filename: string;
  8792. info: AssetInfo;
  8793. identifier: string;
  8794. hash?: string;
  8795. auxiliary?: boolean;
  8796. }
  8797. declare interface RenderManifestEntryTemplated {
  8798. render: () => Source;
  8799. filenameTemplate: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  8800. pathOptions?: PathData;
  8801. info?: AssetInfo;
  8802. identifier: string;
  8803. hash?: string;
  8804. auxiliary?: boolean;
  8805. }
  8806. declare interface RenderManifestOptions {
  8807. /**
  8808. * the chunk used to render
  8809. */
  8810. chunk: Chunk;
  8811. hash: string;
  8812. fullHash: string;
  8813. outputOptions: Output;
  8814. codeGenerationResults: CodeGenerationResults;
  8815. moduleTemplates: { javascript: ModuleTemplate };
  8816. dependencyTemplates: DependencyTemplates;
  8817. runtimeTemplate: RuntimeTemplate;
  8818. moduleGraph: ModuleGraph;
  8819. chunkGraph: ChunkGraph;
  8820. }
  8821. declare class ReplaceSource extends Source {
  8822. constructor(source: Source, name?: string);
  8823. replace(start: number, end: number, newValue: string, name?: string): void;
  8824. insert(pos: number, newValue: string, name?: string): void;
  8825. getName(): string;
  8826. original(): string;
  8827. getReplacements(): {
  8828. start: number;
  8829. end: number;
  8830. content: string;
  8831. insertIndex: number;
  8832. name: string;
  8833. }[];
  8834. }
  8835. declare abstract class RequestShortener {
  8836. contextify: (arg0: string) => string;
  8837. shorten(request?: null | string): undefined | null | string;
  8838. }
  8839. declare interface ResolveBuildDependenciesResult {
  8840. /**
  8841. * list of files
  8842. */
  8843. files: Set<string>;
  8844. /**
  8845. * list of directories
  8846. */
  8847. directories: Set<string>;
  8848. /**
  8849. * list of missing entries
  8850. */
  8851. missing: Set<string>;
  8852. /**
  8853. * stored resolve results
  8854. */
  8855. resolveResults: Map<string, string | false>;
  8856. /**
  8857. * dependencies of the resolving
  8858. */
  8859. resolveDependencies: {
  8860. /**
  8861. * list of files
  8862. */
  8863. files: Set<string>;
  8864. /**
  8865. * list of directories
  8866. */
  8867. directories: Set<string>;
  8868. /**
  8869. * list of missing entries
  8870. */
  8871. missing: Set<string>;
  8872. };
  8873. }
  8874. /**
  8875. * Resolve context
  8876. */
  8877. declare interface ResolveContext {
  8878. contextDependencies?: WriteOnlySet<string>;
  8879. /**
  8880. * files that was found on file system
  8881. */
  8882. fileDependencies?: WriteOnlySet<string>;
  8883. /**
  8884. * dependencies that was not found on file system
  8885. */
  8886. missingDependencies?: WriteOnlySet<string>;
  8887. /**
  8888. * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
  8889. */
  8890. stack?: Set<string>;
  8891. /**
  8892. * log function
  8893. */
  8894. log?: (arg0: string) => void;
  8895. /**
  8896. * yield result, if provided plugins can return several results
  8897. */
  8898. yield?: (arg0: ResolveRequest) => void;
  8899. }
  8900. declare interface ResolveData {
  8901. contextInfo: ModuleFactoryCreateDataContextInfo;
  8902. resolveOptions?: ResolveOptionsWebpackOptions;
  8903. context: string;
  8904. request: string;
  8905. assertions?: Record<string, any>;
  8906. dependencies: ModuleDependency[];
  8907. dependencyType: string;
  8908. createData: Partial<NormalModuleCreateData & { settings: ModuleSettings }>;
  8909. fileDependencies: LazySet<string>;
  8910. missingDependencies: LazySet<string>;
  8911. contextDependencies: LazySet<string>;
  8912. /**
  8913. * allow to use the unsafe cache
  8914. */
  8915. cacheable: boolean;
  8916. }
  8917. declare interface ResolveOptionsTypes {
  8918. alias: AliasOption[];
  8919. fallback: AliasOption[];
  8920. aliasFields: Set<string | string[]>;
  8921. extensionAlias: ExtensionAliasOption[];
  8922. cachePredicate: (arg0: ResolveRequest) => boolean;
  8923. cacheWithContext: boolean;
  8924. /**
  8925. * A list of exports field condition names.
  8926. */
  8927. conditionNames: Set<string>;
  8928. descriptionFiles: string[];
  8929. enforceExtension: boolean;
  8930. exportsFields: Set<string | string[]>;
  8931. importsFields: Set<string | string[]>;
  8932. extensions: Set<string>;
  8933. fileSystem: FileSystem;
  8934. unsafeCache: false | object;
  8935. symlinks: boolean;
  8936. resolver?: Resolver;
  8937. modules: (string | string[])[];
  8938. mainFields: { name: string[]; forceRelative: boolean }[];
  8939. mainFiles: Set<string>;
  8940. plugins: Plugin[];
  8941. pnpApi: null | PnpApiImpl;
  8942. roots: Set<string>;
  8943. fullySpecified: boolean;
  8944. resolveToContext: boolean;
  8945. restrictions: Set<string | RegExp>;
  8946. preferRelative: boolean;
  8947. preferAbsolute: boolean;
  8948. }
  8949. /**
  8950. * Options object for resolving requests.
  8951. */
  8952. declare interface ResolveOptionsWebpackOptions {
  8953. /**
  8954. * Redirect module requests.
  8955. */
  8956. alias?:
  8957. | {
  8958. /**
  8959. * New request.
  8960. */
  8961. alias: string | false | string[];
  8962. /**
  8963. * Request to be redirected.
  8964. */
  8965. name: string;
  8966. /**
  8967. * Redirect only exact matching request.
  8968. */
  8969. onlyModule?: boolean;
  8970. }[]
  8971. | { [index: string]: string | false | string[] };
  8972. /**
  8973. * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
  8974. */
  8975. aliasFields?: (string | string[])[];
  8976. /**
  8977. * Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
  8978. */
  8979. byDependency?: { [index: string]: ResolveOptionsWebpackOptions };
  8980. /**
  8981. * Enable caching of successfully resolved requests (cache entries are revalidated).
  8982. */
  8983. cache?: boolean;
  8984. /**
  8985. * Predicate function to decide which requests should be cached.
  8986. */
  8987. cachePredicate?: (request: ResolveRequest) => boolean;
  8988. /**
  8989. * Include the context information in the cache identifier when caching.
  8990. */
  8991. cacheWithContext?: boolean;
  8992. /**
  8993. * Condition names for exports field entry point.
  8994. */
  8995. conditionNames?: string[];
  8996. /**
  8997. * Filenames used to find a description file (like a package.json).
  8998. */
  8999. descriptionFiles?: string[];
  9000. /**
  9001. * Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).
  9002. */
  9003. enforceExtension?: boolean;
  9004. /**
  9005. * Field names from the description file (usually package.json) which are used to provide entry points of a package.
  9006. */
  9007. exportsFields?: string[];
  9008. /**
  9009. * An object which maps extension to extension aliases.
  9010. */
  9011. extensionAlias?: { [index: string]: string | string[] };
  9012. /**
  9013. * Extensions added to the request when trying to find the file.
  9014. */
  9015. extensions?: string[];
  9016. /**
  9017. * Redirect module requests when normal resolving fails.
  9018. */
  9019. fallback?:
  9020. | {
  9021. /**
  9022. * New request.
  9023. */
  9024. alias: string | false | string[];
  9025. /**
  9026. * Request to be redirected.
  9027. */
  9028. name: string;
  9029. /**
  9030. * Redirect only exact matching request.
  9031. */
  9032. onlyModule?: boolean;
  9033. }[]
  9034. | { [index: string]: string | false | string[] };
  9035. /**
  9036. * Filesystem for the resolver.
  9037. */
  9038. fileSystem?: InputFileSystem;
  9039. /**
  9040. * 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).
  9041. */
  9042. fullySpecified?: boolean;
  9043. /**
  9044. * 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).
  9045. */
  9046. importsFields?: string[];
  9047. /**
  9048. * Field names from the description file (package.json) which are used to find the default entry point.
  9049. */
  9050. mainFields?: (string | string[])[];
  9051. /**
  9052. * Filenames used to find the default entry point if there is no description file or main field.
  9053. */
  9054. mainFiles?: string[];
  9055. /**
  9056. * Folder names or directory paths where to find modules.
  9057. */
  9058. modules?: string[];
  9059. /**
  9060. * Plugins for the resolver.
  9061. */
  9062. plugins?: (ResolvePluginInstance | "...")[];
  9063. /**
  9064. * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
  9065. */
  9066. preferAbsolute?: boolean;
  9067. /**
  9068. * Prefer to resolve module requests as relative request and fallback to resolving as module.
  9069. */
  9070. preferRelative?: boolean;
  9071. /**
  9072. * Custom resolver.
  9073. */
  9074. resolver?: Resolver;
  9075. /**
  9076. * 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.
  9077. */
  9078. restrictions?: (string | RegExp)[];
  9079. /**
  9080. * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
  9081. */
  9082. roots?: string[];
  9083. /**
  9084. * Enable resolving symlinks to the original location.
  9085. */
  9086. symlinks?: boolean;
  9087. /**
  9088. * Enable caching of successfully resolved requests (cache entries are not revalidated).
  9089. */
  9090. unsafeCache?: boolean | { [index: string]: any };
  9091. /**
  9092. * Use synchronous filesystem calls for the resolver.
  9093. */
  9094. useSyncFileSystemCalls?: boolean;
  9095. }
  9096. type ResolveOptionsWithDependencyType = ResolveOptionsWebpackOptions & {
  9097. dependencyType?: string;
  9098. resolveToContext?: boolean;
  9099. };
  9100. /**
  9101. * Plugin instance.
  9102. */
  9103. declare interface ResolvePluginInstance {
  9104. [index: string]: any;
  9105. /**
  9106. * The run point of the plugin, required method.
  9107. */
  9108. apply: (resolver: Resolver) => void;
  9109. }
  9110. type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
  9111. declare interface ResolvedContextFileSystemInfoEntry {
  9112. safeTime: number;
  9113. timestampHash?: string;
  9114. }
  9115. declare interface ResolvedContextTimestampAndHash {
  9116. safeTime: number;
  9117. timestampHash?: string;
  9118. hash: string;
  9119. }
  9120. declare abstract class Resolver {
  9121. fileSystem: FileSystem;
  9122. options: ResolveOptionsTypes;
  9123. hooks: {
  9124. resolveStep: SyncHook<
  9125. [
  9126. AsyncSeriesBailHook<
  9127. [ResolveRequest, ResolveContext],
  9128. null | ResolveRequest
  9129. >,
  9130. ResolveRequest
  9131. ]
  9132. >;
  9133. noResolve: SyncHook<[ResolveRequest, Error]>;
  9134. resolve: AsyncSeriesBailHook<
  9135. [ResolveRequest, ResolveContext],
  9136. null | ResolveRequest
  9137. >;
  9138. result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
  9139. };
  9140. ensureHook(
  9141. name:
  9142. | string
  9143. | AsyncSeriesBailHook<
  9144. [ResolveRequest, ResolveContext],
  9145. null | ResolveRequest
  9146. >
  9147. ): AsyncSeriesBailHook<
  9148. [ResolveRequest, ResolveContext],
  9149. null | ResolveRequest
  9150. >;
  9151. getHook(
  9152. name:
  9153. | string
  9154. | AsyncSeriesBailHook<
  9155. [ResolveRequest, ResolveContext],
  9156. null | ResolveRequest
  9157. >
  9158. ): AsyncSeriesBailHook<
  9159. [ResolveRequest, ResolveContext],
  9160. null | ResolveRequest
  9161. >;
  9162. resolveSync(context: object, path: string, request: string): string | false;
  9163. resolve(
  9164. context: object,
  9165. path: string,
  9166. request: string,
  9167. resolveContext: ResolveContext,
  9168. callback: (
  9169. arg0: null | Error,
  9170. arg1?: string | false,
  9171. arg2?: ResolveRequest
  9172. ) => void
  9173. ): void;
  9174. doResolve(
  9175. hook?: any,
  9176. request?: any,
  9177. message?: any,
  9178. resolveContext?: any,
  9179. callback?: any
  9180. ): any;
  9181. parse(identifier: string): ParsedIdentifier;
  9182. isModule(path?: any): boolean;
  9183. isPrivate(path?: any): boolean;
  9184. isDirectory(path: string): boolean;
  9185. join(path?: any, request?: any): string;
  9186. normalize(path?: any): string;
  9187. }
  9188. declare interface ResolverCache {
  9189. direct: WeakMap<Object, ResolverWithOptions>;
  9190. stringified: Map<string, ResolverWithOptions>;
  9191. }
  9192. declare abstract class ResolverFactory {
  9193. hooks: Readonly<{
  9194. resolveOptions: HookMap<
  9195. SyncWaterfallHook<[ResolveOptionsWithDependencyType]>
  9196. >;
  9197. resolver: HookMap<
  9198. SyncHook<[Resolver, UserResolveOptions, ResolveOptionsWithDependencyType]>
  9199. >;
  9200. }>;
  9201. cache: Map<string, ResolverCache>;
  9202. get(
  9203. type: string,
  9204. resolveOptions?: ResolveOptionsWithDependencyType
  9205. ): ResolverWithOptions;
  9206. }
  9207. type ResolverWithOptions = Resolver & WithOptions;
  9208. declare interface ResourceDataWithData {
  9209. resource: string;
  9210. path: string;
  9211. query: string;
  9212. fragment: string;
  9213. context?: string;
  9214. data: Record<string, any>;
  9215. }
  9216. type Rule = string | RegExp;
  9217. declare interface RuleSet {
  9218. /**
  9219. * map of references in the rule set (may grow over time)
  9220. */
  9221. references: Map<string, any>;
  9222. /**
  9223. * execute the rule set
  9224. */
  9225. exec: (arg0: object) => Effect[];
  9226. }
  9227. type RuleSetCondition =
  9228. | string
  9229. | RegExp
  9230. | ((value: string) => boolean)
  9231. | RuleSetLogicalConditions
  9232. | RuleSetCondition[];
  9233. type RuleSetConditionAbsolute =
  9234. | string
  9235. | RegExp
  9236. | ((value: string) => boolean)
  9237. | RuleSetLogicalConditionsAbsolute
  9238. | RuleSetConditionAbsolute[];
  9239. type RuleSetConditionOrConditions =
  9240. | string
  9241. | RegExp
  9242. | ((value: string) => boolean)
  9243. | RuleSetLogicalConditions
  9244. | RuleSetCondition[];
  9245. /**
  9246. * Logic operators used in a condition matcher.
  9247. */
  9248. declare interface RuleSetLogicalConditions {
  9249. /**
  9250. * Logical AND.
  9251. */
  9252. and?: RuleSetCondition[];
  9253. /**
  9254. * Logical NOT.
  9255. */
  9256. not?:
  9257. | string
  9258. | RegExp
  9259. | ((value: string) => boolean)
  9260. | RuleSetLogicalConditions
  9261. | RuleSetCondition[];
  9262. /**
  9263. * Logical OR.
  9264. */
  9265. or?: RuleSetCondition[];
  9266. }
  9267. /**
  9268. * Logic operators used in a condition matcher.
  9269. */
  9270. declare interface RuleSetLogicalConditionsAbsolute {
  9271. /**
  9272. * Logical AND.
  9273. */
  9274. and?: RuleSetConditionAbsolute[];
  9275. /**
  9276. * Logical NOT.
  9277. */
  9278. not?:
  9279. | string
  9280. | RegExp
  9281. | ((value: string) => boolean)
  9282. | RuleSetLogicalConditionsAbsolute
  9283. | RuleSetConditionAbsolute[];
  9284. /**
  9285. * Logical OR.
  9286. */
  9287. or?: RuleSetConditionAbsolute[];
  9288. }
  9289. /**
  9290. * A rule description with conditions and effects for modules.
  9291. */
  9292. declare interface RuleSetRule {
  9293. /**
  9294. * Match on import assertions of the dependency.
  9295. */
  9296. assert?: { [index: string]: RuleSetConditionOrConditions };
  9297. /**
  9298. * Match the child compiler name.
  9299. */
  9300. compiler?:
  9301. | string
  9302. | RegExp
  9303. | ((value: string) => boolean)
  9304. | RuleSetLogicalConditions
  9305. | RuleSetCondition[];
  9306. /**
  9307. * Match dependency type.
  9308. */
  9309. dependency?:
  9310. | string
  9311. | RegExp
  9312. | ((value: string) => boolean)
  9313. | RuleSetLogicalConditions
  9314. | RuleSetCondition[];
  9315. /**
  9316. * Match values of properties in the description file (usually package.json).
  9317. */
  9318. descriptionData?: { [index: string]: RuleSetConditionOrConditions };
  9319. /**
  9320. * Enforce this rule as pre or post step.
  9321. */
  9322. enforce?: "pre" | "post";
  9323. /**
  9324. * Shortcut for resource.exclude.
  9325. */
  9326. exclude?:
  9327. | string
  9328. | RegExp
  9329. | ((value: string) => boolean)
  9330. | RuleSetLogicalConditionsAbsolute
  9331. | RuleSetConditionAbsolute[];
  9332. /**
  9333. * The options for the module generator.
  9334. */
  9335. generator?: { [index: string]: any };
  9336. /**
  9337. * Shortcut for resource.include.
  9338. */
  9339. include?:
  9340. | string
  9341. | RegExp
  9342. | ((value: string) => boolean)
  9343. | RuleSetLogicalConditionsAbsolute
  9344. | RuleSetConditionAbsolute[];
  9345. /**
  9346. * Match the issuer of the module (The module pointing to this module).
  9347. */
  9348. issuer?:
  9349. | string
  9350. | RegExp
  9351. | ((value: string) => boolean)
  9352. | RuleSetLogicalConditionsAbsolute
  9353. | RuleSetConditionAbsolute[];
  9354. /**
  9355. * Match layer of the issuer of this module (The module pointing to this module).
  9356. */
  9357. issuerLayer?:
  9358. | string
  9359. | RegExp
  9360. | ((value: string) => boolean)
  9361. | RuleSetLogicalConditions
  9362. | RuleSetCondition[];
  9363. /**
  9364. * Specifies the layer in which the module should be placed in.
  9365. */
  9366. layer?: string;
  9367. /**
  9368. * Shortcut for use.loader.
  9369. */
  9370. loader?: string;
  9371. /**
  9372. * Match module mimetype when load from Data URI.
  9373. */
  9374. mimetype?:
  9375. | string
  9376. | RegExp
  9377. | ((value: string) => boolean)
  9378. | RuleSetLogicalConditions
  9379. | RuleSetCondition[];
  9380. /**
  9381. * Only execute the first matching rule in this array.
  9382. */
  9383. oneOf?: RuleSetRule[];
  9384. /**
  9385. * Shortcut for use.options.
  9386. */
  9387. options?: string | { [index: string]: any };
  9388. /**
  9389. * Options for parsing.
  9390. */
  9391. parser?: { [index: string]: any };
  9392. /**
  9393. * Match the real resource path of the module.
  9394. */
  9395. realResource?:
  9396. | string
  9397. | RegExp
  9398. | ((value: string) => boolean)
  9399. | RuleSetLogicalConditionsAbsolute
  9400. | RuleSetConditionAbsolute[];
  9401. /**
  9402. * Options for the resolver.
  9403. */
  9404. resolve?: ResolveOptionsWebpackOptions;
  9405. /**
  9406. * Match the resource path of the module.
  9407. */
  9408. resource?:
  9409. | string
  9410. | RegExp
  9411. | ((value: string) => boolean)
  9412. | RuleSetLogicalConditionsAbsolute
  9413. | RuleSetConditionAbsolute[];
  9414. /**
  9415. * Match the resource fragment of the module.
  9416. */
  9417. resourceFragment?:
  9418. | string
  9419. | RegExp
  9420. | ((value: string) => boolean)
  9421. | RuleSetLogicalConditions
  9422. | RuleSetCondition[];
  9423. /**
  9424. * Match the resource query of the module.
  9425. */
  9426. resourceQuery?:
  9427. | string
  9428. | RegExp
  9429. | ((value: string) => boolean)
  9430. | RuleSetLogicalConditions
  9431. | RuleSetCondition[];
  9432. /**
  9433. * Match and execute these rules when this rule is matched.
  9434. */
  9435. rules?: RuleSetRule[];
  9436. /**
  9437. * Match module scheme.
  9438. */
  9439. scheme?:
  9440. | string
  9441. | RegExp
  9442. | ((value: string) => boolean)
  9443. | RuleSetLogicalConditions
  9444. | RuleSetCondition[];
  9445. /**
  9446. * Flags a module as with or without side effects.
  9447. */
  9448. sideEffects?: boolean;
  9449. /**
  9450. * Shortcut for resource.test.
  9451. */
  9452. test?:
  9453. | string
  9454. | RegExp
  9455. | ((value: string) => boolean)
  9456. | RuleSetLogicalConditionsAbsolute
  9457. | RuleSetConditionAbsolute[];
  9458. /**
  9459. * Module type to use for the module.
  9460. */
  9461. type?: string;
  9462. /**
  9463. * Modifiers applied to the module when rule is matched.
  9464. */
  9465. use?:
  9466. | string
  9467. | RuleSetUseItem[]
  9468. | ((data: {
  9469. resource: string;
  9470. realResource: string;
  9471. resourceQuery: string;
  9472. issuer: string;
  9473. compiler: string;
  9474. }) => RuleSetUseItem[])
  9475. | {
  9476. /**
  9477. * Unique loader options identifier.
  9478. */
  9479. ident?: string;
  9480. /**
  9481. * Loader name.
  9482. */
  9483. loader?: string;
  9484. /**
  9485. * Loader options.
  9486. */
  9487. options?: string | { [index: string]: any };
  9488. }
  9489. | ((data: object) =>
  9490. | string
  9491. | {
  9492. /**
  9493. * Unique loader options identifier.
  9494. */
  9495. ident?: string;
  9496. /**
  9497. * Loader name.
  9498. */
  9499. loader?: string;
  9500. /**
  9501. * Loader options.
  9502. */
  9503. options?: string | { [index: string]: any };
  9504. }
  9505. | __TypeWebpackOptions
  9506. | RuleSetUseItem[]);
  9507. }
  9508. type RuleSetUse =
  9509. | string
  9510. | RuleSetUseItem[]
  9511. | ((data: {
  9512. resource: string;
  9513. realResource: string;
  9514. resourceQuery: string;
  9515. issuer: string;
  9516. compiler: string;
  9517. }) => RuleSetUseItem[])
  9518. | {
  9519. /**
  9520. * Unique loader options identifier.
  9521. */
  9522. ident?: string;
  9523. /**
  9524. * Loader name.
  9525. */
  9526. loader?: string;
  9527. /**
  9528. * Loader options.
  9529. */
  9530. options?: string | { [index: string]: any };
  9531. }
  9532. | __TypeWebpackOptions;
  9533. type RuleSetUseItem =
  9534. | string
  9535. | {
  9536. /**
  9537. * Unique loader options identifier.
  9538. */
  9539. ident?: string;
  9540. /**
  9541. * Loader name.
  9542. */
  9543. loader?: string;
  9544. /**
  9545. * Loader options.
  9546. */
  9547. options?: string | { [index: string]: any };
  9548. }
  9549. | __TypeWebpackOptions;
  9550. declare class RuntimeChunkPlugin {
  9551. constructor(options?: any);
  9552. options: any;
  9553. /**
  9554. * Apply the plugin
  9555. */
  9556. apply(compiler: Compiler): void;
  9557. }
  9558. type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
  9559. declare class RuntimeModule extends Module {
  9560. constructor(name: string, stage?: number);
  9561. name: string;
  9562. stage: number;
  9563. compilation: Compilation;
  9564. chunk: Chunk;
  9565. chunkGraph: ChunkGraph;
  9566. fullHash: boolean;
  9567. dependentHash: boolean;
  9568. attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
  9569. generate(): string;
  9570. getGeneratedCode(): string;
  9571. shouldIsolate(): boolean;
  9572. /**
  9573. * Runtime modules without any dependencies to other runtime modules
  9574. */
  9575. static STAGE_NORMAL: number;
  9576. /**
  9577. * Runtime modules with simple dependencies on other runtime modules
  9578. */
  9579. static STAGE_BASIC: number;
  9580. /**
  9581. * Runtime modules which attach to handlers of other runtime modules
  9582. */
  9583. static STAGE_ATTACH: number;
  9584. /**
  9585. * Runtime modules which trigger actions on bootstrap
  9586. */
  9587. static STAGE_TRIGGER: number;
  9588. }
  9589. declare interface RuntimeRequirementsContext {
  9590. /**
  9591. * the chunk graph
  9592. */
  9593. chunkGraph: ChunkGraph;
  9594. /**
  9595. * the code generation results
  9596. */
  9597. codeGenerationResults: CodeGenerationResults;
  9598. }
  9599. type RuntimeSpec = undefined | string | SortableSet<string>;
  9600. declare class RuntimeSpecMap<T> {
  9601. constructor(clone?: RuntimeSpecMap<T>);
  9602. get(runtime: RuntimeSpec): T;
  9603. has(runtime: RuntimeSpec): boolean;
  9604. set(runtime?: any, value?: any): void;
  9605. provide(runtime?: any, computer?: any): any;
  9606. delete(runtime?: any): void;
  9607. update(runtime?: any, fn?: any): void;
  9608. keys(): RuntimeSpec[];
  9609. values(): IterableIterator<T>;
  9610. get size(): number;
  9611. }
  9612. declare class RuntimeSpecSet {
  9613. constructor(iterable?: any);
  9614. add(runtime?: any): void;
  9615. has(runtime?: any): boolean;
  9616. get size(): number;
  9617. [Symbol.iterator](): IterableIterator<RuntimeSpec>;
  9618. }
  9619. declare abstract class RuntimeTemplate {
  9620. compilation: Compilation;
  9621. outputOptions: OutputNormalized;
  9622. requestShortener: RequestShortener;
  9623. globalObject: string;
  9624. contentHashReplacement: string;
  9625. isIIFE(): undefined | boolean;
  9626. isModule(): undefined | boolean;
  9627. supportsConst(): undefined | boolean;
  9628. supportsArrowFunction(): undefined | boolean;
  9629. supportsOptionalChaining(): undefined | boolean;
  9630. supportsForOf(): undefined | boolean;
  9631. supportsDestructuring(): undefined | boolean;
  9632. supportsBigIntLiteral(): undefined | boolean;
  9633. supportsDynamicImport(): undefined | boolean;
  9634. supportsEcmaScriptModuleSyntax(): undefined | boolean;
  9635. supportTemplateLiteral(): undefined | boolean;
  9636. returningFunction(returnValue?: any, args?: string): string;
  9637. basicFunction(args?: any, body?: any): string;
  9638. concatenation(...args: (string | { expr: string })[]): string;
  9639. expressionFunction(expression?: any, args?: string): string;
  9640. emptyFunction(): "x => {}" | "function() {}";
  9641. destructureArray(items?: any, value?: any): string;
  9642. destructureObject(items?: any, value?: any): string;
  9643. iife(args?: any, body?: any): string;
  9644. forEach(variable?: any, array?: any, body?: any): string;
  9645. /**
  9646. * Add a comment
  9647. */
  9648. comment(__0: {
  9649. /**
  9650. * request string used originally
  9651. */
  9652. request?: string;
  9653. /**
  9654. * name of the chunk referenced
  9655. */
  9656. chunkName?: string;
  9657. /**
  9658. * reason information of the chunk
  9659. */
  9660. chunkReason?: string;
  9661. /**
  9662. * additional message
  9663. */
  9664. message?: string;
  9665. /**
  9666. * name of the export
  9667. */
  9668. exportName?: string;
  9669. }): string;
  9670. throwMissingModuleErrorBlock(__0: {
  9671. /**
  9672. * request string used originally
  9673. */
  9674. request?: string;
  9675. }): string;
  9676. throwMissingModuleErrorFunction(__0: {
  9677. /**
  9678. * request string used originally
  9679. */
  9680. request?: string;
  9681. }): string;
  9682. missingModule(__0: {
  9683. /**
  9684. * request string used originally
  9685. */
  9686. request?: string;
  9687. }): string;
  9688. missingModuleStatement(__0: {
  9689. /**
  9690. * request string used originally
  9691. */
  9692. request?: string;
  9693. }): string;
  9694. missingModulePromise(__0: {
  9695. /**
  9696. * request string used originally
  9697. */
  9698. request?: string;
  9699. }): string;
  9700. weakError(__0: {
  9701. /**
  9702. * the chunk graph
  9703. */
  9704. chunkGraph: ChunkGraph;
  9705. /**
  9706. * the module
  9707. */
  9708. module: Module;
  9709. /**
  9710. * the request that should be printed as comment
  9711. */
  9712. request: string;
  9713. /**
  9714. * expression to use as id expression
  9715. */
  9716. idExpr?: string;
  9717. /**
  9718. * which kind of code should be returned
  9719. */
  9720. type: "promise" | "expression" | "statements";
  9721. }): string;
  9722. moduleId(__0: {
  9723. /**
  9724. * the module
  9725. */
  9726. module: Module;
  9727. /**
  9728. * the chunk graph
  9729. */
  9730. chunkGraph: ChunkGraph;
  9731. /**
  9732. * the request that should be printed as comment
  9733. */
  9734. request: string;
  9735. /**
  9736. * if the dependency is weak (will create a nice error message)
  9737. */
  9738. weak?: boolean;
  9739. }): string;
  9740. moduleRaw(__0: {
  9741. /**
  9742. * the module
  9743. */
  9744. module: Module;
  9745. /**
  9746. * the chunk graph
  9747. */
  9748. chunkGraph: ChunkGraph;
  9749. /**
  9750. * the request that should be printed as comment
  9751. */
  9752. request: string;
  9753. /**
  9754. * if the dependency is weak (will create a nice error message)
  9755. */
  9756. weak?: boolean;
  9757. /**
  9758. * if set, will be filled with runtime requirements
  9759. */
  9760. runtimeRequirements: Set<string>;
  9761. }): string;
  9762. moduleExports(__0: {
  9763. /**
  9764. * the module
  9765. */
  9766. module: Module;
  9767. /**
  9768. * the chunk graph
  9769. */
  9770. chunkGraph: ChunkGraph;
  9771. /**
  9772. * the request that should be printed as comment
  9773. */
  9774. request: string;
  9775. /**
  9776. * if the dependency is weak (will create a nice error message)
  9777. */
  9778. weak?: boolean;
  9779. /**
  9780. * if set, will be filled with runtime requirements
  9781. */
  9782. runtimeRequirements: Set<string>;
  9783. }): string;
  9784. moduleNamespace(__0: {
  9785. /**
  9786. * the module
  9787. */
  9788. module: Module;
  9789. /**
  9790. * the chunk graph
  9791. */
  9792. chunkGraph: ChunkGraph;
  9793. /**
  9794. * the request that should be printed as comment
  9795. */
  9796. request: string;
  9797. /**
  9798. * if the current module is in strict esm mode
  9799. */
  9800. strict?: boolean;
  9801. /**
  9802. * if the dependency is weak (will create a nice error message)
  9803. */
  9804. weak?: boolean;
  9805. /**
  9806. * if set, will be filled with runtime requirements
  9807. */
  9808. runtimeRequirements: Set<string>;
  9809. }): string;
  9810. moduleNamespacePromise(__0: {
  9811. /**
  9812. * the chunk graph
  9813. */
  9814. chunkGraph: ChunkGraph;
  9815. /**
  9816. * the current dependencies block
  9817. */
  9818. block?: AsyncDependenciesBlock;
  9819. /**
  9820. * the module
  9821. */
  9822. module: Module;
  9823. /**
  9824. * the request that should be printed as comment
  9825. */
  9826. request: string;
  9827. /**
  9828. * a message for the comment
  9829. */
  9830. message: string;
  9831. /**
  9832. * if the current module is in strict esm mode
  9833. */
  9834. strict?: boolean;
  9835. /**
  9836. * if the dependency is weak (will create a nice error message)
  9837. */
  9838. weak?: boolean;
  9839. /**
  9840. * if set, will be filled with runtime requirements
  9841. */
  9842. runtimeRequirements: Set<string>;
  9843. }): string;
  9844. runtimeConditionExpression(__0: {
  9845. /**
  9846. * the chunk graph
  9847. */
  9848. chunkGraph: ChunkGraph;
  9849. /**
  9850. * runtime for which this code will be generated
  9851. */
  9852. runtime?: RuntimeSpec;
  9853. /**
  9854. * only execute the statement in some runtimes
  9855. */
  9856. runtimeCondition?: string | boolean | SortableSet<string>;
  9857. /**
  9858. * if set, will be filled with runtime requirements
  9859. */
  9860. runtimeRequirements: Set<string>;
  9861. }): string;
  9862. importStatement(__0: {
  9863. /**
  9864. * whether a new variable should be created or the existing one updated
  9865. */
  9866. update?: boolean;
  9867. /**
  9868. * the module
  9869. */
  9870. module: Module;
  9871. /**
  9872. * the chunk graph
  9873. */
  9874. chunkGraph: ChunkGraph;
  9875. /**
  9876. * the request that should be printed as comment
  9877. */
  9878. request: string;
  9879. /**
  9880. * name of the import variable
  9881. */
  9882. importVar: string;
  9883. /**
  9884. * module in which the statement is emitted
  9885. */
  9886. originModule: Module;
  9887. /**
  9888. * true, if this is a weak dependency
  9889. */
  9890. weak?: boolean;
  9891. /**
  9892. * if set, will be filled with runtime requirements
  9893. */
  9894. runtimeRequirements: Set<string>;
  9895. }): [string, string];
  9896. exportFromImport(__0: {
  9897. /**
  9898. * the module graph
  9899. */
  9900. moduleGraph: ModuleGraph;
  9901. /**
  9902. * the module
  9903. */
  9904. module: Module;
  9905. /**
  9906. * the request
  9907. */
  9908. request: string;
  9909. /**
  9910. * the export name
  9911. */
  9912. exportName: string | string[];
  9913. /**
  9914. * the origin module
  9915. */
  9916. originModule: Module;
  9917. /**
  9918. * true, if location is safe for ASI, a bracket can be emitted
  9919. */
  9920. asiSafe?: boolean;
  9921. /**
  9922. * true, if expression will be called
  9923. */
  9924. isCall: boolean;
  9925. /**
  9926. * when false, call context will not be preserved
  9927. */
  9928. callContext: boolean;
  9929. /**
  9930. * when true and accessing the default exports, interop code will be generated
  9931. */
  9932. defaultInterop: boolean;
  9933. /**
  9934. * the identifier name of the import variable
  9935. */
  9936. importVar: string;
  9937. /**
  9938. * init fragments will be added here
  9939. */
  9940. initFragments: InitFragment<any>[];
  9941. /**
  9942. * runtime for which this code will be generated
  9943. */
  9944. runtime: RuntimeSpec;
  9945. /**
  9946. * if set, will be filled with runtime requirements
  9947. */
  9948. runtimeRequirements: Set<string>;
  9949. }): string;
  9950. blockPromise(__0: {
  9951. /**
  9952. * the async block
  9953. */
  9954. block: AsyncDependenciesBlock;
  9955. /**
  9956. * the message
  9957. */
  9958. message: string;
  9959. /**
  9960. * the chunk graph
  9961. */
  9962. chunkGraph: ChunkGraph;
  9963. /**
  9964. * if set, will be filled with runtime requirements
  9965. */
  9966. runtimeRequirements: Set<string>;
  9967. }): string;
  9968. asyncModuleFactory(__0: {
  9969. /**
  9970. * the async block
  9971. */
  9972. block: AsyncDependenciesBlock;
  9973. /**
  9974. * the chunk graph
  9975. */
  9976. chunkGraph: ChunkGraph;
  9977. /**
  9978. * if set, will be filled with runtime requirements
  9979. */
  9980. runtimeRequirements: Set<string>;
  9981. /**
  9982. * request string used originally
  9983. */
  9984. request?: string;
  9985. }): string;
  9986. syncModuleFactory(__0: {
  9987. /**
  9988. * the dependency
  9989. */
  9990. dependency: Dependency;
  9991. /**
  9992. * the chunk graph
  9993. */
  9994. chunkGraph: ChunkGraph;
  9995. /**
  9996. * if set, will be filled with runtime requirements
  9997. */
  9998. runtimeRequirements: Set<string>;
  9999. /**
  10000. * request string used originally
  10001. */
  10002. request?: string;
  10003. }): string;
  10004. defineEsModuleFlagStatement(__0: {
  10005. /**
  10006. * the name of the exports object
  10007. */
  10008. exportsArgument: string;
  10009. /**
  10010. * if set, will be filled with runtime requirements
  10011. */
  10012. runtimeRequirements: Set<string>;
  10013. }): string;
  10014. assetUrl(__0: {
  10015. /**
  10016. * the module
  10017. */
  10018. module: Module;
  10019. /**
  10020. * the public path
  10021. */
  10022. publicPath: string;
  10023. /**
  10024. * runtime
  10025. */
  10026. runtime?: RuntimeSpec;
  10027. /**
  10028. * the code generation results
  10029. */
  10030. codeGenerationResults: CodeGenerationResults;
  10031. }): string;
  10032. }
  10033. declare abstract class RuntimeValue {
  10034. fn: (arg0: {
  10035. module: NormalModule;
  10036. key: string;
  10037. readonly version?: string;
  10038. }) => CodeValuePrimitive;
  10039. options: true | RuntimeValueOptions;
  10040. get fileDependencies(): true | string[];
  10041. exec(
  10042. parser: JavascriptParser,
  10043. valueCacheVersions: Map<string, string | Set<string>>,
  10044. key: string
  10045. ): CodeValuePrimitive;
  10046. getCacheVersion(): undefined | string;
  10047. }
  10048. declare interface RuntimeValueOptions {
  10049. fileDependencies?: string[];
  10050. contextDependencies?: string[];
  10051. missingDependencies?: string[];
  10052. buildDependencies?: string[];
  10053. version?: string | (() => string);
  10054. }
  10055. declare interface ScopeInfo {
  10056. definitions: StackedMap<string, ScopeInfo | VariableInfo>;
  10057. topLevelScope: boolean | "arrow";
  10058. inShorthand: boolean;
  10059. isStrict: boolean;
  10060. isAsmJs: boolean;
  10061. inTry: boolean;
  10062. }
  10063. declare interface Selector<A, B> {
  10064. (input: A): B;
  10065. }
  10066. declare abstract class Serializer {
  10067. serializeMiddlewares: any;
  10068. deserializeMiddlewares: any;
  10069. context: any;
  10070. serialize(obj?: any, context?: any): any;
  10071. deserialize(value?: any, context?: any): any;
  10072. }
  10073. type ServerOptionsHttps<
  10074. Request extends typeof IncomingMessage = typeof IncomingMessage,
  10075. Response extends typeof ServerResponse = typeof ServerResponse
  10076. > = SecureContextOptions & TlsOptions & ServerOptionsImport<Request, Response>;
  10077. declare class SharePlugin {
  10078. constructor(options: SharePluginOptions);
  10079. /**
  10080. * Apply the plugin
  10081. */
  10082. apply(compiler: Compiler): void;
  10083. }
  10084. /**
  10085. * Options for shared modules.
  10086. */
  10087. declare interface SharePluginOptions {
  10088. /**
  10089. * Share scope name used for all shared modules (defaults to 'default').
  10090. */
  10091. shareScope?: string;
  10092. /**
  10093. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  10094. */
  10095. shared: Shared;
  10096. }
  10097. type Shared = (string | SharedObject)[] | SharedObject;
  10098. /**
  10099. * Advanced configuration for modules that should be shared in the share scope.
  10100. */
  10101. declare interface SharedConfig {
  10102. /**
  10103. * 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.
  10104. */
  10105. eager?: boolean;
  10106. /**
  10107. * 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.
  10108. */
  10109. import?: string | false;
  10110. /**
  10111. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  10112. */
  10113. packageName?: string;
  10114. /**
  10115. * Version requirement from module in share scope.
  10116. */
  10117. requiredVersion?: string | false;
  10118. /**
  10119. * Module is looked up under this key from the share scope.
  10120. */
  10121. shareKey?: string;
  10122. /**
  10123. * Share scope name.
  10124. */
  10125. shareScope?: string;
  10126. /**
  10127. * Allow only a single version of the shared module in share scope (disabled by default).
  10128. */
  10129. singleton?: boolean;
  10130. /**
  10131. * 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).
  10132. */
  10133. strictVersion?: boolean;
  10134. /**
  10135. * Version of the provided module. Will replace lower matching versions, but not higher.
  10136. */
  10137. version?: string | false;
  10138. }
  10139. /**
  10140. * 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.
  10141. */
  10142. declare interface SharedObject {
  10143. [index: string]: string | SharedConfig;
  10144. }
  10145. declare class SideEffectsFlagPlugin {
  10146. constructor(analyseSource?: boolean);
  10147. /**
  10148. * Apply the plugin
  10149. */
  10150. apply(compiler: Compiler): void;
  10151. static moduleHasSideEffects(
  10152. moduleName?: any,
  10153. flagValue?: any,
  10154. cache?: any
  10155. ): any;
  10156. }
  10157. declare class SizeOnlySource extends Source {
  10158. constructor(size: number);
  10159. }
  10160. declare abstract class Snapshot {
  10161. startTime?: number;
  10162. fileTimestamps?: Map<string, null | FileSystemInfoEntry>;
  10163. fileHashes?: Map<string, null | string>;
  10164. fileTshs?: Map<string, null | string | TimestampAndHash>;
  10165. contextTimestamps?: Map<string, null | ResolvedContextFileSystemInfoEntry>;
  10166. contextHashes?: Map<string, null | string>;
  10167. contextTshs?: Map<string, null | ResolvedContextTimestampAndHash>;
  10168. missingExistence?: Map<string, boolean>;
  10169. managedItemInfo?: Map<string, string>;
  10170. managedFiles?: Set<string>;
  10171. managedContexts?: Set<string>;
  10172. managedMissing?: Set<string>;
  10173. children?: Set<Snapshot>;
  10174. hasStartTime(): boolean;
  10175. setStartTime(value?: any): void;
  10176. setMergedStartTime(value?: any, snapshot?: any): void;
  10177. hasFileTimestamps(): boolean;
  10178. setFileTimestamps(value?: any): void;
  10179. hasFileHashes(): boolean;
  10180. setFileHashes(value?: any): void;
  10181. hasFileTshs(): boolean;
  10182. setFileTshs(value?: any): void;
  10183. hasContextTimestamps(): boolean;
  10184. setContextTimestamps(value?: any): void;
  10185. hasContextHashes(): boolean;
  10186. setContextHashes(value?: any): void;
  10187. hasContextTshs(): boolean;
  10188. setContextTshs(value?: any): void;
  10189. hasMissingExistence(): boolean;
  10190. setMissingExistence(value?: any): void;
  10191. hasManagedItemInfo(): boolean;
  10192. setManagedItemInfo(value?: any): void;
  10193. hasManagedFiles(): boolean;
  10194. setManagedFiles(value?: any): void;
  10195. hasManagedContexts(): boolean;
  10196. setManagedContexts(value?: any): void;
  10197. hasManagedMissing(): boolean;
  10198. setManagedMissing(value?: any): void;
  10199. hasChildren(): boolean;
  10200. setChildren(value?: any): void;
  10201. addChild(child?: any): void;
  10202. serialize(__0: { write: any }): void;
  10203. deserialize(__0: { read: any }): void;
  10204. getFileIterable(): Iterable<string>;
  10205. getContextIterable(): Iterable<string>;
  10206. getMissingIterable(): Iterable<string>;
  10207. }
  10208. /**
  10209. * Options affecting how file system snapshots are created and validated.
  10210. */
  10211. declare interface SnapshotOptions {
  10212. /**
  10213. * Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
  10214. */
  10215. buildDependencies?: {
  10216. /**
  10217. * Use hashes of the content of the files/directories to determine invalidation.
  10218. */
  10219. hash?: boolean;
  10220. /**
  10221. * Use timestamps of the files/directories to determine invalidation.
  10222. */
  10223. timestamp?: boolean;
  10224. };
  10225. /**
  10226. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  10227. */
  10228. immutablePaths?: (string | RegExp)[];
  10229. /**
  10230. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  10231. */
  10232. managedPaths?: (string | RegExp)[];
  10233. /**
  10234. * Options for snapshotting dependencies of modules to determine if they need to be built again.
  10235. */
  10236. module?: {
  10237. /**
  10238. * Use hashes of the content of the files/directories to determine invalidation.
  10239. */
  10240. hash?: boolean;
  10241. /**
  10242. * Use timestamps of the files/directories to determine invalidation.
  10243. */
  10244. timestamp?: boolean;
  10245. };
  10246. /**
  10247. * Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.
  10248. */
  10249. resolve?: {
  10250. /**
  10251. * Use hashes of the content of the files/directories to determine invalidation.
  10252. */
  10253. hash?: boolean;
  10254. /**
  10255. * Use timestamps of the files/directories to determine invalidation.
  10256. */
  10257. timestamp?: boolean;
  10258. };
  10259. /**
  10260. * Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.
  10261. */
  10262. resolveBuildDependencies?: {
  10263. /**
  10264. * Use hashes of the content of the files/directories to determine invalidation.
  10265. */
  10266. hash?: boolean;
  10267. /**
  10268. * Use timestamps of the files/directories to determine invalidation.
  10269. */
  10270. timestamp?: boolean;
  10271. };
  10272. }
  10273. declare abstract class SortableSet<T> extends Set<T> {
  10274. /**
  10275. * Sort with a comparer function
  10276. */
  10277. sortWith(sortFn: (arg0: T, arg1: T) => number): void;
  10278. sort(): SortableSet<T>;
  10279. /**
  10280. * Get data from cache
  10281. */
  10282. getFromCache<R>(fn: (arg0: SortableSet<T>) => R): R;
  10283. /**
  10284. * Get data from cache (ignoring sorting)
  10285. */
  10286. getFromUnorderedCache<R>(fn: (arg0: SortableSet<T>) => R): R;
  10287. toJSON(): T[];
  10288. /**
  10289. * Iterates over values in the set.
  10290. */
  10291. [Symbol.iterator](): IterableIterator<T>;
  10292. }
  10293. declare class Source {
  10294. constructor();
  10295. size(): number;
  10296. map(options?: MapOptions): null | RawSourceMap;
  10297. sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
  10298. updateHash(hash: Hash): void;
  10299. source(): string | Buffer;
  10300. buffer(): Buffer;
  10301. }
  10302. declare interface SourceLike {
  10303. source(): string | Buffer;
  10304. }
  10305. declare interface SourceMap {
  10306. version: number;
  10307. sources: string[];
  10308. mappings: string;
  10309. file?: string;
  10310. sourceRoot?: string;
  10311. sourcesContent?: string[];
  10312. names?: string[];
  10313. }
  10314. declare class SourceMapDevToolPlugin {
  10315. constructor(options?: SourceMapDevToolPluginOptions);
  10316. sourceMapFilename: string | false;
  10317. sourceMappingURLComment: string | false;
  10318. moduleFilenameTemplate: string | Function;
  10319. fallbackModuleFilenameTemplate: string | Function;
  10320. namespace: string;
  10321. options: SourceMapDevToolPluginOptions;
  10322. /**
  10323. * Apply the plugin
  10324. */
  10325. apply(compiler: Compiler): void;
  10326. }
  10327. declare interface SourceMapDevToolPluginOptions {
  10328. /**
  10329. * 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.
  10330. */
  10331. append?: null | string | false;
  10332. /**
  10333. * Indicates whether column mappings should be used (defaults to true).
  10334. */
  10335. columns?: boolean;
  10336. /**
  10337. * Exclude modules that match the given value from source map generation.
  10338. */
  10339. exclude?: string | RegExp | Rule[];
  10340. /**
  10341. * 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.
  10342. */
  10343. fallbackModuleFilenameTemplate?: string | Function;
  10344. /**
  10345. * Path prefix to which the [file] placeholder is relative to.
  10346. */
  10347. fileContext?: string;
  10348. /**
  10349. * Defines the output filename of the SourceMap (will be inlined if no value is provided).
  10350. */
  10351. filename?: null | string | false;
  10352. /**
  10353. * Include source maps for module paths that match the given value.
  10354. */
  10355. include?: string | RegExp | Rule[];
  10356. /**
  10357. * Indicates whether SourceMaps from loaders should be used (defaults to true).
  10358. */
  10359. module?: boolean;
  10360. /**
  10361. * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
  10362. */
  10363. moduleFilenameTemplate?: string | Function;
  10364. /**
  10365. * Namespace prefix to allow multiple webpack roots in the devtools.
  10366. */
  10367. namespace?: string;
  10368. /**
  10369. * Omit the 'sourceContents' array from the SourceMap.
  10370. */
  10371. noSources?: boolean;
  10372. /**
  10373. * Provide a custom public path for the SourceMapping comment.
  10374. */
  10375. publicPath?: string;
  10376. /**
  10377. * Provide a custom value for the 'sourceRoot' property in the SourceMap.
  10378. */
  10379. sourceRoot?: string;
  10380. /**
  10381. * Include source maps for modules based on their extension (defaults to .js and .css).
  10382. */
  10383. test?: string | RegExp | Rule[];
  10384. }
  10385. declare class SourceMapSource extends Source {
  10386. constructor(
  10387. source: string | Buffer,
  10388. name: string,
  10389. sourceMap: string | Object | Buffer,
  10390. originalSource?: string | Buffer,
  10391. innerSourceMap?: string | Object | Buffer,
  10392. removeOriginalSource?: boolean
  10393. );
  10394. getArgsAsBuffers(): [
  10395. Buffer,
  10396. string,
  10397. Buffer,
  10398. undefined | Buffer,
  10399. undefined | Buffer,
  10400. boolean
  10401. ];
  10402. }
  10403. declare interface SourcePosition {
  10404. line: number;
  10405. column?: number;
  10406. }
  10407. declare interface SplitChunksOptions {
  10408. chunksFilter: (chunk: Chunk) => boolean;
  10409. defaultSizeTypes: string[];
  10410. minSize: SplitChunksSizes;
  10411. minSizeReduction: SplitChunksSizes;
  10412. minRemainingSize: SplitChunksSizes;
  10413. enforceSizeThreshold: SplitChunksSizes;
  10414. maxInitialSize: SplitChunksSizes;
  10415. maxAsyncSize: SplitChunksSizes;
  10416. minChunks: number;
  10417. maxAsyncRequests: number;
  10418. maxInitialRequests: number;
  10419. hidePathInfo: boolean;
  10420. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  10421. automaticNameDelimiter: string;
  10422. getCacheGroups: (
  10423. module: Module,
  10424. context: CacheGroupsContext
  10425. ) => CacheGroupSource[];
  10426. getName: (
  10427. module?: Module,
  10428. chunks?: Chunk[],
  10429. key?: string
  10430. ) => undefined | string;
  10431. usedExports: boolean;
  10432. fallbackCacheGroup: FallbackCacheGroup;
  10433. }
  10434. declare class SplitChunksPlugin {
  10435. constructor(options?: OptimizationSplitChunksOptions);
  10436. options: SplitChunksOptions;
  10437. /**
  10438. * Apply the plugin
  10439. */
  10440. apply(compiler: Compiler): void;
  10441. }
  10442. declare interface SplitChunksSizes {
  10443. [index: string]: number;
  10444. }
  10445. declare abstract class StackedMap<K, V> {
  10446. map: Map<K, InternalCell<V>>;
  10447. stack: Map<K, InternalCell<V>>[];
  10448. set(item: K, value: V): void;
  10449. delete(item: K): void;
  10450. has(item: K): boolean;
  10451. get(item: K): Cell<V>;
  10452. asArray(): K[];
  10453. asSet(): Set<K>;
  10454. asPairArray(): [K, Cell<V>][];
  10455. asMap(): Map<K, Cell<V>>;
  10456. get size(): number;
  10457. createChild(): StackedMap<K, V>;
  10458. }
  10459. type StartupRenderContext = RenderContext & { inlined: boolean };
  10460. type Statement =
  10461. | FunctionDeclaration
  10462. | VariableDeclaration
  10463. | ClassDeclaration
  10464. | ExpressionStatement
  10465. | BlockStatement
  10466. | StaticBlock
  10467. | EmptyStatement
  10468. | DebuggerStatement
  10469. | WithStatement
  10470. | ReturnStatement
  10471. | LabeledStatement
  10472. | BreakStatement
  10473. | ContinueStatement
  10474. | IfStatement
  10475. | SwitchStatement
  10476. | ThrowStatement
  10477. | TryStatement
  10478. | WhileStatement
  10479. | DoWhileStatement
  10480. | ForStatement
  10481. | ForInStatement
  10482. | ForOfStatement;
  10483. declare class Stats {
  10484. constructor(compilation: Compilation);
  10485. compilation: Compilation;
  10486. get hash(): string;
  10487. get startTime(): any;
  10488. get endTime(): any;
  10489. hasWarnings(): boolean;
  10490. hasErrors(): boolean;
  10491. toJson(options?: string | StatsOptions): StatsCompilation;
  10492. toString(options?: any): string;
  10493. }
  10494. type StatsAsset = KnownStatsAsset & Record<string, any>;
  10495. type StatsChunk = KnownStatsChunk & Record<string, any>;
  10496. type StatsChunkGroup = KnownStatsChunkGroup & Record<string, any>;
  10497. type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
  10498. type StatsCompilation = KnownStatsCompilation & Record<string, any>;
  10499. type StatsError = KnownStatsError & Record<string, any>;
  10500. declare abstract class StatsFactory {
  10501. hooks: Readonly<{
  10502. extract: HookMap<SyncBailHook<[Object, any, StatsFactoryContext], any>>;
  10503. filter: HookMap<
  10504. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  10505. >;
  10506. sort: HookMap<
  10507. SyncBailHook<
  10508. [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
  10509. any
  10510. >
  10511. >;
  10512. filterSorted: HookMap<
  10513. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  10514. >;
  10515. groupResults: HookMap<
  10516. SyncBailHook<[GroupConfig[], StatsFactoryContext], any>
  10517. >;
  10518. sortResults: HookMap<
  10519. SyncBailHook<
  10520. [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
  10521. any
  10522. >
  10523. >;
  10524. filterResults: HookMap<
  10525. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  10526. >;
  10527. merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  10528. result: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  10529. getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  10530. getItemFactory: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  10531. }>;
  10532. create(
  10533. type: string,
  10534. data: any,
  10535. baseContext: Omit<StatsFactoryContext, "type">
  10536. ): any;
  10537. }
  10538. type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
  10539. type StatsLogging = KnownStatsLogging & Record<string, any>;
  10540. type StatsLoggingEntry = KnownStatsLoggingEntry & Record<string, any>;
  10541. type StatsModule = KnownStatsModule & Record<string, any>;
  10542. type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
  10543. type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
  10544. type StatsModuleTraceDependency = KnownStatsModuleTraceDependency &
  10545. Record<string, any>;
  10546. type StatsModuleTraceItem = KnownStatsModuleTraceItem & Record<string, any>;
  10547. /**
  10548. * Stats options object.
  10549. */
  10550. declare interface StatsOptions {
  10551. /**
  10552. * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).
  10553. */
  10554. all?: boolean;
  10555. /**
  10556. * Add assets information.
  10557. */
  10558. assets?: boolean;
  10559. /**
  10560. * Sort the assets by that field.
  10561. */
  10562. assetsSort?: string;
  10563. /**
  10564. * Space to display assets (groups will be collapsed to fit this space).
  10565. */
  10566. assetsSpace?: number;
  10567. /**
  10568. * Add built at time information.
  10569. */
  10570. builtAt?: boolean;
  10571. /**
  10572. * Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).
  10573. */
  10574. cached?: boolean;
  10575. /**
  10576. * Show cached assets (setting this to `false` only shows emitted files).
  10577. */
  10578. cachedAssets?: boolean;
  10579. /**
  10580. * Add information about cached (not built) modules.
  10581. */
  10582. cachedModules?: boolean;
  10583. /**
  10584. * Add children information.
  10585. */
  10586. children?: boolean;
  10587. /**
  10588. * Display auxiliary assets in chunk groups.
  10589. */
  10590. chunkGroupAuxiliary?: boolean;
  10591. /**
  10592. * Display children of chunk groups.
  10593. */
  10594. chunkGroupChildren?: boolean;
  10595. /**
  10596. * Limit of assets displayed in chunk groups.
  10597. */
  10598. chunkGroupMaxAssets?: number;
  10599. /**
  10600. * Display all chunk groups with the corresponding bundles.
  10601. */
  10602. chunkGroups?: boolean;
  10603. /**
  10604. * Add built modules information to chunk information.
  10605. */
  10606. chunkModules?: boolean;
  10607. /**
  10608. * Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
  10609. */
  10610. chunkModulesSpace?: number;
  10611. /**
  10612. * Add the origins of chunks and chunk merging info.
  10613. */
  10614. chunkOrigins?: boolean;
  10615. /**
  10616. * Add information about parent, children and sibling chunks to chunk information.
  10617. */
  10618. chunkRelations?: boolean;
  10619. /**
  10620. * Add chunk information.
  10621. */
  10622. chunks?: boolean;
  10623. /**
  10624. * Sort the chunks by that field.
  10625. */
  10626. chunksSort?: string;
  10627. /**
  10628. * Enables/Disables colorful output.
  10629. */
  10630. colors?:
  10631. | boolean
  10632. | {
  10633. /**
  10634. * Custom color for bold text.
  10635. */
  10636. bold?: string;
  10637. /**
  10638. * Custom color for cyan text.
  10639. */
  10640. cyan?: string;
  10641. /**
  10642. * Custom color for green text.
  10643. */
  10644. green?: string;
  10645. /**
  10646. * Custom color for magenta text.
  10647. */
  10648. magenta?: string;
  10649. /**
  10650. * Custom color for red text.
  10651. */
  10652. red?: string;
  10653. /**
  10654. * Custom color for yellow text.
  10655. */
  10656. yellow?: string;
  10657. };
  10658. /**
  10659. * Context directory for request shortening.
  10660. */
  10661. context?: string;
  10662. /**
  10663. * Show chunk modules that are dependencies of other modules of the chunk.
  10664. */
  10665. dependentModules?: boolean;
  10666. /**
  10667. * Add module depth in module graph.
  10668. */
  10669. depth?: boolean;
  10670. /**
  10671. * Display the entry points with the corresponding bundles.
  10672. */
  10673. entrypoints?: boolean | "auto";
  10674. /**
  10675. * Add --env information.
  10676. */
  10677. env?: boolean;
  10678. /**
  10679. * Add details to errors (like resolving log).
  10680. */
  10681. errorDetails?: boolean | "auto";
  10682. /**
  10683. * Add internal stack trace to errors.
  10684. */
  10685. errorStack?: boolean;
  10686. /**
  10687. * Add errors.
  10688. */
  10689. errors?: boolean;
  10690. /**
  10691. * Add errors count.
  10692. */
  10693. errorsCount?: boolean;
  10694. /**
  10695. * Space to display errors (value is in number of lines).
  10696. */
  10697. errorsSpace?: number;
  10698. /**
  10699. * Please use excludeModules instead.
  10700. */
  10701. exclude?:
  10702. | string
  10703. | boolean
  10704. | RegExp
  10705. | ModuleFilterItemTypes[]
  10706. | ((
  10707. name: string,
  10708. module: StatsModule,
  10709. type: "module" | "chunk" | "root-of-chunk" | "nested"
  10710. ) => boolean);
  10711. /**
  10712. * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
  10713. */
  10714. excludeAssets?:
  10715. | string
  10716. | RegExp
  10717. | AssetFilterItemTypes[]
  10718. | ((name: string, asset: StatsAsset) => boolean);
  10719. /**
  10720. * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
  10721. */
  10722. excludeModules?:
  10723. | string
  10724. | boolean
  10725. | RegExp
  10726. | ModuleFilterItemTypes[]
  10727. | ((
  10728. name: string,
  10729. module: StatsModule,
  10730. type: "module" | "chunk" | "root-of-chunk" | "nested"
  10731. ) => boolean);
  10732. /**
  10733. * Group assets by how their are related to chunks.
  10734. */
  10735. groupAssetsByChunk?: boolean;
  10736. /**
  10737. * Group assets by their status (emitted, compared for emit or cached).
  10738. */
  10739. groupAssetsByEmitStatus?: boolean;
  10740. /**
  10741. * Group assets by their extension.
  10742. */
  10743. groupAssetsByExtension?: boolean;
  10744. /**
  10745. * Group assets by their asset info (immutable, development, hotModuleReplacement, etc).
  10746. */
  10747. groupAssetsByInfo?: boolean;
  10748. /**
  10749. * Group assets by their path.
  10750. */
  10751. groupAssetsByPath?: boolean;
  10752. /**
  10753. * Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).
  10754. */
  10755. groupModulesByAttributes?: boolean;
  10756. /**
  10757. * Group modules by their status (cached or built and cacheable).
  10758. */
  10759. groupModulesByCacheStatus?: boolean;
  10760. /**
  10761. * Group modules by their extension.
  10762. */
  10763. groupModulesByExtension?: boolean;
  10764. /**
  10765. * Group modules by their layer.
  10766. */
  10767. groupModulesByLayer?: boolean;
  10768. /**
  10769. * Group modules by their path.
  10770. */
  10771. groupModulesByPath?: boolean;
  10772. /**
  10773. * Group modules by their type.
  10774. */
  10775. groupModulesByType?: boolean;
  10776. /**
  10777. * Group reasons by their origin module.
  10778. */
  10779. groupReasonsByOrigin?: boolean;
  10780. /**
  10781. * Add the hash of the compilation.
  10782. */
  10783. hash?: boolean;
  10784. /**
  10785. * Add ids.
  10786. */
  10787. ids?: boolean;
  10788. /**
  10789. * Add logging output.
  10790. */
  10791. logging?: boolean | "none" | "error" | "warn" | "info" | "log" | "verbose";
  10792. /**
  10793. * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
  10794. */
  10795. loggingDebug?:
  10796. | string
  10797. | boolean
  10798. | RegExp
  10799. | FilterItemTypes[]
  10800. | ((value: string) => boolean);
  10801. /**
  10802. * Add stack traces to logging output.
  10803. */
  10804. loggingTrace?: boolean;
  10805. /**
  10806. * Add information about assets inside modules.
  10807. */
  10808. moduleAssets?: boolean;
  10809. /**
  10810. * Add dependencies and origin of warnings/errors.
  10811. */
  10812. moduleTrace?: boolean;
  10813. /**
  10814. * Add built modules information.
  10815. */
  10816. modules?: boolean;
  10817. /**
  10818. * Sort the modules by that field.
  10819. */
  10820. modulesSort?: string;
  10821. /**
  10822. * Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).
  10823. */
  10824. modulesSpace?: number;
  10825. /**
  10826. * Add information about modules nested in other modules (like with module concatenation).
  10827. */
  10828. nestedModules?: boolean;
  10829. /**
  10830. * Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).
  10831. */
  10832. nestedModulesSpace?: number;
  10833. /**
  10834. * Show reasons why optimization bailed out for modules.
  10835. */
  10836. optimizationBailout?: boolean;
  10837. /**
  10838. * Add information about orphan modules.
  10839. */
  10840. orphanModules?: boolean;
  10841. /**
  10842. * Add output path information.
  10843. */
  10844. outputPath?: boolean;
  10845. /**
  10846. * Add performance hint flags.
  10847. */
  10848. performance?: boolean;
  10849. /**
  10850. * Preset for the default values.
  10851. */
  10852. preset?: string | boolean;
  10853. /**
  10854. * Show exports provided by modules.
  10855. */
  10856. providedExports?: boolean;
  10857. /**
  10858. * Add public path information.
  10859. */
  10860. publicPath?: boolean;
  10861. /**
  10862. * Add information about the reasons why modules are included.
  10863. */
  10864. reasons?: boolean;
  10865. /**
  10866. * Space to display reasons (groups will be collapsed to fit this space).
  10867. */
  10868. reasonsSpace?: number;
  10869. /**
  10870. * Add information about assets that are related to other assets (like SourceMaps for assets).
  10871. */
  10872. relatedAssets?: boolean;
  10873. /**
  10874. * Add information about runtime modules (deprecated: use 'runtimeModules' instead).
  10875. */
  10876. runtime?: boolean;
  10877. /**
  10878. * Add information about runtime modules.
  10879. */
  10880. runtimeModules?: boolean;
  10881. /**
  10882. * Add the source code of modules.
  10883. */
  10884. source?: boolean;
  10885. /**
  10886. * Add timing information.
  10887. */
  10888. timings?: boolean;
  10889. /**
  10890. * Show exports used by modules.
  10891. */
  10892. usedExports?: boolean;
  10893. /**
  10894. * Add webpack version information.
  10895. */
  10896. version?: boolean;
  10897. /**
  10898. * Add warnings.
  10899. */
  10900. warnings?: boolean;
  10901. /**
  10902. * Add warnings count.
  10903. */
  10904. warningsCount?: boolean;
  10905. /**
  10906. * Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
  10907. */
  10908. warningsFilter?:
  10909. | string
  10910. | RegExp
  10911. | WarningFilterItemTypes[]
  10912. | ((warning: StatsError, value: string) => boolean);
  10913. /**
  10914. * Space to display warnings (value is in number of lines).
  10915. */
  10916. warningsSpace?: number;
  10917. }
  10918. declare abstract class StatsPrinter {
  10919. hooks: Readonly<{
  10920. sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], true>>;
  10921. printElements: HookMap<
  10922. SyncBailHook<[PrintedElement[], StatsPrinterContext], string>
  10923. >;
  10924. sortItems: HookMap<SyncBailHook<[any[], StatsPrinterContext], true>>;
  10925. getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string>>;
  10926. printItems: HookMap<SyncBailHook<[string[], StatsPrinterContext], string>>;
  10927. print: HookMap<SyncBailHook<[{}, StatsPrinterContext], string>>;
  10928. result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
  10929. }>;
  10930. print(type: string, object: Object, baseContext?: Object): string;
  10931. }
  10932. type StatsPrinterContext = KnownStatsPrinterContext & Record<string, any>;
  10933. type StatsProfile = KnownStatsProfile & Record<string, any>;
  10934. type StatsValue =
  10935. | boolean
  10936. | StatsOptions
  10937. | "none"
  10938. | "verbose"
  10939. | "summary"
  10940. | "errors-only"
  10941. | "errors-warnings"
  10942. | "minimal"
  10943. | "normal"
  10944. | "detailed";
  10945. declare class SyncModuleIdsPlugin {
  10946. constructor(__0: {
  10947. /**
  10948. * path to file
  10949. */
  10950. path: string;
  10951. /**
  10952. * context for module names
  10953. */
  10954. context?: string;
  10955. /**
  10956. * selector for modules
  10957. */
  10958. test: (arg0: Module) => boolean;
  10959. /**
  10960. * operation mode (defaults to merge)
  10961. */
  10962. mode?: "read" | "merge" | "create" | "update";
  10963. });
  10964. /**
  10965. * Apply the plugin
  10966. */
  10967. apply(compiler: Compiler): void;
  10968. }
  10969. declare interface SyntheticDependencyLocation {
  10970. name: string;
  10971. index?: number;
  10972. }
  10973. declare const TOMBSTONE: unique symbol;
  10974. declare const TRANSITIVE: unique symbol;
  10975. declare const TRANSITIVE_ONLY: unique symbol;
  10976. declare interface TagInfo {
  10977. tag: any;
  10978. data: any;
  10979. next?: TagInfo;
  10980. }
  10981. declare class Template {
  10982. constructor();
  10983. static getFunctionContent(fn: Function): string;
  10984. static toIdentifier(str: string): string;
  10985. static toComment(str: string): string;
  10986. static toNormalComment(str: string): string;
  10987. static toPath(str: string): string;
  10988. static numberToIdentifier(n: number): string;
  10989. static numberToIdentifierContinuation(n: number): string;
  10990. static indent(s: string | string[]): string;
  10991. static prefix(s: string | string[], prefix: string): string;
  10992. static asString(str: string | string[]): string;
  10993. static getModulesArrayBounds(modules: WithId[]): false | [number, number];
  10994. static renderChunkModules(
  10995. renderContext: ChunkRenderContext,
  10996. modules: Module[],
  10997. renderModule: (arg0: Module) => Source,
  10998. prefix?: string
  10999. ): Source;
  11000. static renderRuntimeModules(
  11001. runtimeModules: RuntimeModule[],
  11002. renderContext: RenderContext & {
  11003. codeGenerationResults?: CodeGenerationResults;
  11004. }
  11005. ): Source;
  11006. static renderChunkRuntimeModules(
  11007. runtimeModules: RuntimeModule[],
  11008. renderContext: RenderContext
  11009. ): Source;
  11010. static NUMBER_OF_IDENTIFIER_START_CHARS: number;
  11011. static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
  11012. }
  11013. declare interface TimestampAndHash {
  11014. safeTime: number;
  11015. timestamp?: number;
  11016. hash: string;
  11017. }
  11018. declare class TopLevelSymbol {
  11019. constructor(name: string);
  11020. name: string;
  11021. }
  11022. /**
  11023. * Use a Trusted Types policy to create urls for chunks.
  11024. */
  11025. declare interface TrustedTypes {
  11026. /**
  11027. * The name of the Trusted Types policy created by webpack to serve bundle chunks.
  11028. */
  11029. policyName?: string;
  11030. }
  11031. declare const UNDEFINED_MARKER: unique symbol;
  11032. declare interface UpdateHashContextDependency {
  11033. chunkGraph: ChunkGraph;
  11034. runtime: RuntimeSpec;
  11035. runtimeTemplate?: RuntimeTemplate;
  11036. }
  11037. declare interface UpdateHashContextGenerator {
  11038. /**
  11039. * the module
  11040. */
  11041. module: NormalModule;
  11042. chunkGraph: ChunkGraph;
  11043. runtime: RuntimeSpec;
  11044. runtimeTemplate?: RuntimeTemplate;
  11045. }
  11046. type UsageStateType = 0 | 1 | 2 | 3 | 4;
  11047. declare interface UserResolveOptions {
  11048. /**
  11049. * A list of module alias configurations or an object which maps key to value
  11050. */
  11051. alias?: AliasOption[] | AliasOptions;
  11052. /**
  11053. * A list of module alias configurations or an object which maps key to value, applied only after modules option
  11054. */
  11055. fallback?: AliasOption[] | AliasOptions;
  11056. /**
  11057. * An object which maps extension to extension aliases
  11058. */
  11059. extensionAlias?: ExtensionAliasOptions;
  11060. /**
  11061. * A list of alias fields in description files
  11062. */
  11063. aliasFields?: (string | string[])[];
  11064. /**
  11065. * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
  11066. */
  11067. cachePredicate?: (arg0: ResolveRequest) => boolean;
  11068. /**
  11069. * Whether or not the unsafeCache should include request context as part of the cache key.
  11070. */
  11071. cacheWithContext?: boolean;
  11072. /**
  11073. * A list of description files to read from
  11074. */
  11075. descriptionFiles?: string[];
  11076. /**
  11077. * A list of exports field condition names.
  11078. */
  11079. conditionNames?: string[];
  11080. /**
  11081. * Enforce that a extension from extensions must be used
  11082. */
  11083. enforceExtension?: boolean;
  11084. /**
  11085. * A list of exports fields in description files
  11086. */
  11087. exportsFields?: (string | string[])[];
  11088. /**
  11089. * A list of imports fields in description files
  11090. */
  11091. importsFields?: (string | string[])[];
  11092. /**
  11093. * A list of extensions which should be tried for files
  11094. */
  11095. extensions?: string[];
  11096. /**
  11097. * The file system which should be used
  11098. */
  11099. fileSystem: FileSystem;
  11100. /**
  11101. * Use this cache object to unsafely cache the successful requests
  11102. */
  11103. unsafeCache?: boolean | object;
  11104. /**
  11105. * Resolve symlinks to their symlinked location
  11106. */
  11107. symlinks?: boolean;
  11108. /**
  11109. * A prepared Resolver to which the plugins are attached
  11110. */
  11111. resolver?: Resolver;
  11112. /**
  11113. * A list of directories to resolve modules from, can be absolute path or folder name
  11114. */
  11115. modules?: string | string[];
  11116. /**
  11117. * A list of main fields in description files
  11118. */
  11119. mainFields?: (
  11120. | string
  11121. | string[]
  11122. | { name: string | string[]; forceRelative: boolean }
  11123. )[];
  11124. /**
  11125. * A list of main files in directories
  11126. */
  11127. mainFiles?: string[];
  11128. /**
  11129. * A list of additional resolve plugins which should be applied
  11130. */
  11131. plugins?: Plugin[];
  11132. /**
  11133. * A PnP API that should be used - null is "never", undefined is "auto"
  11134. */
  11135. pnpApi?: null | PnpApiImpl;
  11136. /**
  11137. * A list of root paths
  11138. */
  11139. roots?: string[];
  11140. /**
  11141. * The request is already fully specified and no extensions or directories are resolved for it
  11142. */
  11143. fullySpecified?: boolean;
  11144. /**
  11145. * Resolve to a context instead of a file
  11146. */
  11147. resolveToContext?: boolean;
  11148. /**
  11149. * A list of resolve restrictions
  11150. */
  11151. restrictions?: (string | RegExp)[];
  11152. /**
  11153. * Use only the sync constraints of the file system calls
  11154. */
  11155. useSyncFileSystemCalls?: boolean;
  11156. /**
  11157. * Prefer to resolve module requests as relative requests before falling back to modules
  11158. */
  11159. preferRelative?: boolean;
  11160. /**
  11161. * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
  11162. */
  11163. preferAbsolute?: boolean;
  11164. }
  11165. declare abstract class VariableInfo {
  11166. declaredScope: ScopeInfo;
  11167. freeName: string | true;
  11168. tagInfo?: TagInfo;
  11169. }
  11170. declare interface VariableInfoInterface {
  11171. declaredScope: ScopeInfo;
  11172. freeName: string | true;
  11173. tagInfo?: TagInfo;
  11174. }
  11175. type WarningFilterItemTypes =
  11176. | string
  11177. | RegExp
  11178. | ((warning: StatsError, value: string) => boolean);
  11179. declare interface WatchFileSystem {
  11180. watch: (
  11181. files: Iterable<string>,
  11182. directories: Iterable<string>,
  11183. missing: Iterable<string>,
  11184. startTime: number,
  11185. options: WatchOptions,
  11186. callback: (
  11187. arg0: undefined | Error,
  11188. arg1: Map<string, FileSystemInfoEntry | "ignore">,
  11189. arg2: Map<string, FileSystemInfoEntry | "ignore">,
  11190. arg3: Set<string>,
  11191. arg4: Set<string>
  11192. ) => void,
  11193. callbackUndelayed: (arg0: string, arg1: number) => void
  11194. ) => Watcher;
  11195. }
  11196. declare class WatchIgnorePlugin {
  11197. constructor(options: WatchIgnorePluginOptions);
  11198. paths: (string | RegExp)[];
  11199. /**
  11200. * Apply the plugin
  11201. */
  11202. apply(compiler: Compiler): void;
  11203. }
  11204. declare interface WatchIgnorePluginOptions {
  11205. /**
  11206. * A list of RegExps or absolute paths to directories or files that should be ignored.
  11207. */
  11208. paths: (string | RegExp)[];
  11209. }
  11210. /**
  11211. * Options for the watcher.
  11212. */
  11213. declare interface WatchOptions {
  11214. /**
  11215. * Delay the rebuilt after the first change. Value is a time in ms.
  11216. */
  11217. aggregateTimeout?: number;
  11218. /**
  11219. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  11220. */
  11221. followSymlinks?: boolean;
  11222. /**
  11223. * Ignore some files from watching (glob pattern or regexp).
  11224. */
  11225. ignored?: string | RegExp | string[];
  11226. /**
  11227. * Enable polling mode for watching.
  11228. */
  11229. poll?: number | boolean;
  11230. /**
  11231. * Stop watching when stdin stream has ended.
  11232. */
  11233. stdin?: boolean;
  11234. }
  11235. declare interface Watcher {
  11236. /**
  11237. * closes the watcher and all underlying file watchers
  11238. */
  11239. close: () => void;
  11240. /**
  11241. * closes the watcher, but keeps underlying file watchers alive until the next watch call
  11242. */
  11243. pause: () => void;
  11244. /**
  11245. * get current aggregated changes that have not yet send to callback
  11246. */
  11247. getAggregatedChanges?: () => Set<string>;
  11248. /**
  11249. * get current aggregated removals that have not yet send to callback
  11250. */
  11251. getAggregatedRemovals?: () => Set<string>;
  11252. /**
  11253. * get info about files
  11254. */
  11255. getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  11256. /**
  11257. * get info about directories
  11258. */
  11259. getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  11260. /**
  11261. * get info about timestamps and changes
  11262. */
  11263. getInfo?: () => WatcherInfo;
  11264. }
  11265. declare interface WatcherInfo {
  11266. /**
  11267. * get current aggregated changes that have not yet send to callback
  11268. */
  11269. changes: Set<string>;
  11270. /**
  11271. * get current aggregated removals that have not yet send to callback
  11272. */
  11273. removals: Set<string>;
  11274. /**
  11275. * get info about files
  11276. */
  11277. fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  11278. /**
  11279. * get info about directories
  11280. */
  11281. contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  11282. }
  11283. declare abstract class Watching {
  11284. startTime: null | number;
  11285. invalid: boolean;
  11286. handler: CallbackFunction<Stats>;
  11287. callbacks: CallbackFunction<void>[];
  11288. closed: boolean;
  11289. suspended: boolean;
  11290. blocked: boolean;
  11291. watchOptions: {
  11292. /**
  11293. * Delay the rebuilt after the first change. Value is a time in ms.
  11294. */
  11295. aggregateTimeout?: number;
  11296. /**
  11297. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  11298. */
  11299. followSymlinks?: boolean;
  11300. /**
  11301. * Ignore some files from watching (glob pattern or regexp).
  11302. */
  11303. ignored?: string | RegExp | string[];
  11304. /**
  11305. * Enable polling mode for watching.
  11306. */
  11307. poll?: number | boolean;
  11308. /**
  11309. * Stop watching when stdin stream has ended.
  11310. */
  11311. stdin?: boolean;
  11312. };
  11313. compiler: Compiler;
  11314. running: boolean;
  11315. watcher?: null | Watcher;
  11316. pausedWatcher?: null | Watcher;
  11317. lastWatcherStartTime?: number;
  11318. watch(
  11319. files: Iterable<string>,
  11320. dirs: Iterable<string>,
  11321. missing: Iterable<string>
  11322. ): void;
  11323. invalidate(callback?: CallbackFunction<void>): void;
  11324. suspend(): void;
  11325. resume(): void;
  11326. close(callback: CallbackFunction<void>): void;
  11327. }
  11328. declare abstract class WeakTupleMap<T extends any[], V> {
  11329. set(...args: [T, ...V[]]): void;
  11330. has(...args: T): boolean;
  11331. get(...args: T): V;
  11332. provide(...args: [T, ...(() => V)[]]): V;
  11333. delete(...args: T): void;
  11334. clear(): void;
  11335. }
  11336. declare interface WebAssemblyRenderContext {
  11337. /**
  11338. * the chunk
  11339. */
  11340. chunk: Chunk;
  11341. /**
  11342. * the dependency templates
  11343. */
  11344. dependencyTemplates: DependencyTemplates;
  11345. /**
  11346. * the runtime template
  11347. */
  11348. runtimeTemplate: RuntimeTemplate;
  11349. /**
  11350. * the module graph
  11351. */
  11352. moduleGraph: ModuleGraph;
  11353. /**
  11354. * the chunk graph
  11355. */
  11356. chunkGraph: ChunkGraph;
  11357. /**
  11358. * results of code generation
  11359. */
  11360. codeGenerationResults: CodeGenerationResults;
  11361. }
  11362. declare class WebWorkerTemplatePlugin {
  11363. constructor();
  11364. /**
  11365. * Apply the plugin
  11366. */
  11367. apply(compiler: Compiler): void;
  11368. }
  11369. declare class WebpackError extends Error {
  11370. /**
  11371. * Creates an instance of WebpackError.
  11372. */
  11373. constructor(message?: string);
  11374. details: any;
  11375. module: Module;
  11376. loc: DependencyLocation;
  11377. hideStack: boolean;
  11378. chunk: Chunk;
  11379. file: string;
  11380. serialize(__0: { write: any }): void;
  11381. deserialize(__0: { read: any }): void;
  11382. /**
  11383. * Create .stack property on a target object
  11384. */
  11385. static captureStackTrace(
  11386. targetObject: object,
  11387. constructorOpt?: Function
  11388. ): void;
  11389. /**
  11390. * Optional override for formatting stack traces
  11391. */
  11392. static prepareStackTrace?: (
  11393. err: Error,
  11394. stackTraces: NodeJS.CallSite[]
  11395. ) => any;
  11396. static stackTraceLimit: number;
  11397. }
  11398. declare abstract class WebpackLogger {
  11399. getChildLogger: (arg0: string | (() => string)) => WebpackLogger;
  11400. error(...args: any[]): void;
  11401. warn(...args: any[]): void;
  11402. info(...args: any[]): void;
  11403. log(...args: any[]): void;
  11404. debug(...args: any[]): void;
  11405. assert(assertion: any, ...args: any[]): void;
  11406. trace(): void;
  11407. clear(): void;
  11408. status(...args: any[]): void;
  11409. group(...args: any[]): void;
  11410. groupCollapsed(...args: any[]): void;
  11411. groupEnd(...args: any[]): void;
  11412. profile(label?: any): void;
  11413. profileEnd(label?: any): void;
  11414. time(label?: any): void;
  11415. timeLog(label?: any): void;
  11416. timeEnd(label?: any): void;
  11417. timeAggregate(label?: any): void;
  11418. timeAggregateEnd(label?: any): void;
  11419. }
  11420. declare class WebpackOptionsApply extends OptionsApply {
  11421. constructor();
  11422. }
  11423. declare class WebpackOptionsDefaulter {
  11424. constructor();
  11425. process(options?: any): any;
  11426. }
  11427. /**
  11428. * Normalized webpack options object.
  11429. */
  11430. declare interface WebpackOptionsNormalized {
  11431. /**
  11432. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  11433. */
  11434. amd?: false | { [index: string]: any };
  11435. /**
  11436. * Report the first error as a hard error instead of tolerating it.
  11437. */
  11438. bail?: boolean;
  11439. /**
  11440. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  11441. */
  11442. cache: CacheOptionsNormalized;
  11443. /**
  11444. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  11445. */
  11446. context?: string;
  11447. /**
  11448. * References to other configurations to depend on.
  11449. */
  11450. dependencies?: string[];
  11451. /**
  11452. * Options for the webpack-dev-server.
  11453. */
  11454. devServer?: DevServer;
  11455. /**
  11456. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  11457. */
  11458. devtool?: string | false;
  11459. /**
  11460. * The entry point(s) of the compilation.
  11461. */
  11462. entry: EntryNormalized;
  11463. /**
  11464. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  11465. */
  11466. experiments: ExperimentsNormalized;
  11467. /**
  11468. * 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`.
  11469. */
  11470. externals: Externals;
  11471. /**
  11472. * Enable presets of externals for specific targets.
  11473. */
  11474. externalsPresets: ExternalsPresets;
  11475. /**
  11476. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  11477. */
  11478. externalsType?:
  11479. | "import"
  11480. | "var"
  11481. | "module"
  11482. | "assign"
  11483. | "this"
  11484. | "window"
  11485. | "self"
  11486. | "global"
  11487. | "commonjs"
  11488. | "commonjs2"
  11489. | "commonjs-module"
  11490. | "commonjs-static"
  11491. | "amd"
  11492. | "amd-require"
  11493. | "umd"
  11494. | "umd2"
  11495. | "jsonp"
  11496. | "system"
  11497. | "promise"
  11498. | "script"
  11499. | "node-commonjs";
  11500. /**
  11501. * Ignore specific warnings.
  11502. */
  11503. ignoreWarnings?: ((
  11504. warning: WebpackError,
  11505. compilation: Compilation
  11506. ) => boolean)[];
  11507. /**
  11508. * Options for infrastructure level logging.
  11509. */
  11510. infrastructureLogging: InfrastructureLogging;
  11511. /**
  11512. * Custom values available in the loader context.
  11513. */
  11514. loader?: Loader;
  11515. /**
  11516. * Enable production optimizations or development hints.
  11517. */
  11518. mode?: "none" | "development" | "production";
  11519. /**
  11520. * Options affecting the normal modules (`NormalModuleFactory`).
  11521. */
  11522. module: ModuleOptionsNormalized;
  11523. /**
  11524. * Name of the configuration. Used when loading multiple configurations.
  11525. */
  11526. name?: string;
  11527. /**
  11528. * Include polyfills or mocks for various node stuff.
  11529. */
  11530. node: NodeWebpackOptions;
  11531. /**
  11532. * Enables/Disables integrated optimizations.
  11533. */
  11534. optimization: Optimization;
  11535. /**
  11536. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  11537. */
  11538. output: OutputNormalized;
  11539. /**
  11540. * The number of parallel processed modules in the compilation.
  11541. */
  11542. parallelism?: number;
  11543. /**
  11544. * Configuration for web performance recommendations.
  11545. */
  11546. performance?: false | PerformanceOptions;
  11547. /**
  11548. * Add additional plugins to the compiler.
  11549. */
  11550. plugins: (
  11551. | ((this: Compiler, compiler: Compiler) => void)
  11552. | WebpackPluginInstance
  11553. )[];
  11554. /**
  11555. * Capture timing information for each module.
  11556. */
  11557. profile?: boolean;
  11558. /**
  11559. * Store compiler state to a json file.
  11560. */
  11561. recordsInputPath?: string | false;
  11562. /**
  11563. * Load compiler state from a json file.
  11564. */
  11565. recordsOutputPath?: string | false;
  11566. /**
  11567. * Options for the resolver.
  11568. */
  11569. resolve: ResolveOptionsWebpackOptions;
  11570. /**
  11571. * Options for the resolver when resolving loaders.
  11572. */
  11573. resolveLoader: ResolveOptionsWebpackOptions;
  11574. /**
  11575. * Options affecting how file system snapshots are created and validated.
  11576. */
  11577. snapshot: SnapshotOptions;
  11578. /**
  11579. * Stats options object or preset name.
  11580. */
  11581. stats: StatsValue;
  11582. /**
  11583. * Environment to build for. An array of environments to build for all of them when possible.
  11584. */
  11585. target?: string | false | string[];
  11586. /**
  11587. * Enter watch mode, which rebuilds on file change.
  11588. */
  11589. watch?: boolean;
  11590. /**
  11591. * Options for the watcher.
  11592. */
  11593. watchOptions: WatchOptions;
  11594. }
  11595. /**
  11596. * Plugin instance.
  11597. */
  11598. declare interface WebpackPluginInstance {
  11599. [index: string]: any;
  11600. /**
  11601. * The run point of the plugin, required method.
  11602. */
  11603. apply: (compiler: Compiler) => void;
  11604. }
  11605. declare interface WithId {
  11606. id: string | number;
  11607. }
  11608. declare interface WithOptions {
  11609. /**
  11610. * create a resolver with additional/different options
  11611. */
  11612. withOptions: (
  11613. arg0: Partial<ResolveOptionsWithDependencyType>
  11614. ) => ResolverWithOptions;
  11615. }
  11616. declare interface WriteOnlySet<T> {
  11617. add: (T?: any) => void;
  11618. }
  11619. type __TypeWebpackOptions = (data: object) =>
  11620. | string
  11621. | {
  11622. /**
  11623. * Unique loader options identifier.
  11624. */
  11625. ident?: string;
  11626. /**
  11627. * Loader name.
  11628. */
  11629. loader?: string;
  11630. /**
  11631. * Loader options.
  11632. */
  11633. options?: string | { [index: string]: any };
  11634. }
  11635. | __TypeWebpackOptions
  11636. | RuleSetUseItem[];
  11637. declare function exports(
  11638. options: Configuration,
  11639. callback?: CallbackWebpack<Stats>
  11640. ): Compiler;
  11641. declare function exports(
  11642. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  11643. callback?: CallbackWebpack<MultiStats>
  11644. ): MultiCompiler;
  11645. declare namespace exports {
  11646. export const webpack: {
  11647. (options: Configuration, callback?: CallbackWebpack<Stats>): Compiler;
  11648. (
  11649. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  11650. callback?: CallbackWebpack<MultiStats>
  11651. ): MultiCompiler;
  11652. };
  11653. export const validate: (options?: any) => void;
  11654. export const validateSchema: (
  11655. schema: Parameters<typeof validateFunction>[0],
  11656. options: Parameters<typeof validateFunction>[1],
  11657. validationConfiguration?: ValidationErrorConfiguration
  11658. ) => void;
  11659. export const version: string;
  11660. export namespace cli {
  11661. export let getArguments: (schema?: any) => Record<string, Argument>;
  11662. export let processArguments: (
  11663. args: Record<string, Argument>,
  11664. config: any,
  11665. values: Record<
  11666. string,
  11667. | string
  11668. | number
  11669. | boolean
  11670. | RegExp
  11671. | (string | number | boolean | RegExp)[]
  11672. >
  11673. ) => null | Problem[];
  11674. }
  11675. export namespace ModuleFilenameHelpers {
  11676. export let ALL_LOADERS_RESOURCE: string;
  11677. export let REGEXP_ALL_LOADERS_RESOURCE: RegExp;
  11678. export let LOADERS_RESOURCE: string;
  11679. export let REGEXP_LOADERS_RESOURCE: RegExp;
  11680. export let RESOURCE: string;
  11681. export let REGEXP_RESOURCE: RegExp;
  11682. export let ABSOLUTE_RESOURCE_PATH: string;
  11683. export let REGEXP_ABSOLUTE_RESOURCE_PATH: RegExp;
  11684. export let RESOURCE_PATH: string;
  11685. export let REGEXP_RESOURCE_PATH: RegExp;
  11686. export let ALL_LOADERS: string;
  11687. export let REGEXP_ALL_LOADERS: RegExp;
  11688. export let LOADERS: string;
  11689. export let REGEXP_LOADERS: RegExp;
  11690. export let QUERY: string;
  11691. export let REGEXP_QUERY: RegExp;
  11692. export let ID: string;
  11693. export let REGEXP_ID: RegExp;
  11694. export let HASH: string;
  11695. export let REGEXP_HASH: RegExp;
  11696. export let NAMESPACE: string;
  11697. export let REGEXP_NAMESPACE: RegExp;
  11698. export let createFilename: (
  11699. module: string | Module,
  11700. options: any,
  11701. __2: {
  11702. /**
  11703. * requestShortener
  11704. */
  11705. requestShortener: RequestShortener;
  11706. /**
  11707. * chunk graph
  11708. */
  11709. chunkGraph: ChunkGraph;
  11710. /**
  11711. * the hash function to use
  11712. */
  11713. hashFunction: string | typeof Hash;
  11714. }
  11715. ) => string;
  11716. export let replaceDuplicates: (
  11717. array?: any,
  11718. fn?: any,
  11719. comparator?: any
  11720. ) => any;
  11721. export let matchPart: (str?: any, test?: any) => any;
  11722. export let matchObject: (obj?: any, str?: any) => boolean;
  11723. }
  11724. export namespace RuntimeGlobals {
  11725. export let require: "__webpack_require__";
  11726. export let requireScope: "__webpack_require__.*";
  11727. export let exports: "__webpack_exports__";
  11728. export let thisAsExports: "top-level-this-exports";
  11729. export let returnExportsFromRuntime: "return-exports-from-runtime";
  11730. export let module: "module";
  11731. export let moduleId: "module.id";
  11732. export let moduleLoaded: "module.loaded";
  11733. export let publicPath: "__webpack_require__.p";
  11734. export let entryModuleId: "__webpack_require__.s";
  11735. export let moduleCache: "__webpack_require__.c";
  11736. export let moduleFactories: "__webpack_require__.m";
  11737. export let moduleFactoriesAddOnly: "__webpack_require__.m (add only)";
  11738. export let ensureChunk: "__webpack_require__.e";
  11739. export let ensureChunkHandlers: "__webpack_require__.f";
  11740. export let ensureChunkIncludeEntries: "__webpack_require__.f (include entries)";
  11741. export let prefetchChunk: "__webpack_require__.E";
  11742. export let prefetchChunkHandlers: "__webpack_require__.F";
  11743. export let preloadChunk: "__webpack_require__.G";
  11744. export let preloadChunkHandlers: "__webpack_require__.H";
  11745. export let definePropertyGetters: "__webpack_require__.d";
  11746. export let makeNamespaceObject: "__webpack_require__.r";
  11747. export let createFakeNamespaceObject: "__webpack_require__.t";
  11748. export let compatGetDefaultExport: "__webpack_require__.n";
  11749. export let harmonyModuleDecorator: "__webpack_require__.hmd";
  11750. export let nodeModuleDecorator: "__webpack_require__.nmd";
  11751. export let getFullHash: "__webpack_require__.h";
  11752. export let wasmInstances: "__webpack_require__.w";
  11753. export let instantiateWasm: "__webpack_require__.v";
  11754. export let uncaughtErrorHandler: "__webpack_require__.oe";
  11755. export let scriptNonce: "__webpack_require__.nc";
  11756. export let loadScript: "__webpack_require__.l";
  11757. export let createScript: "__webpack_require__.ts";
  11758. export let createScriptUrl: "__webpack_require__.tu";
  11759. export let getTrustedTypesPolicy: "__webpack_require__.tt";
  11760. export let chunkName: "__webpack_require__.cn";
  11761. export let runtimeId: "__webpack_require__.j";
  11762. export let getChunkScriptFilename: "__webpack_require__.u";
  11763. export let getChunkCssFilename: "__webpack_require__.k";
  11764. export let hasCssModules: "has css modules";
  11765. export let getChunkUpdateScriptFilename: "__webpack_require__.hu";
  11766. export let getChunkUpdateCssFilename: "__webpack_require__.hk";
  11767. export let startup: "__webpack_require__.x";
  11768. export let startupNoDefault: "__webpack_require__.x (no default handler)";
  11769. export let startupOnlyAfter: "__webpack_require__.x (only after)";
  11770. export let startupOnlyBefore: "__webpack_require__.x (only before)";
  11771. export let chunkCallback: "webpackChunk";
  11772. export let startupEntrypoint: "__webpack_require__.X";
  11773. export let onChunksLoaded: "__webpack_require__.O";
  11774. export let externalInstallChunk: "__webpack_require__.C";
  11775. export let interceptModuleExecution: "__webpack_require__.i";
  11776. export let global: "__webpack_require__.g";
  11777. export let shareScopeMap: "__webpack_require__.S";
  11778. export let initializeSharing: "__webpack_require__.I";
  11779. export let currentRemoteGetScope: "__webpack_require__.R";
  11780. export let getUpdateManifestFilename: "__webpack_require__.hmrF";
  11781. export let hmrDownloadManifest: "__webpack_require__.hmrM";
  11782. export let hmrDownloadUpdateHandlers: "__webpack_require__.hmrC";
  11783. export let hmrModuleData: "__webpack_require__.hmrD";
  11784. export let hmrInvalidateModuleHandlers: "__webpack_require__.hmrI";
  11785. export let hmrRuntimeStatePrefix: "__webpack_require__.hmrS";
  11786. export let amdDefine: "__webpack_require__.amdD";
  11787. export let amdOptions: "__webpack_require__.amdO";
  11788. export let system: "__webpack_require__.System";
  11789. export let hasOwnProperty: "__webpack_require__.o";
  11790. export let systemContext: "__webpack_require__.y";
  11791. export let baseURI: "__webpack_require__.b";
  11792. export let relativeUrl: "__webpack_require__.U";
  11793. export let asyncModule: "__webpack_require__.a";
  11794. }
  11795. export const UsageState: Readonly<{
  11796. Unused: 0;
  11797. OnlyPropertiesUsed: 1;
  11798. NoInfo: 2;
  11799. Unknown: 3;
  11800. Used: 4;
  11801. }>;
  11802. export namespace cache {
  11803. export { MemoryCachePlugin };
  11804. }
  11805. export namespace config {
  11806. export const getNormalizedWebpackOptions: (
  11807. config: Configuration
  11808. ) => WebpackOptionsNormalized;
  11809. export const applyWebpackOptionsDefaults: (
  11810. options: WebpackOptionsNormalized
  11811. ) => void;
  11812. }
  11813. export namespace dependencies {
  11814. export {
  11815. ModuleDependency,
  11816. HarmonyImportDependency,
  11817. ConstDependency,
  11818. NullDependency
  11819. };
  11820. }
  11821. export namespace ids {
  11822. export {
  11823. ChunkModuleIdRangePlugin,
  11824. NaturalModuleIdsPlugin,
  11825. OccurrenceModuleIdsPlugin,
  11826. NamedModuleIdsPlugin,
  11827. DeterministicChunkIdsPlugin,
  11828. DeterministicModuleIdsPlugin,
  11829. NamedChunkIdsPlugin,
  11830. OccurrenceChunkIdsPlugin,
  11831. HashedModuleIdsPlugin
  11832. };
  11833. }
  11834. export namespace javascript {
  11835. export {
  11836. EnableChunkLoadingPlugin,
  11837. JavascriptModulesPlugin,
  11838. JavascriptParser
  11839. };
  11840. }
  11841. export namespace optimize {
  11842. export namespace InnerGraph {
  11843. export let bailout: (parserState: ParserState) => void;
  11844. export let enable: (parserState: ParserState) => void;
  11845. export let isEnabled: (parserState: ParserState) => boolean;
  11846. export let addUsage: (
  11847. state: ParserState,
  11848. symbol: null | TopLevelSymbol,
  11849. usage: string | true | TopLevelSymbol
  11850. ) => void;
  11851. export let addVariableUsage: (
  11852. parser: JavascriptParser,
  11853. name: string,
  11854. usage: string | true | TopLevelSymbol
  11855. ) => void;
  11856. export let inferDependencyUsage: (state: ParserState) => void;
  11857. export let onUsage: (
  11858. state: ParserState,
  11859. onUsageCallback: (arg0?: boolean | Set<string>) => void
  11860. ) => void;
  11861. export let setTopLevelSymbol: (
  11862. state: ParserState,
  11863. symbol: TopLevelSymbol
  11864. ) => void;
  11865. export let getTopLevelSymbol: (
  11866. state: ParserState
  11867. ) => void | TopLevelSymbol;
  11868. export let tagTopLevelSymbol: (
  11869. parser: JavascriptParser,
  11870. name: string
  11871. ) => TopLevelSymbol;
  11872. export let isDependencyUsedByExports: (
  11873. dependency: Dependency,
  11874. usedByExports: boolean | Set<string>,
  11875. moduleGraph: ModuleGraph,
  11876. runtime: RuntimeSpec
  11877. ) => boolean;
  11878. export let getDependencyUsedByExportsCondition: (
  11879. dependency: Dependency,
  11880. usedByExports: boolean | Set<string>,
  11881. moduleGraph: ModuleGraph
  11882. ) =>
  11883. | null
  11884. | false
  11885. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
  11886. export { TopLevelSymbol, topLevelSymbolTag };
  11887. }
  11888. export {
  11889. AggressiveMergingPlugin,
  11890. AggressiveSplittingPlugin,
  11891. LimitChunkCountPlugin,
  11892. MinChunkSizePlugin,
  11893. ModuleConcatenationPlugin,
  11894. RealContentHashPlugin,
  11895. RuntimeChunkPlugin,
  11896. SideEffectsFlagPlugin,
  11897. SplitChunksPlugin
  11898. };
  11899. }
  11900. export namespace runtime {
  11901. export { GetChunkFilenameRuntimeModule, LoadScriptRuntimeModule };
  11902. }
  11903. export namespace prefetch {
  11904. export { ChunkPrefetchPreloadPlugin };
  11905. }
  11906. export namespace web {
  11907. export {
  11908. FetchCompileAsyncWasmPlugin,
  11909. FetchCompileWasmPlugin,
  11910. JsonpChunkLoadingRuntimeModule,
  11911. JsonpTemplatePlugin
  11912. };
  11913. }
  11914. export namespace webworker {
  11915. export { WebWorkerTemplatePlugin };
  11916. }
  11917. export namespace node {
  11918. export {
  11919. NodeEnvironmentPlugin,
  11920. NodeSourcePlugin,
  11921. NodeTargetPlugin,
  11922. NodeTemplatePlugin,
  11923. ReadFileCompileWasmPlugin
  11924. };
  11925. }
  11926. export namespace electron {
  11927. export { ElectronTargetPlugin };
  11928. }
  11929. export namespace wasm {
  11930. export { AsyncWebAssemblyModulesPlugin, EnableWasmLoadingPlugin };
  11931. }
  11932. export namespace library {
  11933. export { AbstractLibraryPlugin, EnableLibraryPlugin };
  11934. }
  11935. export namespace container {
  11936. export const scope: <T>(
  11937. scope: string,
  11938. options: ContainerOptionsFormat<T>
  11939. ) => Record<string, string | string[] | T>;
  11940. export {
  11941. ContainerPlugin,
  11942. ContainerReferencePlugin,
  11943. ModuleFederationPlugin
  11944. };
  11945. }
  11946. export namespace sharing {
  11947. export const scope: <T>(
  11948. scope: string,
  11949. options: ContainerOptionsFormat<T>
  11950. ) => Record<string, string | string[] | T>;
  11951. export { ConsumeSharedPlugin, ProvideSharedPlugin, SharePlugin };
  11952. }
  11953. export namespace debug {
  11954. export { ProfilingPlugin };
  11955. }
  11956. export namespace util {
  11957. export const createHash: (algorithm: string | typeof Hash) => Hash;
  11958. export namespace comparators {
  11959. export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
  11960. export let compareModulesByIdentifier: (
  11961. a: Module,
  11962. b: Module
  11963. ) => 0 | 1 | -1;
  11964. export let compareModulesById: ParameterizedComparator<
  11965. ChunkGraph,
  11966. Module
  11967. >;
  11968. export let compareNumbers: (a: number, b: number) => 0 | 1 | -1;
  11969. export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1;
  11970. export let compareModulesByPostOrderIndexOrIdentifier: ParameterizedComparator<
  11971. ModuleGraph,
  11972. Module
  11973. >;
  11974. export let compareModulesByPreOrderIndexOrIdentifier: ParameterizedComparator<
  11975. ModuleGraph,
  11976. Module
  11977. >;
  11978. export let compareModulesByIdOrIdentifier: ParameterizedComparator<
  11979. ChunkGraph,
  11980. Module
  11981. >;
  11982. export let compareChunks: ParameterizedComparator<ChunkGraph, Chunk>;
  11983. export let compareIds: (
  11984. a: string | number,
  11985. b: string | number
  11986. ) => 0 | 1 | -1;
  11987. export let compareStrings: (a: string, b: string) => 0 | 1 | -1;
  11988. export let compareChunkGroupsByIndex: (
  11989. a: ChunkGroup,
  11990. b: ChunkGroup
  11991. ) => 0 | 1 | -1;
  11992. export let concatComparators: <T>(
  11993. c1: Comparator<T>,
  11994. c2: Comparator<T>,
  11995. ...cRest: Comparator<T>[]
  11996. ) => Comparator<T>;
  11997. export let compareSelect: <T, R>(
  11998. getter: Selector<T, R>,
  11999. comparator: Comparator<R>
  12000. ) => Comparator<T>;
  12001. export let compareIterables: <T>(
  12002. elementComparator: Comparator<T>
  12003. ) => Comparator<Iterable<T>>;
  12004. export let keepOriginalOrder: <T>(iterable: Iterable<T>) => Comparator<T>;
  12005. export let compareChunksNatural: (
  12006. chunkGraph: ChunkGraph
  12007. ) => Comparator<Chunk>;
  12008. export let compareLocations: (
  12009. a: DependencyLocation,
  12010. b: DependencyLocation
  12011. ) => 0 | 1 | -1;
  12012. }
  12013. export namespace runtime {
  12014. export let getEntryRuntime: (
  12015. compilation: Compilation,
  12016. name: string,
  12017. options?: EntryOptions
  12018. ) => RuntimeSpec;
  12019. export let forEachRuntime: (
  12020. runtime: RuntimeSpec,
  12021. fn: (arg0: string) => void,
  12022. deterministicOrder?: boolean
  12023. ) => void;
  12024. export let getRuntimeKey: (runtime: RuntimeSpec) => string;
  12025. export let keyToRuntime: (key: string) => RuntimeSpec;
  12026. export let runtimeToString: (runtime: RuntimeSpec) => string;
  12027. export let runtimeConditionToString: (
  12028. runtimeCondition: RuntimeCondition
  12029. ) => string;
  12030. export let runtimeEqual: (a: RuntimeSpec, b: RuntimeSpec) => boolean;
  12031. export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
  12032. export let mergeRuntime: (a: RuntimeSpec, b: RuntimeSpec) => RuntimeSpec;
  12033. export let mergeRuntimeCondition: (
  12034. a: RuntimeCondition,
  12035. b: RuntimeCondition,
  12036. runtime: RuntimeSpec
  12037. ) => RuntimeCondition;
  12038. export let mergeRuntimeConditionNonFalse: (
  12039. a: undefined | string | true | SortableSet<string>,
  12040. b: undefined | string | true | SortableSet<string>,
  12041. runtime: RuntimeSpec
  12042. ) => undefined | string | true | SortableSet<string>;
  12043. export let mergeRuntimeOwned: (
  12044. a: RuntimeSpec,
  12045. b: RuntimeSpec
  12046. ) => RuntimeSpec;
  12047. export let intersectRuntime: (
  12048. a: RuntimeSpec,
  12049. b: RuntimeSpec
  12050. ) => RuntimeSpec;
  12051. export let subtractRuntime: (
  12052. a: RuntimeSpec,
  12053. b: RuntimeSpec
  12054. ) => RuntimeSpec;
  12055. export let subtractRuntimeCondition: (
  12056. a: RuntimeCondition,
  12057. b: RuntimeCondition,
  12058. runtime: RuntimeSpec
  12059. ) => RuntimeCondition;
  12060. export let filterRuntime: (
  12061. runtime: RuntimeSpec,
  12062. filter: (arg0: RuntimeSpec) => boolean
  12063. ) => undefined | string | boolean | SortableSet<string>;
  12064. export { RuntimeSpecMap, RuntimeSpecSet };
  12065. }
  12066. export namespace serialization {
  12067. export const register: (
  12068. Constructor: Constructor,
  12069. request: string,
  12070. name: string,
  12071. serializer: ObjectSerializer
  12072. ) => void;
  12073. export const registerLoader: (
  12074. regExp: RegExp,
  12075. loader: (arg0: string) => boolean
  12076. ) => void;
  12077. export const registerNotSerializable: (Constructor: Constructor) => void;
  12078. export const NOT_SERIALIZABLE: object;
  12079. export const buffersSerializer: Serializer;
  12080. export let createFileSerializer: (
  12081. fs?: any,
  12082. hashFunction?: any
  12083. ) => Serializer;
  12084. export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
  12085. }
  12086. export const cleverMerge: <T, O>(first: T, second: O) => T | O | (T & O);
  12087. export { LazySet };
  12088. }
  12089. export namespace sources {
  12090. export {
  12091. Source,
  12092. RawSource,
  12093. OriginalSource,
  12094. ReplaceSource,
  12095. SourceMapSource,
  12096. ConcatSource,
  12097. PrefixSource,
  12098. CachedSource,
  12099. SizeOnlySource,
  12100. CompatSource
  12101. };
  12102. }
  12103. export namespace experiments {
  12104. export namespace schemes {
  12105. export { HttpUriPlugin };
  12106. }
  12107. export namespace ids {
  12108. export { SyncModuleIdsPlugin };
  12109. }
  12110. }
  12111. export type WebpackPluginFunction = (
  12112. this: Compiler,
  12113. compiler: Compiler
  12114. ) => void;
  12115. export {
  12116. AutomaticPrefetchPlugin,
  12117. AsyncDependenciesBlock,
  12118. BannerPlugin,
  12119. Cache,
  12120. Chunk,
  12121. ChunkGraph,
  12122. CleanPlugin,
  12123. Compilation,
  12124. Compiler,
  12125. ConcatenationScope,
  12126. ContextExclusionPlugin,
  12127. ContextReplacementPlugin,
  12128. DefinePlugin,
  12129. DelegatedPlugin,
  12130. Dependency,
  12131. DllPlugin,
  12132. DllReferencePlugin,
  12133. DynamicEntryPlugin,
  12134. EntryOptionPlugin,
  12135. EntryPlugin,
  12136. EnvironmentPlugin,
  12137. EvalDevToolModulePlugin,
  12138. EvalSourceMapDevToolPlugin,
  12139. ExternalModule,
  12140. ExternalsPlugin,
  12141. Generator,
  12142. HotUpdateChunk,
  12143. HotModuleReplacementPlugin,
  12144. IgnorePlugin,
  12145. JavascriptModulesPlugin,
  12146. LibManifestPlugin,
  12147. LibraryTemplatePlugin,
  12148. LoaderOptionsPlugin,
  12149. LoaderTargetPlugin,
  12150. Module,
  12151. ModuleGraph,
  12152. ModuleGraphConnection,
  12153. NoEmitOnErrorsPlugin,
  12154. NormalModule,
  12155. NormalModuleReplacementPlugin,
  12156. MultiCompiler,
  12157. Parser,
  12158. PrefetchPlugin,
  12159. ProgressPlugin,
  12160. ProvidePlugin,
  12161. RuntimeModule,
  12162. EntryPlugin as SingleEntryPlugin,
  12163. SourceMapDevToolPlugin,
  12164. Stats,
  12165. Template,
  12166. WatchIgnorePlugin,
  12167. WebpackError,
  12168. WebpackOptionsApply,
  12169. WebpackOptionsDefaulter,
  12170. ValidationError as WebpackOptionsValidationError,
  12171. ValidationError,
  12172. Entry,
  12173. EntryNormalized,
  12174. EntryObject,
  12175. ExternalItemFunctionData,
  12176. ExternalItemObjectKnown,
  12177. ExternalItemObjectUnknown,
  12178. ExternalItemValue,
  12179. Externals,
  12180. FileCacheOptions,
  12181. LibraryOptions,
  12182. ModuleOptions,
  12183. ResolveOptionsWebpackOptions as ResolveOptions,
  12184. RuleSetCondition,
  12185. RuleSetConditionAbsolute,
  12186. RuleSetRule,
  12187. RuleSetUse,
  12188. RuleSetUseItem,
  12189. StatsOptions,
  12190. Configuration,
  12191. WebpackOptionsNormalized,
  12192. WebpackPluginInstance,
  12193. Asset,
  12194. AssetInfo,
  12195. EntryOptions,
  12196. PathData,
  12197. AssetEmittedInfo,
  12198. MultiStats,
  12199. ParserState,
  12200. ResolvePluginInstance,
  12201. Resolver,
  12202. Watching,
  12203. Argument,
  12204. Problem,
  12205. StatsAsset,
  12206. StatsChunk,
  12207. StatsChunkGroup,
  12208. StatsChunkOrigin,
  12209. StatsCompilation,
  12210. StatsError,
  12211. StatsLogging,
  12212. StatsLoggingEntry,
  12213. StatsModule,
  12214. StatsModuleIssuer,
  12215. StatsModuleReason,
  12216. StatsModuleTraceDependency,
  12217. StatsModuleTraceItem,
  12218. StatsProfile,
  12219. LoaderModule,
  12220. RawLoaderDefinition,
  12221. LoaderDefinition,
  12222. LoaderDefinitionFunction,
  12223. PitchLoaderDefinitionFunction,
  12224. RawLoaderDefinitionFunction,
  12225. LoaderContext
  12226. };
  12227. }
  12228. declare const topLevelSymbolTag: unique symbol;
  12229. export = exports;