index.d.ts 685 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599
  1. /**
  2. * @license Angular v19.2.4
  3. * (c) 2010-2025 Google LLC. https://angular.io/
  4. * License: MIT
  5. */
  6. import { S as SIGNAL, a as SignalNode, R as ReactiveNode, V as ValueEqualityFn$1 } from './weak_ref.d-Bp6cSy-X.js';
  7. export { A as ɵsetAlternateWeakRefImpl } from './weak_ref.d-Bp6cSy-X.js';
  8. import { Observable, Subject, Subscription, BehaviorSubject, Subscribable } from 'rxjs';
  9. import { f as EventContract } from './event_dispatcher.d-pVP0-wST.js';
  10. import * as _angular_core from '@angular/core';
  11. export { e as ɵNavigateEvent, N as ɵNavigation, f as ɵNavigationCurrentEntryChangeEvent, l as ɵNavigationDestination, a as ɵNavigationHistoryEntry, k as ɵNavigationInterceptOptions, b as ɵNavigationNavigateOptions, d as ɵNavigationOptions, i as ɵNavigationReloadOptions, c as ɵNavigationResult, g as ɵNavigationTransition, j as ɵNavigationTypeString, h as ɵNavigationUpdateCurrentEntryOptions } from './navigation_types.d-DgDrF5rp.js';
  12. export { setCurrentInjector as ɵsetCurrentInjector } from './primitives/di/index.js';
  13. /**
  14. * A reactive value which notifies consumers of any changes.
  15. *
  16. * Signals are functions which returns their current value. To access the current value of a signal,
  17. * call it.
  18. *
  19. * Ordinary values can be turned into `Signal`s with the `signal` function.
  20. */
  21. type Signal<T> = (() => T) & {
  22. [SIGNAL]: unknown;
  23. };
  24. /**
  25. * Checks if the given `value` is a reactive `Signal`.
  26. */
  27. declare function isSignal(value: unknown): value is Signal<unknown>;
  28. /**
  29. * A comparison function which can determine if two values are equal.
  30. */
  31. type ValueEqualityFn<T> = (a: T, b: T) => boolean;
  32. /**
  33. * Reactive node type for an input signal. An input signal extends a signal.
  34. * There are special properties to enable transforms and required inputs.
  35. */
  36. interface InputSignalNode<T, TransformT> extends SignalNode<T> {
  37. /**
  38. * User-configured transform that will run whenever a new value is applied
  39. * to the input signal node.
  40. */
  41. transformFn: ((value: TransformT) => T) | undefined;
  42. /**
  43. * Applies a new value to the input signal. Expects transforms to be run
  44. * manually before.
  45. *
  46. * This function is called by the framework runtime code whenever a binding
  47. * changes. The value can in practice be anything at runtime, but for typing
  48. * purposes we assume it's a valid `T` value. Type-checking will enforce that.
  49. */
  50. applyValueToInputSignal<T, TransformT>(node: InputSignalNode<T, TransformT>, value: T): void;
  51. /**
  52. * A debug name for the input signal. Used in Angular DevTools to identify the signal.
  53. */
  54. debugName?: string;
  55. }
  56. /**
  57. * @publicAPI
  58. *
  59. * Options for signal inputs.
  60. */
  61. interface InputOptions<T, TransformT> {
  62. /** Optional public name for the input. By default, the class field name is used. */
  63. alias?: string;
  64. /**
  65. * Optional transform that runs whenever a new value is bound. Can be used to
  66. * transform the input value before the input is updated.
  67. *
  68. * The transform function can widen the type of the input. For example, consider
  69. * an input for `disabled`. In practice, as the component author, you want to only
  70. * deal with a boolean, but users may want to bind a string if they just use the
  71. * attribute form to bind to the input via `<my-dir input>`. A transform can then
  72. * handle such string values and convert them to `boolean`. See: {@link booleanAttribute}.
  73. */
  74. transform?: (v: TransformT) => T;
  75. /**
  76. * A debug name for the input signal. Used in Angular DevTools to identify the signal.
  77. */
  78. debugName?: string;
  79. }
  80. /**
  81. * Signal input options without the transform option.
  82. *
  83. * @publicAPI
  84. */
  85. type InputOptionsWithoutTransform<T> = Omit<InputOptions<T, T>, 'transform'> & {
  86. transform?: undefined;
  87. };
  88. /**
  89. * Signal input options with the transform option required.
  90. *
  91. * @publicAPI
  92. */
  93. type InputOptionsWithTransform<T, TransformT> = Required<Pick<InputOptions<T, TransformT>, 'transform'>> & InputOptions<T, TransformT>;
  94. declare const ɵINPUT_SIGNAL_BRAND_READ_TYPE: unique symbol;
  95. declare const ɵINPUT_SIGNAL_BRAND_WRITE_TYPE: unique symbol;
  96. /**
  97. * `InputSignalWithTransform` represents a special `Signal` for a
  98. * directive/component input with a `transform` function.
  99. *
  100. * Signal inputs with transforms capture an extra generic for their transform write
  101. * type. Transforms can expand the accepted bound values for an input while ensuring
  102. * value retrievals of the signal input are still matching the generic input type.
  103. *
  104. * ```ts
  105. * class MyDir {
  106. * disabled = input(false, {
  107. * transform: (v: string|boolean) => convertToBoolean(v),
  108. * }); // InputSignalWithTransform<boolean, string|boolean>
  109. *
  110. * click() {
  111. * this.disabled() // always returns a `boolean`.
  112. * }
  113. * }
  114. * ```
  115. *
  116. * @see {@link InputSignal} for additional information.
  117. *
  118. * @publicAPI
  119. */
  120. interface InputSignalWithTransform<T, TransformT> extends Signal<T> {
  121. [SIGNAL]: InputSignalNode<T, TransformT>;
  122. [ɵINPUT_SIGNAL_BRAND_READ_TYPE]: T;
  123. [ɵINPUT_SIGNAL_BRAND_WRITE_TYPE]: TransformT;
  124. }
  125. /**
  126. * `InputSignal` represents a special `Signal` for a directive/component input.
  127. *
  128. * An input signal is similar to a non-writable signal except that it also
  129. * carries additional type-information for transforms, and that Angular internally
  130. * updates the signal whenever a new value is bound.
  131. *
  132. * @see {@link InputOptionsWithTransform} for inputs with transforms.
  133. *
  134. * @publicAPI
  135. */
  136. interface InputSignal<T> extends InputSignalWithTransform<T, T> {
  137. }
  138. /**
  139. * The `input` function allows declaration of inputs in directives and
  140. * components.
  141. *
  142. * The function exposes an API for also declaring required inputs via the
  143. * `input.required` function.
  144. *
  145. * @publicAPI
  146. * @docsPrivate Ignored because `input` is the canonical API entry.
  147. */
  148. interface InputFunction {
  149. /**
  150. * Initializes an input of type `T` with an initial value of `undefined`.
  151. * Angular will implicitly use `undefined` as initial value.
  152. */
  153. <T>(): InputSignal<T | undefined>;
  154. /** Declares an input of type `T` with an explicit initial value. */
  155. <T>(initialValue: T, opts?: InputOptionsWithoutTransform<T>): InputSignal<T>;
  156. /** Declares an input of type `T|undefined` without an initial value, but with input options */
  157. <T>(initialValue: undefined, opts: InputOptionsWithoutTransform<T>): InputSignal<T | undefined>;
  158. /**
  159. * Declares an input of type `T` with an initial value and a transform
  160. * function.
  161. *
  162. * The input accepts values of type `TransformT` and the given
  163. * transform function will transform the value to type `T`.
  164. */
  165. <T, TransformT>(initialValue: T, opts: InputOptionsWithTransform<T, TransformT>): InputSignalWithTransform<T, TransformT>;
  166. /**
  167. * Declares an input of type `T|undefined` without an initial value and with a transform
  168. * function.
  169. *
  170. * The input accepts values of type `TransformT` and the given
  171. * transform function will transform the value to type `T|undefined`.
  172. */ <T, TransformT>(initialValue: undefined, opts: InputOptionsWithTransform<T | undefined, TransformT>): InputSignalWithTransform<T | undefined, TransformT>;
  173. /**
  174. * Initializes a required input.
  175. *
  176. * Consumers of your directive/component need to bind to this
  177. * input. If unset, a compile time error will be reported.
  178. *
  179. * @publicAPI
  180. */
  181. required: {
  182. /** Declares a required input of type `T`. */
  183. <T>(opts?: InputOptionsWithoutTransform<T>): InputSignal<T>;
  184. /**
  185. * Declares a required input of type `T` with a transform function.
  186. *
  187. * The input accepts values of type `TransformT` and the given
  188. * transform function will transform the value to type `T`.
  189. */
  190. <T, TransformT>(opts: InputOptionsWithTransform<T, TransformT>): InputSignalWithTransform<T, TransformT>;
  191. };
  192. }
  193. /**
  194. * The `input` function allows declaration of Angular inputs in directives
  195. * and components.
  196. *
  197. * There are two variants of inputs that can be declared:
  198. *
  199. * 1. **Optional inputs** with an initial value.
  200. * 2. **Required inputs** that consumers need to set.
  201. *
  202. * By default, the `input` function will declare optional inputs that
  203. * always have an initial value. Required inputs can be declared
  204. * using the `input.required()` function.
  205. *
  206. * Inputs are signals. The values of an input are exposed as a `Signal`.
  207. * The signal always holds the latest value of the input that is bound
  208. * from the parent.
  209. *
  210. * @usageNotes
  211. * To use signal-based inputs, import `input` from `@angular/core`.
  212. *
  213. * ```ts
  214. * import {input} from '@angular/core`;
  215. * ```
  216. *
  217. * Inside your component, introduce a new class member and initialize
  218. * it with a call to `input` or `input.required`.
  219. *
  220. * ```ts
  221. * @Component({
  222. * ...
  223. * })
  224. * export class UserProfileComponent {
  225. * firstName = input<string>(); // Signal<string|undefined>
  226. * lastName = input.required<string>(); // Signal<string>
  227. * age = input(0) // Signal<number>
  228. * }
  229. * ```
  230. *
  231. * Inside your component template, you can display values of the inputs
  232. * by calling the signal.
  233. *
  234. * ```html
  235. * <span>{{firstName()}}</span>
  236. * ```
  237. *
  238. * @publicAPI
  239. * @initializerApiFunction
  240. */
  241. declare const input: InputFunction;
  242. /** Retrieves the write type of an `InputSignal` and `InputSignalWithTransform`. */
  243. type ɵUnwrapInputSignalWriteType<Field> = Field extends InputSignalWithTransform<any, infer WriteT> ? WriteT : never;
  244. /**
  245. * Unwraps all `InputSignal`/`InputSignalWithTransform` class fields of
  246. * the given directive.
  247. */
  248. type ɵUnwrapDirectiveSignalInputs<Dir, Fields extends keyof Dir> = {
  249. [P in Fields]: ɵUnwrapInputSignalWriteType<Dir[P]>;
  250. };
  251. /** Symbol used distinguish `WritableSignal` from other non-writable signals and functions. */
  252. declare const ɵWRITABLE_SIGNAL: unique symbol;
  253. /**
  254. * A `Signal` with a value that can be mutated via a setter interface.
  255. */
  256. interface WritableSignal<T> extends Signal<T> {
  257. [ɵWRITABLE_SIGNAL]: T;
  258. /**
  259. * Directly set the signal to a new value, and notify any dependents.
  260. */
  261. set(value: T): void;
  262. /**
  263. * Update the value of the signal based on its current value, and
  264. * notify any dependents.
  265. */
  266. update(updateFn: (value: T) => T): void;
  267. /**
  268. * Returns a readonly version of this signal. Readonly signals can be accessed to read their value
  269. * but can't be changed using set or update methods. The readonly signals do _not_ have
  270. * any built-in mechanism that would prevent deep-mutation of their value.
  271. */
  272. asReadonly(): Signal<T>;
  273. }
  274. /**
  275. * Utility function used during template type checking to extract the value from a `WritableSignal`.
  276. * @codeGenApi
  277. */
  278. declare function ɵunwrapWritableSignal<T>(value: T | {
  279. [ɵWRITABLE_SIGNAL]: T;
  280. }): T;
  281. /**
  282. * Options passed to the `signal` creation function.
  283. */
  284. interface CreateSignalOptions<T> {
  285. /**
  286. * A comparison function which defines equality for signal values.
  287. */
  288. equal?: ValueEqualityFn<T>;
  289. /**
  290. * A debug name for the signal. Used in Angular DevTools to identify the signal.
  291. */
  292. debugName?: string;
  293. }
  294. /**
  295. * Create a `Signal` that can be set or updated directly.
  296. */
  297. declare function signal<T>(initialValue: T, options?: CreateSignalOptions<T>): WritableSignal<T>;
  298. /**
  299. * Function that can be used to manually clean up a
  300. * programmatic {@link OutputRef#subscribe} subscription.
  301. *
  302. * Note: Angular will automatically clean up subscriptions
  303. * when the directive/component of the output is destroyed.
  304. *
  305. * @publicAPI
  306. */
  307. interface OutputRefSubscription {
  308. unsubscribe(): void;
  309. }
  310. /**
  311. * A reference to an Angular output.
  312. *
  313. * @publicAPI
  314. */
  315. interface OutputRef<T> {
  316. /**
  317. * Registers a callback that is invoked whenever the output
  318. * emits a new value of type `T`.
  319. *
  320. * Angular will automatically clean up the subscription when
  321. * the directive/component of the output is destroyed.
  322. */
  323. subscribe(callback: (value: T) => void): OutputRefSubscription;
  324. }
  325. /**
  326. * @publicAPI
  327. *
  328. * Options for model signals.
  329. */
  330. interface ModelOptions {
  331. /**
  332. * Optional public name of the input side of the model. The output side will have the same
  333. * name as the input, but suffixed with `Change`. By default, the class field name is used.
  334. */
  335. alias?: string;
  336. /**
  337. * A debug name for the model signal. Used in Angular DevTools to identify the signal.
  338. */
  339. debugName?: string;
  340. }
  341. /**
  342. * `ModelSignal` represents a special `Signal` for a directive/component model field.
  343. *
  344. * A model signal is a writeable signal that can be exposed as an output.
  345. * Whenever its value is updated, it emits to the output.
  346. *
  347. * @publicAPI
  348. */
  349. interface ModelSignal<T> extends WritableSignal<T>, InputSignal<T>, OutputRef<T> {
  350. [SIGNAL]: InputSignalNode<T, T>;
  351. }
  352. /**
  353. * `model` declares a writeable signal that is exposed as an input/output pair on the containing
  354. * directive. The input name is taken either from the class member or from the `alias` option.
  355. * The output name is generated by taking the input name and appending `Change`.
  356. *
  357. * The function exposes an API for also declaring required models via the
  358. * `model.required` function.
  359. *
  360. * @publicAPI
  361. * @docsPrivate Ignored because `model` is the canonical API entry.
  362. */
  363. interface ModelFunction {
  364. /**
  365. * Initializes a model of type `T` with an initial value of `undefined`.
  366. * Angular will implicitly use `undefined` as initial value.
  367. */
  368. <T>(): ModelSignal<T | undefined>;
  369. /** Initializes a model of type `T` with the given initial value. */
  370. <T>(initialValue: T, opts?: ModelOptions): ModelSignal<T>;
  371. required: {
  372. /**
  373. * Initializes a required model.
  374. *
  375. * Users of your directive/component need to bind to the input side of the model.
  376. * If unset, a compile time error will be reported.
  377. */
  378. <T>(opts?: ModelOptions): ModelSignal<T>;
  379. };
  380. }
  381. /**
  382. * `model` declares a writeable signal that is exposed as an input/output
  383. * pair on the containing directive.
  384. *
  385. * The input name is taken either from the class member or from the `alias` option.
  386. * The output name is generated by taking the input name and appending `Change`.
  387. *
  388. * @usageNotes
  389. *
  390. * To use `model()`, import the function from `@angular/core`.
  391. *
  392. * ```ts
  393. * import {model} from '@angular/core`;
  394. * ```
  395. *
  396. * Inside your component, introduce a new class member and initialize
  397. * it with a call to `model` or `model.required`.
  398. *
  399. * ```ts
  400. * @Directive({
  401. * ...
  402. * })
  403. * export class MyDir {
  404. * firstName = model<string>(); // ModelSignal<string|undefined>
  405. * lastName = model.required<string>(); // ModelSignal<string>
  406. * age = model(0); // ModelSignal<number>
  407. * }
  408. * ```
  409. *
  410. * Inside your component template, you can display the value of a `model`
  411. * by calling the signal.
  412. *
  413. * ```html
  414. * <span>{{firstName()}}</span>
  415. * ```
  416. *
  417. * Updating the `model` is equivalent to updating a writable signal.
  418. *
  419. * ```ts
  420. * updateName(newFirstName: string): void {
  421. * this.firstName.set(newFirstName);
  422. * }
  423. * ```
  424. *
  425. * @publicAPI
  426. * @initializerApiFunction
  427. */
  428. declare const model: ModelFunction;
  429. /**
  430. * @description
  431. *
  432. * Represents an abstract class `T`, if applied to a concrete class it would stop being
  433. * instantiable.
  434. *
  435. * @publicApi
  436. */
  437. interface AbstractType<T> extends Function {
  438. prototype: T;
  439. }
  440. /**
  441. * @description
  442. *
  443. * Represents a type that a Component or other object is instances of.
  444. *
  445. * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by
  446. * the `MyCustomComponent` constructor function.
  447. *
  448. * @publicApi
  449. */
  450. declare const Type$1: FunctionConstructor;
  451. interface Type$1<T> extends Function {
  452. new (...args: any[]): T;
  453. }
  454. /**
  455. * Returns a writable type version of type.
  456. *
  457. * USAGE:
  458. * Given:
  459. * ```ts
  460. * interface Person {readonly name: string}
  461. * ```
  462. *
  463. * We would like to get a read/write version of `Person`.
  464. * ```ts
  465. * const WritablePerson = Writable<Person>;
  466. * ```
  467. *
  468. * The result is that you can do:
  469. *
  470. * ```ts
  471. * const readonlyPerson: Person = {name: 'Marry'};
  472. * readonlyPerson.name = 'John'; // TypeError
  473. * (readonlyPerson as WritablePerson).name = 'John'; // OK
  474. *
  475. * // Error: Correctly detects that `Person` did not have `age` property.
  476. * (readonlyPerson as WritablePerson).age = 30;
  477. * ```
  478. */
  479. type Writable<T> = {
  480. -readonly [K in keyof T]: T[K];
  481. };
  482. /**
  483. * Creates a token that can be used in a DI Provider.
  484. *
  485. * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a
  486. * runtime representation) such as when injecting an interface, callable type, array or
  487. * parameterized type.
  488. *
  489. * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by
  490. * the `Injector`. This provides an additional level of type safety.
  491. *
  492. * <div class="docs-alert docs-alert-helpful">
  493. *
  494. * **Important Note**: Ensure that you use the same instance of the `InjectionToken` in both the
  495. * provider and the injection call. Creating a new instance of `InjectionToken` in different places,
  496. * even with the same description, will be treated as different tokens by Angular's DI system,
  497. * leading to a `NullInjectorError`.
  498. *
  499. * </div>
  500. *
  501. * {@example injection-token/src/main.ts region='InjectionToken'}
  502. *
  503. * When creating an `InjectionToken`, you can optionally specify a factory function which returns
  504. * (possibly by creating) a default value of the parameterized type `T`. This sets up the
  505. * `InjectionToken` using this factory as a provider as if it was defined explicitly in the
  506. * application's root injector. If the factory function, which takes zero arguments, needs to inject
  507. * dependencies, it can do so using the [`inject`](api/core/inject) function.
  508. * As you can see in the Tree-shakable InjectionToken example below.
  509. *
  510. * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which
  511. * overrides the above behavior and marks the token as belonging to a particular `@NgModule` (note:
  512. * this option is now deprecated). As mentioned above, `'root'` is the default value for
  513. * `providedIn`.
  514. *
  515. * The `providedIn: NgModule` and `providedIn: 'any'` options are deprecated.
  516. *
  517. * @usageNotes
  518. * ### Basic Examples
  519. *
  520. * ### Plain InjectionToken
  521. *
  522. * {@example core/di/ts/injector_spec.ts region='InjectionToken'}
  523. *
  524. * ### Tree-shakable InjectionToken
  525. *
  526. * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}
  527. *
  528. * @publicApi
  529. */
  530. declare class InjectionToken<T> {
  531. protected _desc: string;
  532. readonly ɵprov: unknown;
  533. /**
  534. * @param _desc Description for the token,
  535. * used only for debugging purposes,
  536. * it should but does not need to be unique
  537. * @param options Options for the token's usage, as described above
  538. */
  539. constructor(_desc: string, options?: {
  540. providedIn?: Type$1<any> | 'root' | 'platform' | 'any' | null;
  541. factory: () => T;
  542. });
  543. toString(): string;
  544. }
  545. declare const enum NotificationSource {
  546. MarkAncestorsForTraversal = 0,
  547. SetInput = 1,
  548. DeferBlockStateUpdate = 2,
  549. DebugApplyChanges = 3,
  550. MarkForCheck = 4,
  551. Listener = 5,
  552. CustomElement = 6,
  553. RenderHook = 7,
  554. ViewAttached = 8,
  555. ViewDetachedFromDOM = 9,
  556. AsyncAnimationsLoaded = 10,
  557. PendingTaskRemoved = 11,
  558. RootEffect = 12,
  559. ViewEffect = 13
  560. }
  561. /**
  562. * Injectable that is notified when an `LView` is made aware of changes to application state.
  563. */
  564. declare abstract class ChangeDetectionScheduler {
  565. abstract notify(source: NotificationSource): void;
  566. abstract runningTick: boolean;
  567. }
  568. /** Token used to indicate if zoneless was enabled via provideZonelessChangeDetection(). */
  569. declare const ZONELESS_ENABLED: InjectionToken<boolean>;
  570. /**
  571. * Configures the `Injector` to return a value for a token.
  572. * Base for `ValueProvider` decorator.
  573. *
  574. * @publicApi
  575. */
  576. interface ValueSansProvider {
  577. /**
  578. * The value to inject.
  579. */
  580. useValue: any;
  581. }
  582. /**
  583. * Configures the `Injector` to return a value for a token.
  584. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  585. *
  586. * @usageNotes
  587. *
  588. * ### Example
  589. *
  590. * {@example core/di/ts/provider_spec.ts region='ValueProvider'}
  591. *
  592. * ### Multi-value example
  593. *
  594. * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
  595. *
  596. * @publicApi
  597. */
  598. interface ValueProvider extends ValueSansProvider {
  599. /**
  600. * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
  601. */
  602. provide: any;
  603. /**
  604. * When true, injector returns an array of instances. This is useful to allow multiple
  605. * providers spread across many files to provide configuration information to a common token.
  606. */
  607. multi?: boolean;
  608. }
  609. /**
  610. * Configures the `Injector` to return an instance of `useClass` for a token.
  611. * Base for `StaticClassProvider` decorator.
  612. *
  613. * @publicApi
  614. */
  615. interface StaticClassSansProvider {
  616. /**
  617. * An optional class to instantiate for the `token`. By default, the `provide`
  618. * class is instantiated.
  619. */
  620. useClass: Type$1<any>;
  621. /**
  622. * A list of `token`s to be resolved by the injector. The list of values is then
  623. * used as arguments to the `useClass` constructor.
  624. */
  625. deps: any[];
  626. }
  627. /**
  628. * Configures the `Injector` to return an instance of `useClass` for a token.
  629. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  630. *
  631. * @usageNotes
  632. *
  633. * {@example core/di/ts/provider_spec.ts region='StaticClassProvider'}
  634. *
  635. * Note that following two providers are not equal:
  636. *
  637. * {@example core/di/ts/provider_spec.ts region='StaticClassProviderDifference'}
  638. *
  639. * ### Multi-value example
  640. *
  641. * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
  642. *
  643. * @publicApi
  644. */
  645. interface StaticClassProvider extends StaticClassSansProvider {
  646. /**
  647. * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
  648. */
  649. provide: any;
  650. /**
  651. * When true, injector returns an array of instances. This is useful to allow multiple
  652. * providers spread across many files to provide configuration information to a common token.
  653. */
  654. multi?: boolean;
  655. }
  656. /**
  657. * Configures the `Injector` to return an instance of a token.
  658. *
  659. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  660. *
  661. * @usageNotes
  662. *
  663. * ```ts
  664. * @Injectable(SomeModule, {deps: []})
  665. * class MyService {}
  666. * ```
  667. *
  668. * @publicApi
  669. */
  670. interface ConstructorSansProvider {
  671. /**
  672. * A list of `token`s to be resolved by the injector.
  673. */
  674. deps?: any[];
  675. }
  676. /**
  677. * Configures the `Injector` to return an instance of a token.
  678. *
  679. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  680. *
  681. * @usageNotes
  682. *
  683. * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
  684. *
  685. * ### Multi-value example
  686. *
  687. * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
  688. *
  689. * @publicApi
  690. */
  691. interface ConstructorProvider extends ConstructorSansProvider {
  692. /**
  693. * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
  694. */
  695. provide: Type$1<any>;
  696. /**
  697. * When true, injector returns an array of instances. This is useful to allow multiple
  698. * providers spread across many files to provide configuration information to a common token.
  699. */
  700. multi?: boolean;
  701. }
  702. /**
  703. * Configures the `Injector` to return a value of another `useExisting` token.
  704. *
  705. * @see {@link ExistingProvider}
  706. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  707. *
  708. * @publicApi
  709. */
  710. interface ExistingSansProvider {
  711. /**
  712. * Existing `token` to return. (Equivalent to `injector.get(useExisting)`)
  713. */
  714. useExisting: any;
  715. }
  716. /**
  717. * Configures the `Injector` to return a value of another `useExisting` token.
  718. *
  719. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  720. *
  721. * @usageNotes
  722. *
  723. * {@example core/di/ts/provider_spec.ts region='ExistingProvider'}
  724. *
  725. * ### Multi-value example
  726. *
  727. * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
  728. *
  729. * @publicApi
  730. */
  731. interface ExistingProvider extends ExistingSansProvider {
  732. /**
  733. * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
  734. */
  735. provide: any;
  736. /**
  737. * When true, injector returns an array of instances. This is useful to allow multiple
  738. * providers spread across many files to provide configuration information to a common token.
  739. */
  740. multi?: boolean;
  741. }
  742. /**
  743. * Configures the `Injector` to return a value by invoking a `useFactory` function.
  744. *
  745. * @see {@link FactoryProvider}
  746. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  747. *
  748. * @publicApi
  749. */
  750. interface FactorySansProvider {
  751. /**
  752. * A function to invoke to create a value for this `token`. The function is invoked with
  753. * resolved values of `token`s in the `deps` field.
  754. */
  755. useFactory: Function;
  756. /**
  757. * A list of `token`s to be resolved by the injector. The list of values is then
  758. * used as arguments to the `useFactory` function.
  759. */
  760. deps?: any[];
  761. }
  762. /**
  763. * Configures the `Injector` to return a value by invoking a `useFactory` function.
  764. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  765. *
  766. * @usageNotes
  767. *
  768. * {@example core/di/ts/provider_spec.ts region='FactoryProvider'}
  769. *
  770. * Dependencies can also be marked as optional:
  771. *
  772. * {@example core/di/ts/provider_spec.ts region='FactoryProviderOptionalDeps'}
  773. *
  774. * ### Multi-value example
  775. *
  776. * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
  777. *
  778. * @publicApi
  779. */
  780. interface FactoryProvider extends FactorySansProvider {
  781. /**
  782. * An injection token. (Typically an instance of `Type` or `InjectionToken`, but can be `any`).
  783. */
  784. provide: any;
  785. /**
  786. * When true, injector returns an array of instances. This is useful to allow multiple
  787. * providers spread across many files to provide configuration information to a common token.
  788. */
  789. multi?: boolean;
  790. }
  791. /**
  792. * Describes how an `Injector` should be configured as static (that is, without reflection).
  793. * A static provider provides tokens to an injector for various types of dependencies.
  794. *
  795. * @see {@link Injector.create()}
  796. * @see [Dependency Injection Guide](guide/di/dependency-injection-providers).
  797. *
  798. * @publicApi
  799. */
  800. type StaticProvider = ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider | any[];
  801. /**
  802. * Configures the `Injector` to return an instance of `Type` when `Type' is used as the token.
  803. *
  804. * Create an instance by invoking the `new` operator and supplying additional arguments.
  805. * This form is a short form of `TypeProvider`;
  806. *
  807. * For more details, see the ["Dependency Injection Guide"](guide/di/dependency-injection.
  808. *
  809. * @usageNotes
  810. *
  811. * {@example core/di/ts/provider_spec.ts region='TypeProvider'}
  812. *
  813. * @publicApi
  814. */
  815. interface TypeProvider extends Type$1<any> {
  816. }
  817. /**
  818. * Configures the `Injector` to return a value by invoking a `useClass` function.
  819. * Base for `ClassProvider` decorator.
  820. *
  821. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  822. *
  823. * @publicApi
  824. */
  825. interface ClassSansProvider {
  826. /**
  827. * Class to instantiate for the `token`.
  828. */
  829. useClass: Type$1<any>;
  830. }
  831. /**
  832. * Configures the `Injector` to return an instance of `useClass` for a token.
  833. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  834. *
  835. * @usageNotes
  836. *
  837. * {@example core/di/ts/provider_spec.ts region='ClassProvider'}
  838. *
  839. * Note that following two providers are not equal:
  840. *
  841. * {@example core/di/ts/provider_spec.ts region='ClassProviderDifference'}
  842. *
  843. * ### Multi-value example
  844. *
  845. * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
  846. *
  847. * @publicApi
  848. */
  849. interface ClassProvider extends ClassSansProvider {
  850. /**
  851. * An injection token. (Typically an instance of `Type` or `InjectionToken`, but can be `any`).
  852. */
  853. provide: any;
  854. /**
  855. * When true, injector returns an array of instances. This is useful to allow multiple
  856. * providers spread across many files to provide configuration information to a common token.
  857. */
  858. multi?: boolean;
  859. }
  860. /**
  861. * Describes how the `Injector` should be configured.
  862. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  863. *
  864. * @see {@link StaticProvider}
  865. *
  866. * @publicApi
  867. */
  868. type Provider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | any[];
  869. /**
  870. * Encapsulated `Provider`s that are only accepted during creation of an `EnvironmentInjector` (e.g.
  871. * in an `NgModule`).
  872. *
  873. * Using this wrapper type prevents providers which are only designed to work in
  874. * application/environment injectors from being accidentally included in
  875. * `@Component.providers` and ending up in a component injector.
  876. *
  877. * This wrapper type prevents access to the `Provider`s inside.
  878. *
  879. * @see {@link makeEnvironmentProviders}
  880. * @see {@link importProvidersFrom}
  881. *
  882. * @publicApi
  883. */
  884. type EnvironmentProviders = {
  885. ɵbrand: 'EnvironmentProviders';
  886. };
  887. interface InternalEnvironmentProviders extends EnvironmentProviders {
  888. ɵproviders: (Provider | EnvironmentProviders)[];
  889. /**
  890. * If present, indicates that the `EnvironmentProviders` were derived from NgModule providers.
  891. *
  892. * This is used to produce clearer error messages.
  893. */
  894. ɵfromNgModule?: true;
  895. }
  896. declare function isEnvironmentProviders(value: Provider | EnvironmentProviders | InternalEnvironmentProviders): value is InternalEnvironmentProviders;
  897. /**
  898. * Describes a function that is used to process provider lists (such as provider
  899. * overrides).
  900. */
  901. type ProcessProvidersFunction = (providers: Provider[]) => Provider[];
  902. /**
  903. * A wrapper around an NgModule that associates it with providers
  904. * Usage without a generic type is deprecated.
  905. *
  906. * @publicApi
  907. */
  908. interface ModuleWithProviders<T> {
  909. ngModule: Type$1<T>;
  910. providers?: Array<Provider | EnvironmentProviders>;
  911. }
  912. /**
  913. * Providers that were imported from NgModules via the `importProvidersFrom` function.
  914. *
  915. * These providers are meant for use in an application injector (or other environment injectors) and
  916. * should not be used in component injectors.
  917. *
  918. * This type cannot be directly implemented. It's returned from the `importProvidersFrom` function
  919. * and serves to prevent the extracted NgModule providers from being used in the wrong contexts.
  920. *
  921. * @see {@link importProvidersFrom}
  922. *
  923. * @publicApi
  924. * @deprecated replaced by `EnvironmentProviders`
  925. */
  926. type ImportedNgModuleProviders = EnvironmentProviders;
  927. /**
  928. * @fileoverview
  929. * While Angular only uses Trusted Types internally for the time being,
  930. * references to Trusted Types could leak into our core.d.ts, which would force
  931. * anyone compiling against @angular/core to provide the @types/trusted-types
  932. * package in their compilation unit.
  933. *
  934. * Until https://github.com/microsoft/TypeScript/issues/30024 is resolved, we
  935. * will keep Angular's public API surface free of references to Trusted Types.
  936. * For internal and semi-private APIs that need to reference Trusted Types, the
  937. * minimal type definitions for the Trusted Types API provided by this module
  938. * should be used instead. They are marked as "declare" to prevent them from
  939. * being renamed by compiler optimization.
  940. *
  941. * Adapted from
  942. * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/trusted-types/index.d.ts
  943. * but restricted to the API surface used within Angular.
  944. */
  945. type TrustedHTML = string & {
  946. __brand__: 'TrustedHTML';
  947. };
  948. type TrustedScript = string & {
  949. __brand__: 'TrustedScript';
  950. };
  951. type TrustedScriptURL = string & {
  952. __brand__: 'TrustedScriptURL';
  953. };
  954. /**
  955. * Function used to sanitize the value before writing it into the renderer.
  956. */
  957. type SanitizerFn = (value: any, tagName?: string, propName?: string) => string | TrustedHTML | TrustedScript | TrustedScriptURL;
  958. /**
  959. * Stores a list of nodes which need to be removed.
  960. *
  961. * Numbers are indexes into the `LView`
  962. * - index > 0: `removeRNode(lView[0])`
  963. * - index < 0: `removeICU(~lView[0])`
  964. */
  965. interface I18nRemoveOpCodes extends Array<number> {
  966. __brand__: 'I18nRemoveOpCodes';
  967. }
  968. /**
  969. * Array storing OpCode for dynamically creating `i18n` blocks.
  970. *
  971. * Example:
  972. * ```ts
  973. * <I18nCreateOpCode>[
  974. * // For adding text nodes
  975. * // ---------------------
  976. * // Equivalent to:
  977. * // lView[1].appendChild(lView[0] = document.createTextNode('xyz'));
  978. * 'xyz', 0, 1 << SHIFT_PARENT | 0 << SHIFT_REF | AppendChild,
  979. *
  980. * // For adding element nodes
  981. * // ---------------------
  982. * // Equivalent to:
  983. * // lView[1].appendChild(lView[0] = document.createElement('div'));
  984. * ELEMENT_MARKER, 'div', 0, 1 << SHIFT_PARENT | 0 << SHIFT_REF | AppendChild,
  985. *
  986. * // For adding comment nodes
  987. * // ---------------------
  988. * // Equivalent to:
  989. * // lView[1].appendChild(lView[0] = document.createComment(''));
  990. * ICU_MARKER, '', 0, 1 << SHIFT_PARENT | 0 << SHIFT_REF | AppendChild,
  991. *
  992. * // For moving existing nodes to a different location
  993. * // --------------------------------------------------
  994. * // Equivalent to:
  995. * // const node = lView[1];
  996. * // lView[2].appendChild(node);
  997. * 1 << SHIFT_REF | Select, 2 << SHIFT_PARENT | 0 << SHIFT_REF | AppendChild,
  998. *
  999. * // For removing existing nodes
  1000. * // --------------------------------------------------
  1001. * // const node = lView[1];
  1002. * // removeChild(tView.data(1), node, lView);
  1003. * 1 << SHIFT_REF | Remove,
  1004. *
  1005. * // For writing attributes
  1006. * // --------------------------------------------------
  1007. * // const node = lView[1];
  1008. * // node.setAttribute('attr', 'value');
  1009. * 1 << SHIFT_REF | Attr, 'attr', 'value'
  1010. * ];
  1011. * ```
  1012. */
  1013. interface IcuCreateOpCodes extends Array<number | string | ELEMENT_MARKER | ICU_MARKER | null>, I18nDebug {
  1014. __brand__: 'I18nCreateOpCodes';
  1015. }
  1016. /**
  1017. * Marks that the next string is an element name.
  1018. *
  1019. * See `I18nMutateOpCodes` documentation.
  1020. */
  1021. declare const ELEMENT_MARKER: ELEMENT_MARKER;
  1022. interface ELEMENT_MARKER {
  1023. marker: 'element';
  1024. }
  1025. /**
  1026. * Marks that the next string is comment text need for ICU.
  1027. *
  1028. * See `I18nMutateOpCodes` documentation.
  1029. */
  1030. declare const ICU_MARKER: ICU_MARKER;
  1031. interface ICU_MARKER {
  1032. marker: 'ICU';
  1033. }
  1034. interface I18nDebug {
  1035. /**
  1036. * Human readable representation of the OpCode arrays.
  1037. *
  1038. * NOTE: This property only exists if `ngDevMode` is set to `true` and it is not present in
  1039. * production. Its presence is purely to help debug issue in development, and should not be relied
  1040. * on in production application.
  1041. */
  1042. debug?: string[];
  1043. }
  1044. /**
  1045. * Array storing OpCode for dynamically creating `i18n` translation DOM elements.
  1046. *
  1047. * This array creates a sequence of `Text` and `Comment` (as ICU anchor) DOM elements. It consists
  1048. * of a pair of `number` and `string` pairs which encode the operations for the creation of the
  1049. * translated block.
  1050. *
  1051. * The number is shifted and encoded according to `I18nCreateOpCode`
  1052. *
  1053. * Pseudocode:
  1054. * ```ts
  1055. * const i18nCreateOpCodes = [
  1056. * 10 << I18nCreateOpCode.SHIFT, "Text Node add to DOM",
  1057. * 11 << I18nCreateOpCode.SHIFT | I18nCreateOpCode.COMMENT, "Comment Node add to DOM",
  1058. * 12 << I18nCreateOpCode.SHIFT | I18nCreateOpCode.APPEND_LATER, "Text Node added later"
  1059. * ];
  1060. *
  1061. * for(var i=0; i<i18nCreateOpCodes.length; i++) {
  1062. * const opcode = i18NCreateOpCodes[i++];
  1063. * const index = opcode >> I18nCreateOpCode.SHIFT;
  1064. * const text = i18NCreateOpCodes[i];
  1065. * let node: Text|Comment;
  1066. * if (opcode & I18nCreateOpCode.COMMENT === I18nCreateOpCode.COMMENT) {
  1067. * node = lView[~index] = document.createComment(text);
  1068. * } else {
  1069. * node = lView[index] = document.createText(text);
  1070. * }
  1071. * if (opcode & I18nCreateOpCode.APPEND_EAGERLY !== I18nCreateOpCode.APPEND_EAGERLY) {
  1072. * parentNode.appendChild(node);
  1073. * }
  1074. * }
  1075. * ```
  1076. */
  1077. interface I18nCreateOpCodes extends Array<number | string>, I18nDebug {
  1078. __brand__: 'I18nCreateOpCodes';
  1079. }
  1080. /**
  1081. * Stores DOM operations which need to be applied to update DOM render tree due to changes in
  1082. * expressions.
  1083. *
  1084. * The basic idea is that `i18nExp` OpCodes capture expression changes and update a change
  1085. * mask bit. (Bit 1 for expression 1, bit 2 for expression 2 etc..., bit 32 for expression 32 and
  1086. * higher.) The OpCodes then compare its own change mask against the expression change mask to
  1087. * determine if the OpCodes should execute.
  1088. *
  1089. * NOTE: 32nd bit is special as it says 32nd or higher. This way if we have more than 32 bindings
  1090. * the code still works, but with lower efficiency. (it is unlikely that a translation would have
  1091. * more than 32 bindings.)
  1092. *
  1093. * These OpCodes can be used by both the i18n block as well as ICU sub-block.
  1094. *
  1095. * ## Example
  1096. *
  1097. * Assume
  1098. * ```ts
  1099. * if (rf & RenderFlags.Update) {
  1100. * i18nExp(ctx.exp1); // If changed set mask bit 1
  1101. * i18nExp(ctx.exp2); // If changed set mask bit 2
  1102. * i18nExp(ctx.exp3); // If changed set mask bit 3
  1103. * i18nExp(ctx.exp4); // If changed set mask bit 4
  1104. * i18nApply(0); // Apply all changes by executing the OpCodes.
  1105. * }
  1106. * ```
  1107. * We can assume that each call to `i18nExp` sets an internal `changeMask` bit depending on the
  1108. * index of `i18nExp`.
  1109. *
  1110. * ### OpCodes
  1111. * ```ts
  1112. * <I18nUpdateOpCodes>[
  1113. * // The following OpCodes represent: `<div i18n-title="pre{{exp1}}in{{exp2}}post">`
  1114. * // If `changeMask & 0b11`
  1115. * // has changed then execute update OpCodes.
  1116. * // has NOT changed then skip `8` values and start processing next OpCodes.
  1117. * 0b11, 8,
  1118. * // Concatenate `newValue = 'pre'+lView[bindIndex-4]+'in'+lView[bindIndex-3]+'post';`.
  1119. * 'pre', -4, 'in', -3, 'post',
  1120. * // Update attribute: `elementAttribute(1, 'title', sanitizerFn(newValue));`
  1121. * 1 << SHIFT_REF | Attr, 'title', sanitizerFn,
  1122. *
  1123. * // The following OpCodes represent: `<div i18n>Hello {{exp3}}!">`
  1124. * // If `changeMask & 0b100`
  1125. * // has changed then execute update OpCodes.
  1126. * // has NOT changed then skip `4` values and start processing next OpCodes.
  1127. * 0b100, 4,
  1128. * // Concatenate `newValue = 'Hello ' + lView[bindIndex -2] + '!';`.
  1129. * 'Hello ', -2, '!',
  1130. * // Update text: `lView[1].textContent = newValue;`
  1131. * 1 << SHIFT_REF | Text,
  1132. *
  1133. * // The following OpCodes represent: `<div i18n>{exp4, plural, ... }">`
  1134. * // If `changeMask & 0b1000`
  1135. * // has changed then execute update OpCodes.
  1136. * // has NOT changed then skip `2` values and start processing next OpCodes.
  1137. * 0b1000, 2,
  1138. * // Concatenate `newValue = lView[bindIndex -1];`.
  1139. * -1,
  1140. * // Switch ICU: `icuSwitchCase(lView[1], 0, newValue);`
  1141. * 0 << SHIFT_ICU | 1 << SHIFT_REF | IcuSwitch,
  1142. *
  1143. * // Note `changeMask & -1` is always true, so the IcuUpdate will always execute.
  1144. * -1, 1,
  1145. * // Update ICU: `icuUpdateCase(lView[1], 0);`
  1146. * 0 << SHIFT_ICU | 1 << SHIFT_REF | IcuUpdate,
  1147. *
  1148. * ];
  1149. * ```
  1150. *
  1151. */
  1152. interface I18nUpdateOpCodes extends Array<string | number | SanitizerFn | null>, I18nDebug {
  1153. __brand__: 'I18nUpdateOpCodes';
  1154. }
  1155. /**
  1156. * Store information for the i18n translation block.
  1157. */
  1158. interface TI18n {
  1159. /**
  1160. * A set of OpCodes which will create the Text Nodes and ICU anchors for the translation blocks.
  1161. *
  1162. * NOTE: The ICU anchors are filled in with ICU Update OpCode.
  1163. */
  1164. create: I18nCreateOpCodes;
  1165. /**
  1166. * A set of OpCodes which will be executed on each change detection to determine if any changes to
  1167. * DOM are required.
  1168. */
  1169. update: I18nUpdateOpCodes;
  1170. /**
  1171. * An AST representing the translated message. This is used for hydration (and serialization),
  1172. * while the Update and Create OpCodes are used at runtime.
  1173. */
  1174. ast: Array<I18nNode>;
  1175. /**
  1176. * Index of a parent TNode, which represents a host node for this i18n block.
  1177. */
  1178. parentTNodeIndex: number;
  1179. }
  1180. /**
  1181. * Defines the ICU type of `select` or `plural`
  1182. */
  1183. declare const enum IcuType {
  1184. select = 0,
  1185. plural = 1
  1186. }
  1187. interface TIcu {
  1188. /**
  1189. * Defines the ICU type of `select` or `plural`
  1190. */
  1191. type: IcuType;
  1192. /**
  1193. * Index in `LView` where the anchor node is stored. `<!-- ICU 0:0 -->`
  1194. */
  1195. anchorIdx: number;
  1196. /**
  1197. * Currently selected ICU case pointer.
  1198. *
  1199. * `lView[currentCaseLViewIndex]` stores the currently selected case. This is needed to know how
  1200. * to clean up the current case when transitioning no the new case.
  1201. *
  1202. * If the value stored is:
  1203. * `null`: No current case selected.
  1204. * `<0`: A flag which means that the ICU just switched and that `icuUpdate` must be executed
  1205. * regardless of the `mask`. (After the execution the flag is cleared)
  1206. * `>=0` A currently selected case index.
  1207. */
  1208. currentCaseLViewIndex: number;
  1209. /**
  1210. * A list of case values which the current ICU will try to match.
  1211. *
  1212. * The last value is `other`
  1213. */
  1214. cases: any[];
  1215. /**
  1216. * A set of OpCodes to apply in order to build up the DOM render tree for the ICU
  1217. */
  1218. create: IcuCreateOpCodes[];
  1219. /**
  1220. * A set of OpCodes to apply in order to destroy the DOM render tree for the ICU.
  1221. */
  1222. remove: I18nRemoveOpCodes[];
  1223. /**
  1224. * A set of OpCodes to apply in order to update the DOM render tree for the ICU bindings.
  1225. */
  1226. update: I18nUpdateOpCodes[];
  1227. }
  1228. type I18nNode = I18nTextNode | I18nElementNode | I18nICUNode | I18nPlaceholderNode;
  1229. /**
  1230. * Represents a block of text in a translation, such as `Hello, {{ name }}!`.
  1231. */
  1232. interface I18nTextNode {
  1233. /** The AST node kind */
  1234. kind: I18nNodeKind.TEXT;
  1235. /** The LView index */
  1236. index: number;
  1237. }
  1238. /**
  1239. * Represents a simple DOM element in a translation, such as `<div>...</div>`
  1240. */
  1241. interface I18nElementNode {
  1242. /** The AST node kind */
  1243. kind: I18nNodeKind.ELEMENT;
  1244. /** The LView index */
  1245. index: number;
  1246. /** The child nodes */
  1247. children: Array<I18nNode>;
  1248. }
  1249. /**
  1250. * Represents an ICU in a translation.
  1251. */
  1252. interface I18nICUNode {
  1253. /** The AST node kind */
  1254. kind: I18nNodeKind.ICU;
  1255. /** The LView index */
  1256. index: number;
  1257. /** The branching cases */
  1258. cases: Array<Array<I18nNode>>;
  1259. /** The LView index that stores the active case */
  1260. currentCaseLViewIndex: number;
  1261. }
  1262. /**
  1263. * Represents special content that is embedded into the translation. This can
  1264. * either be a special built-in element, such as <ng-container> and <ng-content>,
  1265. * or it can be a sub-template, for example, from a structural directive.
  1266. */
  1267. interface I18nPlaceholderNode {
  1268. /** The AST node kind */
  1269. kind: I18nNodeKind.PLACEHOLDER;
  1270. /** The LView index */
  1271. index: number;
  1272. /** The child nodes */
  1273. children: Array<I18nNode>;
  1274. /** The placeholder type */
  1275. type: I18nPlaceholderType;
  1276. }
  1277. declare const enum I18nPlaceholderType {
  1278. ELEMENT = 0,
  1279. SUBTEMPLATE = 1
  1280. }
  1281. declare const enum I18nNodeKind {
  1282. TEXT = 0,
  1283. ELEMENT = 1,
  1284. PLACEHOLDER = 2,
  1285. ICU = 3
  1286. }
  1287. /**
  1288. * The goal here is to make sure that the browser DOM API is the Renderer.
  1289. * We do this by defining a subset of DOM API to be the renderer and then
  1290. * use that at runtime for rendering.
  1291. *
  1292. * At runtime we can then use the DOM api directly, in server or web-worker
  1293. * it will be easy to implement such API.
  1294. */
  1295. /** Subset of API needed for appending elements and text nodes. */
  1296. interface RNode {
  1297. /**
  1298. * Returns the parent Element, Document, or DocumentFragment
  1299. */
  1300. parentNode: RNode | null;
  1301. /**
  1302. * Returns the parent Element if there is one
  1303. */
  1304. parentElement: RElement | null;
  1305. /**
  1306. * Gets the Node immediately following this one in the parent's childNodes
  1307. */
  1308. nextSibling: RNode | null;
  1309. /**
  1310. * Insert a child node.
  1311. *
  1312. * Used exclusively for adding View root nodes into ViewAnchor location.
  1313. */
  1314. insertBefore(newChild: RNode, refChild: RNode | null, isViewRoot: boolean): void;
  1315. /**
  1316. * Append a child node.
  1317. *
  1318. * Used exclusively for building up DOM which are static (ie not View roots)
  1319. */
  1320. appendChild(newChild: RNode): RNode;
  1321. }
  1322. /**
  1323. * Subset of API needed for writing attributes, properties, and setting up
  1324. * listeners on Element.
  1325. */
  1326. interface RElement extends RNode {
  1327. firstChild: RNode | null;
  1328. style: RCssStyleDeclaration;
  1329. classList: RDomTokenList;
  1330. className: string;
  1331. tagName: string;
  1332. textContent: string | null;
  1333. hasAttribute(name: string): boolean;
  1334. getAttribute(name: string): string | null;
  1335. setAttribute(name: string, value: string | TrustedHTML | TrustedScript | TrustedScriptURL): void;
  1336. removeAttribute(name: string): void;
  1337. setAttributeNS(namespaceURI: string, qualifiedName: string, value: string | TrustedHTML | TrustedScript | TrustedScriptURL): void;
  1338. addEventListener(type: string, listener: EventListener, useCapture?: boolean): void;
  1339. removeEventListener(type: string, listener?: EventListener, options?: boolean): void;
  1340. remove(): void;
  1341. setProperty?(name: string, value: any): void;
  1342. }
  1343. interface RCssStyleDeclaration {
  1344. removeProperty(propertyName: string): string;
  1345. setProperty(propertyName: string, value: string | null, priority?: string): void;
  1346. }
  1347. interface RDomTokenList {
  1348. add(token: string): void;
  1349. remove(token: string): void;
  1350. }
  1351. interface RText extends RNode {
  1352. textContent: string | null;
  1353. }
  1354. interface RComment extends RNode {
  1355. textContent: string | null;
  1356. }
  1357. /**
  1358. * Keys within serialized view data structure to represent various
  1359. * parts. See the `SerializedView` interface below for additional information.
  1360. */
  1361. declare const ELEMENT_CONTAINERS = "e";
  1362. declare const TEMPLATES = "t";
  1363. declare const CONTAINERS = "c";
  1364. declare const MULTIPLIER = "x";
  1365. declare const NUM_ROOT_NODES = "r";
  1366. declare const TEMPLATE_ID = "i";
  1367. declare const NODES = "n";
  1368. declare const DISCONNECTED_NODES = "d";
  1369. declare const I18N_DATA = "l";
  1370. declare const DEFER_BLOCK_ID = "di";
  1371. declare const DEFER_BLOCK_STATE = "s";
  1372. /**
  1373. * Represents element containers within this view, stored as key-value pairs
  1374. * where key is an index of a container in an LView (also used in the
  1375. * `elementContainerStart` instruction), the value is the number of root nodes
  1376. * in this container. This information is needed to locate an anchor comment
  1377. * node that goes after all container nodes.
  1378. */
  1379. interface SerializedElementContainers {
  1380. [key: number]: number;
  1381. }
  1382. /**
  1383. * Serialized data structure that contains relevant hydration
  1384. * annotation information that describes a given hydration boundary
  1385. * (e.g. a component).
  1386. */
  1387. interface SerializedView {
  1388. /**
  1389. * Serialized information about <ng-container>s.
  1390. */
  1391. [ELEMENT_CONTAINERS]?: SerializedElementContainers;
  1392. /**
  1393. * Serialized information about templates.
  1394. * Key-value pairs where a key is an index of the corresponding
  1395. * `template` instruction and the value is a unique id that can
  1396. * be used during hydration to identify that template.
  1397. */
  1398. [TEMPLATES]?: Record<number, string>;
  1399. /**
  1400. * Serialized information about view containers.
  1401. * Key-value pairs where a key is an index of the corresponding
  1402. * LContainer entry within an LView, and the value is a list
  1403. * of serialized information about views within this container.
  1404. */
  1405. [CONTAINERS]?: Record<number, SerializedContainerView[]>;
  1406. /**
  1407. * Serialized information about nodes in a template.
  1408. * Key-value pairs where a key is an index of the corresponding
  1409. * DOM node in an LView and the value is a path that describes
  1410. * the location of this node (as a set of navigation instructions).
  1411. */
  1412. [NODES]?: Record<number, string>;
  1413. /**
  1414. * A list of ids which represents a set of nodes disconnected
  1415. * from the DOM tree at the serialization time, but otherwise
  1416. * present in the internal data structures.
  1417. *
  1418. * This information is used to avoid triggering the hydration
  1419. * logic for such nodes and instead use a regular "creation mode".
  1420. */
  1421. [DISCONNECTED_NODES]?: number[];
  1422. /**
  1423. * Serialized information about i18n blocks in a template.
  1424. * Key-value pairs where a key is an index of the corresponding
  1425. * i18n entry within an LView, and the value is a list of
  1426. * active ICU cases.
  1427. */
  1428. [I18N_DATA]?: Record<number, number[]>;
  1429. /**
  1430. * If this view represents a `@defer` block, this field contains
  1431. * unique id of the block.
  1432. */
  1433. [DEFER_BLOCK_ID]?: string;
  1434. /**
  1435. * This field represents a status, based on the `DeferBlockState` enum.
  1436. */
  1437. [DEFER_BLOCK_STATE]?: number;
  1438. }
  1439. /**
  1440. * Serialized data structure that contains relevant hydration
  1441. * annotation information about a view that is a part of a
  1442. * ViewContainer collection.
  1443. */
  1444. interface SerializedContainerView extends SerializedView {
  1445. /**
  1446. * Unique id that represents a TView that was used to create
  1447. * a given instance of a view:
  1448. * - TViewType.Embedded: a unique id generated during serialization on the server
  1449. * - TViewType.Component: an id generated based on component properties
  1450. * (see `getComponentId` function for details)
  1451. */
  1452. [TEMPLATE_ID]: string;
  1453. /**
  1454. * Number of root nodes that belong to this view.
  1455. * This information is needed to effectively traverse the DOM tree
  1456. * and identify segments that belong to different views.
  1457. */
  1458. [NUM_ROOT_NODES]: number;
  1459. /**
  1460. * Number of times this view is repeated.
  1461. * This is used to avoid serializing and sending the same hydration
  1462. * information about similar views (for example, produced by *ngFor).
  1463. */
  1464. [MULTIPLIER]?: number;
  1465. }
  1466. /**
  1467. * An object that contains hydration-related information serialized
  1468. * on the server, as well as the necessary references to segments of
  1469. * the DOM, to facilitate the hydration process for a given hydration
  1470. * boundary on the client.
  1471. */
  1472. interface DehydratedView {
  1473. /**
  1474. * The readonly hydration annotation data.
  1475. */
  1476. data: Readonly<SerializedView>;
  1477. /**
  1478. * A reference to the first child in a DOM segment associated
  1479. * with a given hydration boundary.
  1480. *
  1481. * Once a view becomes hydrated, the value is set to `null`, which
  1482. * indicates that further detaching/attaching view actions should result
  1483. * in invoking corresponding DOM actions (attaching DOM nodes action is
  1484. * skipped when we hydrate, since nodes are already in the DOM).
  1485. */
  1486. firstChild: RNode | null;
  1487. /**
  1488. * Stores references to first nodes in DOM segments that
  1489. * represent either an <ng-container> or a view container.
  1490. */
  1491. segmentHeads?: {
  1492. [index: number]: RNode | null;
  1493. };
  1494. /**
  1495. * An instance of a Set that represents nodes disconnected from
  1496. * the DOM tree at the serialization time, but otherwise present
  1497. * in the internal data structures.
  1498. *
  1499. * The Set is based on the `SerializedView[DISCONNECTED_NODES]` data
  1500. * and is needed to have constant-time lookups.
  1501. *
  1502. * If the value is `null`, it means that there were no disconnected
  1503. * nodes detected in this view at serialization time.
  1504. */
  1505. disconnectedNodes?: Set<number> | null;
  1506. /**
  1507. * A mapping from a view to the first child to begin claiming nodes.
  1508. *
  1509. * This mapping is generated by an i18n block, and is the source of
  1510. * truth for the nodes inside of it.
  1511. */
  1512. i18nNodes?: Map<number, RNode | null>;
  1513. /**
  1514. * A mapping from the index of an ICU node to dehydrated data for it.
  1515. *
  1516. * This information is used during the hydration process on the client.
  1517. * ICU cases that were active during server-side rendering will be added
  1518. * to the map. The hydration logic will "claim" matching cases, removing
  1519. * them from the map. The remaining entries are "unclaimed", and will be
  1520. * removed from the DOM during hydration cleanup.
  1521. */
  1522. dehydratedIcuData?: Map<number, DehydratedIcuData>;
  1523. }
  1524. /**
  1525. * An object that contains hydration-related information serialized
  1526. * on the server, as well as the necessary references to segments of
  1527. * the DOM, to facilitate the hydration process for a given view
  1528. * inside a view container (either an embedded view or a view created
  1529. * for a component).
  1530. */
  1531. interface DehydratedContainerView extends DehydratedView {
  1532. data: Readonly<SerializedContainerView>;
  1533. }
  1534. /**
  1535. * An object that contains information about a dehydrated ICU case,
  1536. * to facilitate cleaning up ICU cases that were active during
  1537. * server-side rendering, but not during hydration.
  1538. */
  1539. interface DehydratedIcuData {
  1540. /**
  1541. * The case index that this data represents.
  1542. */
  1543. case: number;
  1544. /**
  1545. * A reference back to the AST for the ICU node. This allows the
  1546. * AST to be used to clean up dehydrated nodes.
  1547. */
  1548. node: I18nICUNode;
  1549. }
  1550. /**
  1551. * `KeyValueArray` is an array where even positions contain keys and odd positions contain values.
  1552. *
  1553. * `KeyValueArray` provides a very efficient way of iterating over its contents. For small
  1554. * sets (~10) the cost of binary searching an `KeyValueArray` has about the same performance
  1555. * characteristics that of a `Map` with significantly better memory footprint.
  1556. *
  1557. * If used as a `Map` the keys are stored in alphabetical order so that they can be binary searched
  1558. * for retrieval.
  1559. *
  1560. * See: `keyValueArraySet`, `keyValueArrayGet`, `keyValueArrayIndexOf`, `keyValueArrayDelete`.
  1561. */
  1562. interface KeyValueArray<VALUE> extends Array<VALUE | string> {
  1563. __brand__: 'array-map';
  1564. }
  1565. /**
  1566. * Value stored in the `TData` which is needed to re-concatenate the styling.
  1567. *
  1568. * See: `TStylingKeyPrimitive` and `TStylingStatic`
  1569. */
  1570. type TStylingKey = TStylingKeyPrimitive | TStylingStatic;
  1571. /**
  1572. * The primitive portion (`TStylingStatic` removed) of the value stored in the `TData` which is
  1573. * needed to re-concatenate the styling.
  1574. *
  1575. * - `string`: Stores the property name. Used with `ɵɵstyleProp`/`ɵɵclassProp` instruction.
  1576. * - `null`: Represents map, so there is no name. Used with `ɵɵstyleMap`/`ɵɵclassMap`.
  1577. * - `false`: Represents an ignore case. This happens when `ɵɵstyleProp`/`ɵɵclassProp` instruction
  1578. * is combined with directive which shadows its input `@Input('class')`. That way the binding
  1579. * should not participate in the styling resolution.
  1580. */
  1581. type TStylingKeyPrimitive = string | null | false;
  1582. /**
  1583. * Store the static values for the styling binding.
  1584. *
  1585. * The `TStylingStatic` is just `KeyValueArray` where key `""` (stored at location 0) contains the
  1586. * `TStylingKey` (stored at location 1). In other words this wraps the `TStylingKey` such that the
  1587. * `""` contains the wrapped value.
  1588. *
  1589. * When instructions are resolving styling they may need to look forward or backwards in the linked
  1590. * list to resolve the value. For this reason we have to make sure that he linked list also contains
  1591. * the static values. However the list only has space for one item per styling instruction. For this
  1592. * reason we store the static values here as part of the `TStylingKey`. This means that the
  1593. * resolution function when looking for a value needs to first look at the binding value, and than
  1594. * at `TStylingKey` (if it exists).
  1595. *
  1596. * Imagine we have:
  1597. *
  1598. * ```angular-ts
  1599. * <div class="TEMPLATE" my-dir>
  1600. *
  1601. * @Directive({
  1602. * host: {
  1603. * class: 'DIR',
  1604. * '[class.dynamic]': 'exp' // ɵɵclassProp('dynamic', ctx.exp);
  1605. * }
  1606. * })
  1607. * ```
  1608. *
  1609. * In the above case the linked list will contain one item:
  1610. *
  1611. * ```ts
  1612. * // assume binding location: 10 for `ɵɵclassProp('dynamic', ctx.exp);`
  1613. * tData[10] = <TStylingStatic>[
  1614. * '': 'dynamic', // This is the wrapped value of `TStylingKey`
  1615. * 'DIR': true, // This is the default static value of directive binding.
  1616. * ];
  1617. * tData[10 + 1] = 0; // We don't have prev/next.
  1618. *
  1619. * lView[10] = undefined; // assume `ctx.exp` is `undefined`
  1620. * lView[10 + 1] = undefined; // Just normalized `lView[10]`
  1621. * ```
  1622. *
  1623. * So when the function is resolving styling value, it first needs to look into the linked list
  1624. * (there is none) and than into the static `TStylingStatic` too see if there is a default value for
  1625. * `dynamic` (there is not). Therefore it is safe to remove it.
  1626. *
  1627. * If setting `true` case:
  1628. * ```ts
  1629. * lView[10] = true; // assume `ctx.exp` is `true`
  1630. * lView[10 + 1] = true; // Just normalized `lView[10]`
  1631. * ```
  1632. * So when the function is resolving styling value, it first needs to look into the linked list
  1633. * (there is none) and than into `TNode.residualClass` (TNode.residualStyle) which contains
  1634. * ```ts
  1635. * tNode.residualClass = [
  1636. * 'TEMPLATE': true,
  1637. * ];
  1638. * ```
  1639. *
  1640. * This means that it is safe to add class.
  1641. */
  1642. interface TStylingStatic extends KeyValueArray<any> {
  1643. }
  1644. /**
  1645. * This is a branded number which contains previous and next index.
  1646. *
  1647. * When we come across styling instructions we need to store the `TStylingKey` in the correct
  1648. * order so that we can re-concatenate the styling value in the desired priority.
  1649. *
  1650. * The insertion can happen either at the:
  1651. * - end of template as in the case of coming across additional styling instruction in the template
  1652. * - in front of the template in the case of coming across additional instruction in the
  1653. * `hostBindings`.
  1654. *
  1655. * We use `TStylingRange` to store the previous and next index into the `TData` where the template
  1656. * bindings can be found.
  1657. *
  1658. * - bit 0 is used to mark that the previous index has a duplicate for current value.
  1659. * - bit 1 is used to mark that the next index has a duplicate for the current value.
  1660. * - bits 2-16 are used to encode the next/tail of the template.
  1661. * - bits 17-32 are used to encode the previous/head of template.
  1662. *
  1663. * NODE: *duplicate* false implies that it is statically known that this binding will not collide
  1664. * with other bindings and therefore there is no need to check other bindings. For example the
  1665. * bindings in `<div [style.color]="exp" [style.width]="exp">` will never collide and will have
  1666. * their bits set accordingly. Previous duplicate means that we may need to check previous if the
  1667. * current binding is `null`. Next duplicate means that we may need to check next bindings if the
  1668. * current binding is not `null`.
  1669. *
  1670. * NOTE: `0` has special significance and represents `null` as in no additional pointer.
  1671. */
  1672. type TStylingRange = number & {
  1673. __brand__: 'TStylingRange';
  1674. };
  1675. /**
  1676. * A set of marker values to be used in the attributes arrays. These markers indicate that some
  1677. * items are not regular attributes and the processing should be adapted accordingly.
  1678. */
  1679. declare const enum AttributeMarker {
  1680. /**
  1681. * An implicit marker which indicates that the value in the array are of `attributeKey`,
  1682. * `attributeValue` format.
  1683. *
  1684. * NOTE: This is implicit as it is the type when no marker is present in array. We indicate that
  1685. * it should not be present at runtime by the negative number.
  1686. */
  1687. ImplicitAttributes = -1,
  1688. /**
  1689. * Marker indicates that the following 3 values in the attributes array are:
  1690. * namespaceUri, attributeName, attributeValue
  1691. * in that order.
  1692. */
  1693. NamespaceURI = 0,
  1694. /**
  1695. * Signals class declaration.
  1696. *
  1697. * Each value following `Classes` designates a class name to include on the element.
  1698. * ## Example:
  1699. *
  1700. * Given:
  1701. * ```html
  1702. * <div class="foo bar baz">...</div>
  1703. * ```
  1704. *
  1705. * the generated code is:
  1706. * ```ts
  1707. * var _c1 = [AttributeMarker.Classes, 'foo', 'bar', 'baz'];
  1708. * ```
  1709. */
  1710. Classes = 1,
  1711. /**
  1712. * Signals style declaration.
  1713. *
  1714. * Each pair of values following `Styles` designates a style name and value to include on the
  1715. * element.
  1716. * ## Example:
  1717. *
  1718. * Given:
  1719. * ```html
  1720. * <div style="width:100px; height:200px; color:red">...</div>
  1721. * ```
  1722. *
  1723. * the generated code is:
  1724. * ```ts
  1725. * var _c1 = [AttributeMarker.Styles, 'width', '100px', 'height'. '200px', 'color', 'red'];
  1726. * ```
  1727. */
  1728. Styles = 2,
  1729. /**
  1730. * Signals that the following attribute names were extracted from input or output bindings.
  1731. *
  1732. * For example, given the following HTML:
  1733. *
  1734. * ```html
  1735. * <div moo="car" [foo]="exp" (bar)="doSth()">
  1736. * ```
  1737. *
  1738. * the generated code is:
  1739. *
  1740. * ```ts
  1741. * var _c1 = ['moo', 'car', AttributeMarker.Bindings, 'foo', 'bar'];
  1742. * ```
  1743. */
  1744. Bindings = 3,
  1745. /**
  1746. * Signals that the following attribute names were hoisted from an inline-template declaration.
  1747. *
  1748. * For example, given the following HTML:
  1749. *
  1750. * ```html
  1751. * <div *ngFor="let value of values; trackBy:trackBy" dirA [dirB]="value">
  1752. * ```
  1753. *
  1754. * the generated code for the `template()` instruction would include:
  1755. *
  1756. * ```
  1757. * ['dirA', '', AttributeMarker.Bindings, 'dirB', AttributeMarker.Template, 'ngFor', 'ngForOf',
  1758. * 'ngForTrackBy', 'let-value']
  1759. * ```
  1760. *
  1761. * while the generated code for the `element()` instruction inside the template function would
  1762. * include:
  1763. *
  1764. * ```
  1765. * ['dirA', '', AttributeMarker.Bindings, 'dirB']
  1766. * ```
  1767. */
  1768. Template = 4,
  1769. /**
  1770. * Signals that the following attribute is `ngProjectAs` and its value is a parsed
  1771. * `CssSelector`.
  1772. *
  1773. * For example, given the following HTML:
  1774. *
  1775. * ```html
  1776. * <h1 attr="value" ngProjectAs="[title]">
  1777. * ```
  1778. *
  1779. * the generated code for the `element()` instruction would include:
  1780. *
  1781. * ```ts
  1782. * ['attr', 'value', AttributeMarker.ProjectAs, ['', 'title', '']]
  1783. * ```
  1784. */
  1785. ProjectAs = 5,
  1786. /**
  1787. * Signals that the following attribute will be translated by runtime i18n
  1788. *
  1789. * For example, given the following HTML:
  1790. *
  1791. * ```html
  1792. * <div moo="car" foo="value" i18n-foo [bar]="binding" i18n-bar>
  1793. * ```
  1794. *
  1795. * the generated code is:
  1796. *
  1797. * ```ts
  1798. * var _c1 = ['moo', 'car', AttributeMarker.I18n, 'foo', 'bar'];
  1799. * ```
  1800. */
  1801. I18n = 6
  1802. }
  1803. /**
  1804. * Expresses a single CSS Selector.
  1805. *
  1806. * Beginning of array
  1807. * - First index: element name
  1808. * - Subsequent odd indices: attr keys
  1809. * - Subsequent even indices: attr values
  1810. *
  1811. * After SelectorFlags.CLASS flag
  1812. * - Class name values
  1813. *
  1814. * SelectorFlags.NOT flag
  1815. * - Changes the mode to NOT
  1816. * - Can be combined with other flags to set the element / attr / class mode
  1817. *
  1818. * e.g. SelectorFlags.NOT | SelectorFlags.ELEMENT
  1819. *
  1820. * Example:
  1821. * Original: `div.foo.bar[attr1=val1][attr2]`
  1822. * Parsed: ['div', 'attr1', 'val1', 'attr2', '', SelectorFlags.CLASS, 'foo', 'bar']
  1823. *
  1824. * Original: 'div[attr1]:not(.foo[attr2])
  1825. * Parsed: [
  1826. * 'div', 'attr1', '',
  1827. * SelectorFlags.NOT | SelectorFlags.ATTRIBUTE 'attr2', '', SelectorFlags.CLASS, 'foo'
  1828. * ]
  1829. *
  1830. * See more examples in node_selector_matcher_spec.ts
  1831. */
  1832. type CssSelector = (string | SelectorFlags)[];
  1833. /**
  1834. * A list of CssSelectors.
  1835. *
  1836. * A directive or component can have multiple selectors. This type is used for
  1837. * directive defs so any of the selectors in the list will match that directive.
  1838. *
  1839. * Original: 'form, [ngForm]'
  1840. * Parsed: [['form'], ['', 'ngForm', '']]
  1841. */
  1842. type CssSelectorList = CssSelector[];
  1843. /**
  1844. * List of slots for a projection. A slot can be either based on a parsed CSS selector
  1845. * which will be used to determine nodes which are projected into that slot.
  1846. *
  1847. * When set to "*", the slot is reserved and can be used for multi-slot projection
  1848. * using {@link ViewContainerRef#createComponent}. The last slot that specifies the
  1849. * wildcard selector will retrieve all projectable nodes which do not match any selector.
  1850. */
  1851. type ProjectionSlots = (CssSelectorList | '*')[];
  1852. /** Flags used to build up CssSelectors */
  1853. declare const enum SelectorFlags {
  1854. /** Indicates this is the beginning of a new negative selector */
  1855. NOT = 1,
  1856. /** Mode for matching attributes */
  1857. ATTRIBUTE = 2,
  1858. /** Mode for matching tag names */
  1859. ELEMENT = 4,
  1860. /** Mode for matching class names */
  1861. CLASS = 8
  1862. }
  1863. /**
  1864. * TNodeType corresponds to the {@link TNode} `type` property.
  1865. *
  1866. * NOTE: type IDs are such that we use each bit to denote a type. This is done so that we can easily
  1867. * check if the `TNode` is of more than one type.
  1868. *
  1869. * `if (tNode.type === TNodeType.Text || tNode.type === TNode.Element)`
  1870. * can be written as:
  1871. * `if (tNode.type & (TNodeType.Text | TNodeType.Element))`
  1872. *
  1873. * However any given `TNode` can only be of one type.
  1874. */
  1875. declare const enum TNodeType {
  1876. /**
  1877. * The TNode contains information about a DOM element aka {@link RText}.
  1878. */
  1879. Text = 1,
  1880. /**
  1881. * The TNode contains information about a DOM element aka {@link RElement}.
  1882. */
  1883. Element = 2,
  1884. /**
  1885. * The TNode contains information about an {@link LContainer} for embedded views.
  1886. */
  1887. Container = 4,
  1888. /**
  1889. * The TNode contains information about an `<ng-container>` element {@link RNode}.
  1890. */
  1891. ElementContainer = 8,
  1892. /**
  1893. * The TNode contains information about an `<ng-content>` projection
  1894. */
  1895. Projection = 16,
  1896. /**
  1897. * The TNode contains information about an ICU comment used in `i18n`.
  1898. */
  1899. Icu = 32,
  1900. /**
  1901. * Special node type representing a placeholder for future `TNode` at this location.
  1902. *
  1903. * I18n translation blocks are created before the element nodes which they contain. (I18n blocks
  1904. * can span over many elements.) Because i18n `TNode`s (representing text) are created first they
  1905. * often may need to point to element `TNode`s which are not yet created. In such a case we create
  1906. * a `Placeholder` `TNode`. This allows the i18n to structurally link the `TNode`s together
  1907. * without knowing any information about the future nodes which will be at that location.
  1908. *
  1909. * On `firstCreatePass` When element instruction executes it will try to create a `TNode` at that
  1910. * location. Seeing a `Placeholder` `TNode` already there tells the system that it should reuse
  1911. * existing `TNode` (rather than create a new one) and just update the missing information.
  1912. */
  1913. Placeholder = 64,
  1914. /**
  1915. * The TNode contains information about a `@let` declaration.
  1916. */
  1917. LetDeclaration = 128,
  1918. AnyRNode = 3,// Text | Element
  1919. AnyContainer = 12
  1920. }
  1921. /**
  1922. * Corresponds to the TNode.flags property.
  1923. */
  1924. declare const enum TNodeFlags {
  1925. /** Bit #1 - This bit is set if the node is a host for any directive (including a component) */
  1926. isDirectiveHost = 1,
  1927. /** Bit #2 - This bit is set if the node has been projected */
  1928. isProjected = 2,
  1929. /** Bit #3 - This bit is set if any directive on this node has content queries */
  1930. hasContentQuery = 4,
  1931. /** Bit #4 - This bit is set if the node has any "class" inputs */
  1932. hasClassInput = 8,
  1933. /** Bit #5 - This bit is set if the node has any "style" inputs */
  1934. hasStyleInput = 16,
  1935. /** Bit #6 - This bit is set if the node has been detached by i18n */
  1936. isDetached = 32,
  1937. /**
  1938. * Bit #7 - This bit is set if the node has directives with host bindings.
  1939. *
  1940. * This flags allows us to guard host-binding logic and invoke it only on nodes
  1941. * that actually have directives with host bindings.
  1942. */
  1943. hasHostBindings = 64,
  1944. /**
  1945. * Bit #8 - This bit is set if the node is a located inside skip hydration block.
  1946. */
  1947. inSkipHydrationBlock = 128
  1948. }
  1949. /**
  1950. * Corresponds to the TNode.providerIndexes property.
  1951. */
  1952. declare const enum TNodeProviderIndexes {
  1953. /** The index of the first provider on this node is encoded on the least significant bits. */
  1954. ProvidersStartIndexMask = 1048575,
  1955. /**
  1956. * The count of view providers from the component on this node is
  1957. * encoded on the 20 most significant bits.
  1958. */
  1959. CptViewProvidersCountShift = 20,
  1960. CptViewProvidersCountShifter = 1048576
  1961. }
  1962. /**
  1963. * A combination of:
  1964. * - Attribute names and values.
  1965. * - Special markers acting as flags to alter attributes processing.
  1966. * - Parsed ngProjectAs selectors.
  1967. */
  1968. type TAttributes = (string | AttributeMarker | CssSelector)[];
  1969. /**
  1970. * Constants that are associated with a view. Includes:
  1971. * - Attribute arrays.
  1972. * - Local definition arrays.
  1973. * - Translated messages (i18n).
  1974. */
  1975. type TConstants = (TAttributes | string)[];
  1976. /**
  1977. * Factory function that returns an array of consts. Consts can be represented as a function in
  1978. * case any additional statements are required to define consts in the list. An example is i18n
  1979. * where additional i18n calls are generated, which should be executed when consts are requested
  1980. * for the first time.
  1981. */
  1982. type TConstantsFactory = () => TConstants;
  1983. /**
  1984. * TConstants type that describes how the `consts` field is generated on ComponentDef: it can be
  1985. * either an array or a factory function that returns that array.
  1986. */
  1987. type TConstantsOrFactory = TConstants | TConstantsFactory;
  1988. /**
  1989. * Binding data (flyweight) for a particular node that is shared between all templates
  1990. * of a specific type.
  1991. *
  1992. * If a property is:
  1993. * - PropertyAliases: that property's data was generated and this is it
  1994. * - Null: that property's data was already generated and nothing was found.
  1995. * - Undefined: that property's data has not yet been generated
  1996. *
  1997. * see: https://en.wikipedia.org/wiki/Flyweight_pattern for more on the Flyweight pattern
  1998. */
  1999. interface TNode {
  2000. /** The type of the TNode. See TNodeType. */
  2001. type: TNodeType;
  2002. /**
  2003. * Index of the TNode in TView.data and corresponding native element in LView.
  2004. *
  2005. * This is necessary to get from any TNode to its corresponding native element when
  2006. * traversing the node tree.
  2007. *
  2008. * If index is -1, this is a dynamically created container node or embedded view node.
  2009. */
  2010. index: number;
  2011. /**
  2012. * Insert before existing DOM node index.
  2013. *
  2014. * When DOM nodes are being inserted, normally they are being appended as they are created.
  2015. * Under i18n case, the translated text nodes are created ahead of time as part of the
  2016. * `ɵɵi18nStart` instruction which means that this `TNode` can't just be appended and instead
  2017. * needs to be inserted using `insertBeforeIndex` semantics.
  2018. *
  2019. * Additionally sometimes it is necessary to insert new text nodes as a child of this `TNode`. In
  2020. * such a case the value stores an array of text nodes to insert.
  2021. *
  2022. * Example:
  2023. * ```html
  2024. * <div i18n>
  2025. * Hello <span>World</span>!
  2026. * </div>
  2027. * ```
  2028. * In the above example the `ɵɵi18nStart` instruction can create `Hello `, `World` and `!` text
  2029. * nodes. It can also insert `Hello ` and `!` text node as a child of `<div>`, but it can't
  2030. * insert `World` because the `<span>` node has not yet been created. In such a case the
  2031. * `<span>` `TNode` will have an array which will direct the `<span>` to not only insert
  2032. * itself in front of `!` but also to insert the `World` (created by `ɵɵi18nStart`) into
  2033. * `<span>` itself.
  2034. *
  2035. * Pseudo code:
  2036. * ```ts
  2037. * if (insertBeforeIndex === null) {
  2038. * // append as normal
  2039. * } else if (Array.isArray(insertBeforeIndex)) {
  2040. * // First insert current `TNode` at correct location
  2041. * const currentNode = lView[this.index];
  2042. * parentNode.insertBefore(currentNode, lView[this.insertBeforeIndex[0]]);
  2043. * // Now append all of the children
  2044. * for(let i=1; i<this.insertBeforeIndex; i++) {
  2045. * currentNode.appendChild(lView[this.insertBeforeIndex[i]]);
  2046. * }
  2047. * } else {
  2048. * parentNode.insertBefore(lView[this.index], lView[this.insertBeforeIndex])
  2049. * }
  2050. * ```
  2051. * - null: Append as normal using `parentNode.appendChild`
  2052. * - `number`: Append using
  2053. * `parentNode.insertBefore(lView[this.index], lView[this.insertBeforeIndex])`
  2054. *
  2055. * *Initialization*
  2056. *
  2057. * Because `ɵɵi18nStart` executes before nodes are created, on `TView.firstCreatePass` it is not
  2058. * possible for `ɵɵi18nStart` to set the `insertBeforeIndex` value as the corresponding `TNode`
  2059. * has not yet been created. For this reason the `ɵɵi18nStart` creates a `TNodeType.Placeholder`
  2060. * `TNode` at that location. See `TNodeType.Placeholder` for more information.
  2061. */
  2062. insertBeforeIndex: InsertBeforeIndex;
  2063. /**
  2064. * The index of the closest injector in this node's LView.
  2065. *
  2066. * If the index === -1, there is no injector on this node or any ancestor node in this view.
  2067. *
  2068. * If the index !== -1, it is the index of this node's injector OR the index of a parent
  2069. * injector in the same view. We pass the parent injector index down the node tree of a view so
  2070. * it's possible to find the parent injector without walking a potentially deep node tree.
  2071. * Injector indices are not set across view boundaries because there could be multiple component
  2072. * hosts.
  2073. *
  2074. * If tNode.injectorIndex === tNode.parent.injectorIndex, then the index belongs to a parent
  2075. * injector.
  2076. */
  2077. injectorIndex: number;
  2078. /** Stores starting index of the directives. */
  2079. directiveStart: number;
  2080. /**
  2081. * Stores final exclusive index of the directives.
  2082. *
  2083. * The area right behind the `directiveStart-directiveEnd` range is used to allocate the
  2084. * `HostBindingFunction` `vars` (or null if no bindings.) Therefore `directiveEnd` is used to set
  2085. * `LFrame.bindingRootIndex` before `HostBindingFunction` is executed.
  2086. */
  2087. directiveEnd: number;
  2088. /**
  2089. * Offset from the `directiveStart` at which the component (one at most) of the node is stored.
  2090. * Set to -1 if no components have been applied to the node. Component index can be found using
  2091. * `directiveStart + componentOffset`.
  2092. */
  2093. componentOffset: number;
  2094. /**
  2095. * Stores the last directive which had a styling instruction.
  2096. *
  2097. * Initial value of this is `-1` which means that no `hostBindings` styling instruction has
  2098. * executed. As `hostBindings` instructions execute they set the value to the index of the
  2099. * `DirectiveDef` which contained the last `hostBindings` styling instruction.
  2100. *
  2101. * Valid values are:
  2102. * - `-1` No `hostBindings` instruction has executed.
  2103. * - `directiveStart <= directiveStylingLast < directiveEnd`: Points to the `DirectiveDef` of
  2104. * the last styling instruction which executed in the `hostBindings`.
  2105. *
  2106. * This data is needed so that styling instructions know which static styling data needs to be
  2107. * collected from the `DirectiveDef.hostAttrs`. A styling instruction needs to collect all data
  2108. * since last styling instruction.
  2109. */
  2110. directiveStylingLast: number;
  2111. /**
  2112. * Stores indexes of property bindings. This field is only set in the ngDevMode and holds
  2113. * indexes of property bindings so TestBed can get bound property metadata for a given node.
  2114. */
  2115. propertyBindings: number[] | null;
  2116. /**
  2117. * Stores if Node isComponent, isProjected, hasContentQuery, hasClassInput and hasStyleInput
  2118. * etc.
  2119. */
  2120. flags: TNodeFlags;
  2121. /**
  2122. * This number stores two values using its bits:
  2123. *
  2124. * - the index of the first provider on that node (first 16 bits)
  2125. * - the count of view providers from the component on this node (last 16 bits)
  2126. */
  2127. providerIndexes: TNodeProviderIndexes;
  2128. /**
  2129. * The value name associated with this node.
  2130. * if type:
  2131. * `TNodeType.Text`: text value
  2132. * `TNodeType.Element`: tag name
  2133. * `TNodeType.ICUContainer`: `TIcu`
  2134. */
  2135. value: any;
  2136. /**
  2137. * Attributes associated with an element. We need to store attributes to support various
  2138. * use-cases (attribute injection, content projection with selectors, directives matching).
  2139. * Attributes are stored statically because reading them from the DOM would be way too slow for
  2140. * content projection and queries.
  2141. *
  2142. * Since attrs will always be calculated first, they will never need to be marked undefined by
  2143. * other instructions.
  2144. *
  2145. * For regular attributes a name of an attribute and its value alternate in the array.
  2146. * e.g. ['role', 'checkbox']
  2147. * This array can contain flags that will indicate "special attributes" (attributes with
  2148. * namespaces, attributes extracted from bindings and outputs).
  2149. */
  2150. attrs: TAttributes | null;
  2151. /**
  2152. * Same as `TNode.attrs` but contains merged data across all directive host bindings.
  2153. *
  2154. * We need to keep `attrs` as unmerged so that it can be used for attribute selectors.
  2155. * We merge attrs here so that it can be used in a performant way for initial rendering.
  2156. *
  2157. * The `attrs` are merged in first pass in following order:
  2158. * - Component's `hostAttrs`
  2159. * - Directives' `hostAttrs`
  2160. * - Template `TNode.attrs` associated with the current `TNode`.
  2161. */
  2162. mergedAttrs: TAttributes | null;
  2163. /**
  2164. * A set of local names under which a given element is exported in a template and
  2165. * visible to queries. An entry in this array can be created for different reasons:
  2166. * - an element itself is referenced, ex.: `<div #foo>`
  2167. * - a component is referenced, ex.: `<my-cmpt #foo>`
  2168. * - a directive is referenced, ex.: `<my-cmpt #foo="directiveExportAs">`.
  2169. *
  2170. * A given element might have different local names and those names can be associated
  2171. * with a directive. We store local names at even indexes while odd indexes are reserved
  2172. * for directive index in a view (or `-1` if there is no associated directive).
  2173. *
  2174. * Some examples:
  2175. * - `<div #foo>` => `["foo", -1]`
  2176. * - `<my-cmpt #foo>` => `["foo", myCmptIdx]`
  2177. * - `<my-cmpt #foo #bar="directiveExportAs">` => `["foo", myCmptIdx, "bar", directiveIdx]`
  2178. * - `<div #foo #bar="directiveExportAs">` => `["foo", -1, "bar", directiveIdx]`
  2179. */
  2180. localNames: (string | number)[] | null;
  2181. /** Information about input properties that need to be set once from attribute data. */
  2182. initialInputs: InitialInputData | null;
  2183. /**
  2184. * Input data for all directives on this node. `null` means that there are no directives with
  2185. * inputs on this node.
  2186. */
  2187. inputs: NodeInputBindings | null;
  2188. /**
  2189. * Input data for host directives applied to the node.
  2190. */
  2191. hostDirectiveInputs: HostDirectiveInputs | null;
  2192. /**
  2193. * Output data for all directives on this node. `null` means that there are no directives with
  2194. * outputs on this node.
  2195. */
  2196. outputs: NodeOutputBindings | null;
  2197. /**
  2198. * Input data for host directives applied to the node.
  2199. */
  2200. hostDirectiveOutputs: HostDirectiveOutputs | null;
  2201. /**
  2202. * Mapping between directive classes applied to the node and their indexes.
  2203. */
  2204. directiveToIndex: DirectiveIndexMap | null;
  2205. /**
  2206. * The TView attached to this node.
  2207. *
  2208. * If this TNode corresponds to an LContainer with a template (e.g. structural
  2209. * directive), the template's TView will be stored here.
  2210. *
  2211. * If this TNode corresponds to an element, tView will be `null`.
  2212. */
  2213. tView: TView | null;
  2214. /**
  2215. * The next sibling node. Necessary so we can propagate through the root nodes of a view
  2216. * to insert them or remove them from the DOM.
  2217. */
  2218. next: TNode | null;
  2219. /**
  2220. * The previous sibling node.
  2221. * This simplifies operations when we need a pointer to the previous node.
  2222. */
  2223. prev: TNode | null;
  2224. /**
  2225. * The next projected sibling. Since in Angular content projection works on the node-by-node
  2226. * basis the act of projecting nodes might change nodes relationship at the insertion point
  2227. * (target view). At the same time we need to keep initial relationship between nodes as
  2228. * expressed in content view.
  2229. */
  2230. projectionNext: TNode | null;
  2231. /**
  2232. * First child of the current node.
  2233. *
  2234. * For component nodes, the child will always be a ContentChild (in same view).
  2235. * For embedded view nodes, the child will be in their child view.
  2236. */
  2237. child: TNode | null;
  2238. /**
  2239. * Parent node (in the same view only).
  2240. *
  2241. * We need a reference to a node's parent so we can append the node to its parent's native
  2242. * element at the appropriate time.
  2243. *
  2244. * If the parent would be in a different view (e.g. component host), this property will be null.
  2245. * It's important that we don't try to cross component boundaries when retrieving the parent
  2246. * because the parent will change (e.g. index, attrs) depending on where the component was
  2247. * used (and thus shouldn't be stored on TNode). In these cases, we retrieve the parent through
  2248. * LView.node instead (which will be instance-specific).
  2249. *
  2250. * If this is an inline view node (V), the parent will be its container.
  2251. */
  2252. parent: TElementNode | TContainerNode | null;
  2253. /**
  2254. * List of projected TNodes for a given component host element OR index into the said nodes.
  2255. *
  2256. * For easier discussion assume this example:
  2257. * `<parent>`'s view definition:
  2258. * ```html
  2259. * <child id="c1">content1</child>
  2260. * <child id="c2"><span>content2</span></child>
  2261. * ```
  2262. * `<child>`'s view definition:
  2263. * ```html
  2264. * <ng-content id="cont1"></ng-content>
  2265. * ```
  2266. *
  2267. * If `Array.isArray(projection)` then `TNode` is a host element:
  2268. * - `projection` stores the content nodes which are to be projected.
  2269. * - The nodes represent categories defined by the selector: For example:
  2270. * `<ng-content/><ng-content select="abc"/>` would represent the heads for `<ng-content/>`
  2271. * and `<ng-content select="abc"/>` respectively.
  2272. * - The nodes we store in `projection` are heads only, we used `.next` to get their
  2273. * siblings.
  2274. * - The nodes `.next` is sorted/rewritten as part of the projection setup.
  2275. * - `projection` size is equal to the number of projections `<ng-content>`. The size of
  2276. * `c1` will be `1` because `<child>` has only one `<ng-content>`.
  2277. * - we store `projection` with the host (`c1`, `c2`) rather than the `<ng-content>` (`cont1`)
  2278. * because the same component (`<child>`) can be used in multiple locations (`c1`, `c2`) and
  2279. * as a result have different set of nodes to project.
  2280. * - without `projection` it would be difficult to efficiently traverse nodes to be projected.
  2281. *
  2282. * If `typeof projection == 'number'` then `TNode` is a `<ng-content>` element:
  2283. * - `projection` is an index of the host's `projection`Nodes.
  2284. * - This would return the first head node to project:
  2285. * `getHost(currentTNode).projection[currentTNode.projection]`.
  2286. * - When projecting nodes the parent node retrieved may be a `<ng-content>` node, in which case
  2287. * the process is recursive in nature.
  2288. *
  2289. * If `projection` is of type `RNode[][]` than we have a collection of native nodes passed as
  2290. * projectable nodes during dynamic component creation.
  2291. */
  2292. projection: (TNode | RNode[])[] | number | null;
  2293. /**
  2294. * A collection of all `style` static values for an element (including from host).
  2295. *
  2296. * This field will be populated if and when:
  2297. *
  2298. * - There are one or more initial `style`s on an element (e.g. `<div style="width:200px;">`)
  2299. * - There are one or more initial `style`s on a directive/component host
  2300. * (e.g. `@Directive({host: {style: "width:200px;" } }`)
  2301. */
  2302. styles: string | null;
  2303. /**
  2304. * A collection of all `style` static values for an element excluding host sources.
  2305. *
  2306. * Populated when there are one or more initial `style`s on an element
  2307. * (e.g. `<div style="width:200px;">`)
  2308. * Must be stored separately from `tNode.styles` to facilitate setting directive
  2309. * inputs that shadow the `style` property. If we used `tNode.styles` as is for shadowed inputs,
  2310. * we would feed host styles back into directives as "inputs". If we used `tNode.attrs`, we
  2311. * would have to concatenate the attributes on every template pass. Instead, we process once on
  2312. * first create pass and store here.
  2313. */
  2314. stylesWithoutHost: string | null;
  2315. /**
  2316. * A `KeyValueArray` version of residual `styles`.
  2317. *
  2318. * When there are styling instructions than each instruction stores the static styling
  2319. * which is of lower priority than itself. This means that there may be a higher priority
  2320. * styling than the instruction.
  2321. *
  2322. * Imagine:
  2323. * ```angular-ts
  2324. * <div style="color: highest;" my-dir>
  2325. *
  2326. * @Directive({
  2327. * host: {
  2328. * style: 'color: lowest; ',
  2329. * '[styles.color]': 'exp' // ɵɵstyleProp('color', ctx.exp);
  2330. * }
  2331. * })
  2332. * ```
  2333. *
  2334. * In the above case:
  2335. * - `color: lowest` is stored with `ɵɵstyleProp('color', ctx.exp);` instruction
  2336. * - `color: highest` is the residual and is stored here.
  2337. *
  2338. * - `undefined': not initialized.
  2339. * - `null`: initialized but `styles` is `null`
  2340. * - `KeyValueArray`: parsed version of `styles`.
  2341. */
  2342. residualStyles: KeyValueArray<any> | undefined | null;
  2343. /**
  2344. * A collection of all class static values for an element (including from host).
  2345. *
  2346. * This field will be populated if and when:
  2347. *
  2348. * - There are one or more initial classes on an element (e.g. `<div class="one two three">`)
  2349. * - There are one or more initial classes on an directive/component host
  2350. * (e.g. `@Directive({host: {class: "SOME_CLASS" } }`)
  2351. */
  2352. classes: string | null;
  2353. /**
  2354. * A collection of all class static values for an element excluding host sources.
  2355. *
  2356. * Populated when there are one or more initial classes on an element
  2357. * (e.g. `<div class="SOME_CLASS">`)
  2358. * Must be stored separately from `tNode.classes` to facilitate setting directive
  2359. * inputs that shadow the `class` property. If we used `tNode.classes` as is for shadowed
  2360. * inputs, we would feed host classes back into directives as "inputs". If we used
  2361. * `tNode.attrs`, we would have to concatenate the attributes on every template pass. Instead,
  2362. * we process once on first create pass and store here.
  2363. */
  2364. classesWithoutHost: string | null;
  2365. /**
  2366. * A `KeyValueArray` version of residual `classes`.
  2367. *
  2368. * Same as `TNode.residualStyles` but for classes.
  2369. *
  2370. * - `undefined': not initialized.
  2371. * - `null`: initialized but `classes` is `null`
  2372. * - `KeyValueArray`: parsed version of `classes`.
  2373. */
  2374. residualClasses: KeyValueArray<any> | undefined | null;
  2375. /**
  2376. * Stores the head/tail index of the class bindings.
  2377. *
  2378. * - If no bindings, the head and tail will both be 0.
  2379. * - If there are template bindings, stores the head/tail of the class bindings in the template.
  2380. * - If no template bindings but there are host bindings, the head value will point to the last
  2381. * host binding for "class" (not the head of the linked list), tail will be 0.
  2382. *
  2383. * See: `style_binding_list.ts` for details.
  2384. *
  2385. * This is used by `insertTStylingBinding` to know where the next styling binding should be
  2386. * inserted so that they can be sorted in priority order.
  2387. */
  2388. classBindings: TStylingRange;
  2389. /**
  2390. * Stores the head/tail index of the class bindings.
  2391. *
  2392. * - If no bindings, the head and tail will both be 0.
  2393. * - If there are template bindings, stores the head/tail of the style bindings in the template.
  2394. * - If no template bindings but there are host bindings, the head value will point to the last
  2395. * host binding for "style" (not the head of the linked list), tail will be 0.
  2396. *
  2397. * See: `style_binding_list.ts` for details.
  2398. *
  2399. * This is used by `insertTStylingBinding` to know where the next styling binding should be
  2400. * inserted so that they can be sorted in priority order.
  2401. */
  2402. styleBindings: TStylingRange;
  2403. }
  2404. /**
  2405. * See `TNode.insertBeforeIndex`
  2406. */
  2407. type InsertBeforeIndex = null | number | number[];
  2408. /** Static data for an element */
  2409. interface TElementNode extends TNode {
  2410. /** Index in the data[] array */
  2411. index: number;
  2412. child: TElementNode | TTextNode | TElementContainerNode | TContainerNode | TProjectionNode | null;
  2413. /**
  2414. * Element nodes will have parents unless they are the first node of a component or
  2415. * embedded view (which means their parent is in a different view and must be
  2416. * retrieved using viewData[HOST_NODE]).
  2417. */
  2418. parent: TElementNode | TElementContainerNode | null;
  2419. tView: null;
  2420. /**
  2421. * If this is a component TNode with projection, this will be an array of projected
  2422. * TNodes or native nodes (see TNode.projection for more info). If it's a regular element node
  2423. * or a component without projection, it will be null.
  2424. */
  2425. projection: (TNode | RNode[])[] | null;
  2426. /**
  2427. * Stores TagName
  2428. */
  2429. value: string;
  2430. }
  2431. /** Static data for a text node */
  2432. interface TTextNode extends TNode {
  2433. /** Index in the data[] array */
  2434. index: number;
  2435. child: null;
  2436. /**
  2437. * Text nodes will have parents unless they are the first node of a component or
  2438. * embedded view (which means their parent is in a different view and must be
  2439. * retrieved using LView.node).
  2440. */
  2441. parent: TElementNode | TElementContainerNode | null;
  2442. tView: null;
  2443. projection: null;
  2444. }
  2445. /** Static data for an LContainer */
  2446. interface TContainerNode extends TNode {
  2447. /**
  2448. * Index in the data[] array.
  2449. *
  2450. * If it's -1, this is a dynamically created container node that isn't stored in
  2451. * data[] (e.g. when you inject ViewContainerRef) .
  2452. */
  2453. index: number;
  2454. child: null;
  2455. /**
  2456. * Container nodes will have parents unless:
  2457. *
  2458. * - They are the first node of a component or embedded view
  2459. * - They are dynamically created
  2460. */
  2461. parent: TElementNode | TElementContainerNode | null;
  2462. tView: TView | null;
  2463. projection: null;
  2464. value: null;
  2465. }
  2466. /** Static data for an <ng-container> */
  2467. interface TElementContainerNode extends TNode {
  2468. /** Index in the LView[] array. */
  2469. index: number;
  2470. child: TElementNode | TTextNode | TContainerNode | TElementContainerNode | TProjectionNode | null;
  2471. parent: TElementNode | TElementContainerNode | null;
  2472. tView: null;
  2473. projection: null;
  2474. }
  2475. /** Static data for an LProjectionNode */
  2476. interface TProjectionNode extends TNode {
  2477. /** Index in the data[] array */
  2478. child: null;
  2479. /**
  2480. * Projection nodes will have parents unless they are the first node of a component
  2481. * or embedded view (which means their parent is in a different view and must be
  2482. * retrieved using LView.node).
  2483. */
  2484. parent: TElementNode | TElementContainerNode | null;
  2485. tView: null;
  2486. /** Index of the projection node. (See TNode.projection for more info.) */
  2487. projection: number;
  2488. value: null;
  2489. }
  2490. /**
  2491. * Maps the public names of outputs available on a specific node to the index
  2492. * of the directive instance that defines the output, for example:
  2493. *
  2494. * ```
  2495. * {
  2496. * "publicName": [0, 5]
  2497. * }
  2498. * ```
  2499. */
  2500. type NodeOutputBindings = Record<string, number[]>;
  2501. /**
  2502. * Maps the public names of inputs applied to a specific node to the index of the
  2503. * directive instance to which the input value should be written, for example:
  2504. *
  2505. * ```
  2506. * {
  2507. * "publicName": [0, 5]
  2508. * }
  2509. * ```
  2510. */
  2511. type NodeInputBindings = Record<string, number[]>;
  2512. /**
  2513. * This array contains information about input properties that
  2514. * need to be set once from attribute data. It's ordered by
  2515. * directive index (relative to element) so it's simple to
  2516. * look up a specific directive's initial input data.
  2517. *
  2518. * Within each sub-array:
  2519. *
  2520. * i+0: public name
  2521. * i+1: initial value
  2522. *
  2523. * If a directive on a node does not have any input properties
  2524. * that should be set from attributes, its index is set to null
  2525. * to avoid a sparse array.
  2526. *
  2527. * e.g. [null, ['role-min', 'minified-input', 'button']]
  2528. */
  2529. type InitialInputData = (InitialInputs | null)[];
  2530. /**
  2531. * Used by InitialInputData to store input properties
  2532. * that should be set once from attributes.
  2533. *
  2534. * i+0: attribute name
  2535. * i+1: minified/internal input name
  2536. * i+2: input flags
  2537. * i+3: initial value
  2538. *
  2539. * e.g. ['role-min', 'minified-input', 'button']
  2540. */
  2541. type InitialInputs = string[];
  2542. /**
  2543. * Represents inputs coming from a host directive and exposed on a TNode.
  2544. *
  2545. * - The key is the public name of an input as it is exposed on the specific node.
  2546. * - The value is an array where:
  2547. * - i+0: Index of the host directive that should be written to.
  2548. * - i+1: Public name of the input as it was defined on the host directive before aliasing.
  2549. */
  2550. type HostDirectiveInputs = Record<string, (number | string)[]>;
  2551. /**
  2552. * Represents outputs coming from a host directive and exposed on a TNode.
  2553. *
  2554. * - The key is the public name of an output as it is exposed on the specific node.
  2555. * - The value is an array where:
  2556. * - i+0: Index of the host directive on which the output is defined..
  2557. * - i+1: Public name of the output as it was defined on the host directive before aliasing.
  2558. */
  2559. type HostDirectiveOutputs = Record<string, (number | string)[]>;
  2560. /**
  2561. * Represents a map between a class reference and the index at which its directive is available on
  2562. * a specific TNode. The value can be either:
  2563. * 1. A number means that there's only one selector-matched directive on the node and it
  2564. * doesn't have any host directives.
  2565. * 2. An array means that there's a selector-matched directive and it has host directives.
  2566. * The array is structured as follows:
  2567. * - 0: Index of the selector-matched directive.
  2568. * - 1: Start index of the range within which the host directives are defined.
  2569. * - 2: End of the host directive range.
  2570. *
  2571. * Example:
  2572. * ```
  2573. * Map {
  2574. * [NoHostDirectives]: 5,
  2575. * [HasHostDirectives]: [10, 6, 8],
  2576. * }
  2577. * ```
  2578. */
  2579. type DirectiveIndexMap = Map<Type$1<unknown>, number | [directiveIndex: number, hostDirectivesStart: number, hostDirectivesEnd: number]>;
  2580. /**
  2581. * Type representing a set of TNodes that can have local refs (`#foo`) placed on them.
  2582. */
  2583. type TNodeWithLocalRefs = TContainerNode | TElementNode | TElementContainerNode;
  2584. /**
  2585. * Type for a function that extracts a value for a local refs.
  2586. * Example:
  2587. * - `<div #nativeDivEl>` - `nativeDivEl` should point to the native `<div>` element;
  2588. * - `<ng-template #tplRef>` - `tplRef` should point to the `TemplateRef` instance;
  2589. */
  2590. type LocalRefExtractor = (tNode: TNodeWithLocalRefs, currentView: LView) => any;
  2591. /**
  2592. * Special location which allows easy identification of type. If we have an array which was
  2593. * retrieved from the `LView` and that array has `true` at `TYPE` location, we know it is
  2594. * `LContainer`.
  2595. */
  2596. declare const TYPE = 1;
  2597. /**
  2598. * Below are constants for LContainer indices to help us look up LContainer members
  2599. * without having to remember the specific indices.
  2600. * Uglify will inline these when minifying so there shouldn't be a cost.
  2601. */
  2602. declare const DEHYDRATED_VIEWS = 6;
  2603. declare const NATIVE = 7;
  2604. declare const VIEW_REFS = 8;
  2605. declare const MOVED_VIEWS = 9;
  2606. /**
  2607. * Size of LContainer's header. Represents the index after which all views in the
  2608. * container will be inserted. We need to keep a record of current views so we know
  2609. * which views are already in the DOM (and don't need to be re-added) and so we can
  2610. * remove views from the DOM when they are no longer required.
  2611. */
  2612. declare const CONTAINER_HEADER_OFFSET = 10;
  2613. /**
  2614. * The state associated with a container.
  2615. *
  2616. * This is an array so that its structure is closer to LView. This helps
  2617. * when traversing the view tree (which is a mix of containers and component
  2618. * views), so we can jump to viewOrContainer[NEXT] in the same way regardless
  2619. * of type.
  2620. */
  2621. interface LContainer extends Array<any> {
  2622. /**
  2623. * The host element of this LContainer.
  2624. *
  2625. * The host could be an LView if this container is on a component node.
  2626. * In that case, the component LView is its HOST.
  2627. */
  2628. readonly [HOST]: RElement | RComment | LView;
  2629. /**
  2630. * This is a type field which allows us to differentiate `LContainer` from `StylingContext` in an
  2631. * efficient way. The value is always set to `true`
  2632. */
  2633. [TYPE]: true;
  2634. /** Flags for this container. See LContainerFlags for more info. */
  2635. [FLAGS]: LContainerFlags;
  2636. /**
  2637. * Access to the parent view is necessary so we can propagate back
  2638. * up from inside a container to parent[NEXT].
  2639. */
  2640. [PARENT]: LView;
  2641. /**
  2642. * This allows us to jump from a container to a sibling container or component
  2643. * view with the same parent, so we can remove listeners efficiently.
  2644. */
  2645. [NEXT]: LView | LContainer | null;
  2646. /**
  2647. * A collection of views created based on the underlying `<ng-template>` element but inserted into
  2648. * a different `LContainer`. We need to track views created from a given declaration point since
  2649. * queries collect matches from the embedded view declaration point and _not_ the insertion point.
  2650. */
  2651. [MOVED_VIEWS]: LView[] | null;
  2652. /**
  2653. * Pointer to the `TNode` which represents the host of the container.
  2654. */
  2655. [T_HOST]: TNode;
  2656. /** The comment element that serves as an anchor for this LContainer. */
  2657. [NATIVE]: RComment;
  2658. /**
  2659. * Array of `ViewRef`s used by any `ViewContainerRef`s that point to this container.
  2660. *
  2661. * This is lazily initialized by `ViewContainerRef` when the first view is inserted.
  2662. *
  2663. * NOTE: This is stored as `any[]` because render3 should really not be aware of `ViewRef` and
  2664. * doing so creates circular dependency.
  2665. */
  2666. [VIEW_REFS]: unknown[] | null;
  2667. /**
  2668. * Array of dehydrated views within this container.
  2669. *
  2670. * This information is used during the hydration process on the client.
  2671. * The hydration logic tries to find a matching dehydrated view, "claim" it
  2672. * and use this information to do further matching. After that, this "claimed"
  2673. * view is removed from the list. The remaining "unclaimed" views are
  2674. * "garbage-collected" later on, i.e. removed from the DOM once the hydration
  2675. * logic finishes.
  2676. */
  2677. [DEHYDRATED_VIEWS]: DehydratedContainerView[] | null;
  2678. }
  2679. /** Flags associated with an LContainer (saved in LContainer[FLAGS]) */
  2680. declare const enum LContainerFlags {
  2681. None = 0,
  2682. /**
  2683. * Flag to signify that this `LContainer` may have transplanted views which need to be change
  2684. * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`.
  2685. *
  2686. * This flag, once set, is never unset for the `LContainer`.
  2687. */
  2688. HasTransplantedViews = 2
  2689. }
  2690. declare global {
  2691. /**
  2692. * Values of ngDevMode
  2693. * Depending on the current state of the application, ngDevMode may have one of several values.
  2694. *
  2695. * For convenience, the “truthy” value which enables dev mode is also an object which contains
  2696. * Angular’s performance counters. This is not necessary, but cuts down on boilerplate for the
  2697. * perf counters.
  2698. *
  2699. * ngDevMode may also be set to false. This can happen in one of a few ways:
  2700. * - The user explicitly sets `window.ngDevMode = false` somewhere in their app.
  2701. * - The user calls `enableProdMode()`.
  2702. * - The URL contains a `ngDevMode=false` text.
  2703. * Finally, ngDevMode may not have been defined at all.
  2704. */
  2705. const ngDevMode: null | NgDevModePerfCounters;
  2706. interface NgDevModePerfCounters {
  2707. namedConstructors: boolean;
  2708. firstCreatePass: number;
  2709. tNode: number;
  2710. tView: number;
  2711. rendererCreateTextNode: number;
  2712. rendererSetText: number;
  2713. rendererCreateElement: number;
  2714. rendererAddEventListener: number;
  2715. rendererSetAttribute: number;
  2716. rendererRemoveAttribute: number;
  2717. rendererSetProperty: number;
  2718. rendererSetClassName: number;
  2719. rendererAddClass: number;
  2720. rendererRemoveClass: number;
  2721. rendererSetStyle: number;
  2722. rendererRemoveStyle: number;
  2723. rendererDestroy: number;
  2724. rendererDestroyNode: number;
  2725. rendererMoveNode: number;
  2726. rendererRemoveNode: number;
  2727. rendererAppendChild: number;
  2728. rendererInsertBefore: number;
  2729. rendererCreateComment: number;
  2730. hydratedNodes: number;
  2731. hydratedComponents: number;
  2732. dehydratedViewsRemoved: number;
  2733. dehydratedViewsCleanupRuns: number;
  2734. componentsSkippedHydration: number;
  2735. deferBlocksWithIncrementalHydration: number;
  2736. }
  2737. }
  2738. /**
  2739. * Injection flags for DI.
  2740. *
  2741. * @publicApi
  2742. * @deprecated use an options object for [`inject`](api/core/inject) instead.
  2743. */
  2744. declare enum InjectFlags {
  2745. /** Check self and check parent injector if needed */
  2746. Default = 0,
  2747. /**
  2748. * Specifies that an injector should retrieve a dependency from any injector until reaching the
  2749. * host element of the current component. (Only used with Element Injector)
  2750. */
  2751. Host = 1,
  2752. /** Don't ascend to ancestors of the node requesting injection. */
  2753. Self = 2,
  2754. /** Skip the node that is requesting injection. */
  2755. SkipSelf = 4,
  2756. /** Inject `defaultValue` instead if token not found. */
  2757. Optional = 8
  2758. }
  2759. /**
  2760. * This enum is an exact copy of the `InjectFlags` enum above, but the difference is that this is a
  2761. * const enum, so actual enum values would be inlined in generated code. The `InjectFlags` enum can
  2762. * be turned into a const enum when ViewEngine is removed (see TODO at the `InjectFlags` enum
  2763. * above). The benefit of inlining is that we can use these flags at the top level without affecting
  2764. * tree-shaking (see "no-toplevel-property-access" tslint rule for more info).
  2765. * Keep this enum in sync with `InjectFlags` enum above.
  2766. */
  2767. declare const enum InternalInjectFlags {
  2768. /** Check self and check parent injector if needed */
  2769. Default = 0,
  2770. /**
  2771. * Specifies that an injector should retrieve a dependency from any injector until reaching the
  2772. * host element of the current component. (Only used with Element Injector)
  2773. */
  2774. Host = 1,
  2775. /** Don't ascend to ancestors of the node requesting injection. */
  2776. Self = 2,
  2777. /** Skip the node that is requesting injection. */
  2778. SkipSelf = 4,
  2779. /** Inject `defaultValue` instead if token not found. */
  2780. Optional = 8,
  2781. /**
  2782. * This token is being injected into a pipe.
  2783. *
  2784. * This flag is intentionally not in the public facing `InjectFlags` because it is only added by
  2785. * the compiler and is not a developer applicable flag.
  2786. */
  2787. ForPipe = 16
  2788. }
  2789. /**
  2790. * Type of the options argument to [`inject`](api/core/inject).
  2791. *
  2792. * @publicApi
  2793. */
  2794. interface InjectOptions {
  2795. /**
  2796. * Use optional injection, and return `null` if the requested token is not found.
  2797. */
  2798. optional?: boolean;
  2799. /**
  2800. * Start injection at the parent of the current injector.
  2801. */
  2802. skipSelf?: boolean;
  2803. /**
  2804. * Only query the current injector for the token, and don't fall back to the parent injector if
  2805. * it's not found.
  2806. */
  2807. self?: boolean;
  2808. /**
  2809. * Stop injection at the host component's injector. Only relevant when injecting from an element
  2810. * injector, and a no-op for environment injectors.
  2811. */
  2812. host?: boolean;
  2813. }
  2814. /**
  2815. * @description
  2816. *
  2817. * Token that can be used to retrieve an instance from an injector or through a query.
  2818. *
  2819. * @publicApi
  2820. */
  2821. type ProviderToken<T> = Type$1<T> | AbstractType<T> | InjectionToken<T>;
  2822. /**
  2823. * Concrete injectors implement this interface. Injectors are configured
  2824. * with [providers](guide/di/dependency-injection-providers) that associate
  2825. * dependencies of various types with [injection tokens](guide/di/dependency-injection-providers).
  2826. *
  2827. * @see [DI Providers](guide/di/dependency-injection-providers).
  2828. * @see {@link StaticProvider}
  2829. *
  2830. * @usageNotes
  2831. *
  2832. * The following example creates a service injector instance.
  2833. *
  2834. * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
  2835. *
  2836. * ### Usage example
  2837. *
  2838. * {@example core/di/ts/injector_spec.ts region='Injector'}
  2839. *
  2840. * `Injector` returns itself when given `Injector` as a token:
  2841. *
  2842. * {@example core/di/ts/injector_spec.ts region='injectInjector'}
  2843. *
  2844. * @publicApi
  2845. */
  2846. declare abstract class Injector {
  2847. static THROW_IF_NOT_FOUND: {};
  2848. static NULL: Injector;
  2849. /**
  2850. * Internal note on the `options?: InjectOptions|InjectFlags` override of the `get`
  2851. * method: consider dropping the `InjectFlags` part in one of the major versions.
  2852. * It can **not** be done in minor/patch, since it's breaking for custom injectors
  2853. * that only implement the old `InjectorFlags` interface.
  2854. */
  2855. /**
  2856. * Retrieves an instance from the injector based on the provided token.
  2857. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  2858. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  2859. */
  2860. abstract get<T>(token: ProviderToken<T>, notFoundValue: undefined, options: InjectOptions & {
  2861. optional?: false;
  2862. }): T;
  2863. /**
  2864. * Retrieves an instance from the injector based on the provided token.
  2865. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  2866. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  2867. */
  2868. abstract get<T>(token: ProviderToken<T>, notFoundValue: null | undefined, options: InjectOptions): T | null;
  2869. /**
  2870. * Retrieves an instance from the injector based on the provided token.
  2871. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  2872. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  2873. */
  2874. abstract get<T>(token: ProviderToken<T>, notFoundValue?: T, options?: InjectOptions | InjectFlags): T;
  2875. /**
  2876. * Retrieves an instance from the injector based on the provided token.
  2877. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  2878. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  2879. * @deprecated use object-based flags (`InjectOptions`) instead.
  2880. */
  2881. abstract get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): T;
  2882. /**
  2883. * @deprecated from v4.0.0 use ProviderToken<T>
  2884. * @suppress {duplicate}
  2885. */
  2886. abstract get(token: any, notFoundValue?: any): any;
  2887. /**
  2888. * @deprecated from v5 use the new signature Injector.create(options)
  2889. */
  2890. static create(providers: StaticProvider[], parent?: Injector): Injector;
  2891. /**
  2892. * Creates a new injector instance that provides one or more dependencies,
  2893. * according to a given type or types of `StaticProvider`.
  2894. *
  2895. * @param options An object with the following properties:
  2896. * * `providers`: An array of providers of the [StaticProvider type](api/core/StaticProvider).
  2897. * * `parent`: (optional) A parent injector.
  2898. * * `name`: (optional) A developer-defined identifying name for the new injector.
  2899. *
  2900. * @returns The new injector instance.
  2901. *
  2902. */
  2903. static create(options: {
  2904. providers: Array<Provider | StaticProvider>;
  2905. parent?: Injector;
  2906. name?: string;
  2907. }): Injector;
  2908. /** @nocollapse */
  2909. static ɵprov: unknown;
  2910. }
  2911. /**
  2912. * Information about how a type or `InjectionToken` interfaces with the DI system.
  2913. *
  2914. * At a minimum, this includes a `factory` which defines how to create the given type `T`, possibly
  2915. * requesting injection of other types if necessary.
  2916. *
  2917. * Optionally, a `providedIn` parameter specifies that the given type belongs to a particular
  2918. * `Injector`, `NgModule`, or a special scope (e.g. `'root'`). A value of `null` indicates
  2919. * that the injectable does not belong to any scope.
  2920. *
  2921. * @codeGenApi
  2922. * @publicApi The ViewEngine compiler emits code with this type for injectables. This code is
  2923. * deployed to npm, and should be treated as public api.
  2924. */
  2925. interface ɵɵInjectableDeclaration<T> {
  2926. /**
  2927. * Specifies that the given type belongs to a particular injector:
  2928. * - `InjectorType` such as `NgModule`,
  2929. * - `'root'` the root injector
  2930. * - `'any'` all injectors.
  2931. * - `null`, does not belong to any injector. Must be explicitly listed in the injector
  2932. * `providers`.
  2933. */
  2934. providedIn: InjectorType<any> | 'root' | 'platform' | 'any' | 'environment' | null;
  2935. /**
  2936. * The token to which this definition belongs.
  2937. *
  2938. * Note that this may not be the same as the type that the `factory` will create.
  2939. */
  2940. token: unknown;
  2941. /**
  2942. * Factory method to execute to create an instance of the injectable.
  2943. */
  2944. factory: (t?: Type$1<any>) => T;
  2945. /**
  2946. * In a case of no explicit injector, a location where the instance of the injectable is stored.
  2947. */
  2948. value: T | undefined;
  2949. }
  2950. /**
  2951. * Information about the providers to be included in an `Injector` as well as how the given type
  2952. * which carries the information should be created by the DI system.
  2953. *
  2954. * An `InjectorDef` can import other types which have `InjectorDefs`, forming a deep nested
  2955. * structure of providers with a defined priority (identically to how `NgModule`s also have
  2956. * an import/dependency structure).
  2957. *
  2958. * NOTE: This is a private type and should not be exported
  2959. *
  2960. * @codeGenApi
  2961. */
  2962. interface ɵɵInjectorDef<T> {
  2963. providers: (Type$1<any> | ValueProvider | ExistingProvider | FactoryProvider | ConstructorProvider | StaticClassProvider | ClassProvider | EnvironmentProviders | any[])[];
  2964. imports: (InjectorType<any> | InjectorTypeWithProviders<any>)[];
  2965. }
  2966. /**
  2967. * A `Type` which has a `ɵprov: ɵɵInjectableDeclaration` static field.
  2968. *
  2969. * `InjectableType`s contain their own Dependency Injection metadata and are usable in an
  2970. * `InjectorDef`-based `StaticInjector`.
  2971. *
  2972. * @publicApi
  2973. */
  2974. interface InjectableType<T> extends Type$1<T> {
  2975. /**
  2976. * Opaque type whose structure is highly version dependent. Do not rely on any properties.
  2977. */
  2978. ɵprov: unknown;
  2979. }
  2980. /**
  2981. * A type which has an `InjectorDef` static field.
  2982. *
  2983. * `InjectorTypes` can be used to configure a `StaticInjector`.
  2984. *
  2985. * This is an opaque type whose structure is highly version dependent. Do not rely on any
  2986. * properties.
  2987. *
  2988. * @publicApi
  2989. */
  2990. interface InjectorType<T> extends Type$1<T> {
  2991. ɵfac?: unknown;
  2992. ɵinj: unknown;
  2993. }
  2994. /**
  2995. * Describes the `InjectorDef` equivalent of a `ModuleWithProviders`, an `InjectorType` with an
  2996. * associated array of providers.
  2997. *
  2998. * Objects of this type can be listed in the imports section of an `InjectorDef`.
  2999. *
  3000. * NOTE: This is a private type and should not be exported
  3001. */
  3002. interface InjectorTypeWithProviders<T> {
  3003. ngModule: InjectorType<T>;
  3004. providers?: (Type$1<any> | ValueProvider | ExistingProvider | FactoryProvider | ConstructorProvider | StaticClassProvider | ClassProvider | EnvironmentProviders | any[])[];
  3005. }
  3006. /**
  3007. * Construct an injectable definition which defines how a token will be constructed by the DI
  3008. * system, and in which injectors (if any) it will be available.
  3009. *
  3010. * This should be assigned to a static `ɵprov` field on a type, which will then be an
  3011. * `InjectableType`.
  3012. *
  3013. * Options:
  3014. * * `providedIn` determines which injectors will include the injectable, by either associating it
  3015. * with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be
  3016. * provided in the `'root'` injector, which will be the application-level injector in most apps.
  3017. * * `factory` gives the zero argument function which will create an instance of the injectable.
  3018. * The factory can call [`inject`](api/core/inject) to access the `Injector` and request injection
  3019. * of dependencies.
  3020. *
  3021. * @codeGenApi
  3022. * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to npm.
  3023. */
  3024. declare function ɵɵdefineInjectable<T>(opts: {
  3025. token: unknown;
  3026. providedIn?: Type$1<any> | 'root' | 'platform' | 'any' | 'environment' | null;
  3027. factory: () => T;
  3028. }): unknown;
  3029. /**
  3030. * @deprecated in v8, delete after v10. This API should be used only by generated code, and that
  3031. * code should now use ɵɵdefineInjectable instead.
  3032. * @publicApi
  3033. */
  3034. declare const defineInjectable: typeof ɵɵdefineInjectable;
  3035. /**
  3036. * Construct an `InjectorDef` which configures an injector.
  3037. *
  3038. * This should be assigned to a static injector def (`ɵinj`) field on a type, which will then be an
  3039. * `InjectorType`.
  3040. *
  3041. * Options:
  3042. *
  3043. * * `providers`: an optional array of providers to add to the injector. Each provider must
  3044. * either have a factory or point to a type which has a `ɵprov` static property (the
  3045. * type must be an `InjectableType`).
  3046. * * `imports`: an optional array of imports of other `InjectorType`s or `InjectorTypeWithModule`s
  3047. * whose providers will also be added to the injector. Locally provided types will override
  3048. * providers from imports.
  3049. *
  3050. * @codeGenApi
  3051. */
  3052. declare function ɵɵdefineInjector(options: {
  3053. providers?: any[];
  3054. imports?: any[];
  3055. }): unknown;
  3056. /**
  3057. * Read the injectable def (`ɵprov`) for `type` in a way which is immune to accidentally reading
  3058. * inherited value.
  3059. *
  3060. * @param type A type which may have its own (non-inherited) `ɵprov`.
  3061. */
  3062. declare function getInjectableDef<T>(type: any): ɵɵInjectableDeclaration<T> | null;
  3063. declare function isInjectable(type: any): boolean;
  3064. declare const NG_PROV_DEF: string;
  3065. declare const NG_INJ_DEF: string;
  3066. /**
  3067. * Wrap an array of `Provider`s into `EnvironmentProviders`, preventing them from being accidentally
  3068. * referenced in `@Component` in a component injector.
  3069. */
  3070. declare function makeEnvironmentProviders(providers: (Provider | EnvironmentProviders)[]): EnvironmentProviders;
  3071. /**
  3072. * @description
  3073. * This function is used to provide initialization functions that will be executed upon construction
  3074. * of an environment injector.
  3075. *
  3076. * Note that the provided initializer is run in the injection context.
  3077. *
  3078. * Previously, this was achieved using the `ENVIRONMENT_INITIALIZER` token which is now deprecated.
  3079. *
  3080. * @see {@link ENVIRONMENT_INITIALIZER}
  3081. *
  3082. * @usageNotes
  3083. * The following example illustrates how to configure an initialization function using
  3084. * `provideEnvironmentInitializer()`
  3085. * ```ts
  3086. * createEnvironmentInjector(
  3087. * [
  3088. * provideEnvironmentInitializer(() => {
  3089. * console.log('environment initialized');
  3090. * }),
  3091. * ],
  3092. * parentInjector
  3093. * );
  3094. * ```
  3095. *
  3096. * @publicApi
  3097. */
  3098. declare function provideEnvironmentInitializer(initializerFn: () => void): EnvironmentProviders;
  3099. /**
  3100. * A source of providers for the `importProvidersFrom` function.
  3101. *
  3102. * @publicApi
  3103. */
  3104. type ImportProvidersSource = Type$1<unknown> | ModuleWithProviders<unknown> | Array<ImportProvidersSource>;
  3105. /**
  3106. * Collects providers from all NgModules and standalone components, including transitively imported
  3107. * ones.
  3108. *
  3109. * Providers extracted via `importProvidersFrom` are only usable in an application injector or
  3110. * another environment injector (such as a route injector). They should not be used in component
  3111. * providers.
  3112. *
  3113. * More information about standalone components can be found in [this
  3114. * guide](guide/components/importing).
  3115. *
  3116. * @usageNotes
  3117. * The results of the `importProvidersFrom` call can be used in the `bootstrapApplication` call:
  3118. *
  3119. * ```ts
  3120. * await bootstrapApplication(RootComponent, {
  3121. * providers: [
  3122. * importProvidersFrom(NgModuleOne, NgModuleTwo)
  3123. * ]
  3124. * });
  3125. * ```
  3126. *
  3127. * You can also use the `importProvidersFrom` results in the `providers` field of a route, when a
  3128. * standalone component is used:
  3129. *
  3130. * ```ts
  3131. * export const ROUTES: Route[] = [
  3132. * {
  3133. * path: 'foo',
  3134. * providers: [
  3135. * importProvidersFrom(NgModuleOne, NgModuleTwo)
  3136. * ],
  3137. * component: YourStandaloneComponent
  3138. * }
  3139. * ];
  3140. * ```
  3141. *
  3142. * @returns Collected providers from the specified list of types.
  3143. * @publicApi
  3144. */
  3145. declare function importProvidersFrom(...sources: ImportProvidersSource[]): EnvironmentProviders;
  3146. /**
  3147. * Internal type for a single provider in a deep provider array.
  3148. */
  3149. type SingleProvider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | StaticClassProvider;
  3150. type InjectorScope = 'root' | 'platform' | 'environment';
  3151. /**
  3152. * An internal token whose presence in an injector indicates that the injector should treat itself
  3153. * as a root scoped injector when processing requests for unknown tokens which may indicate
  3154. * they are provided in the root scope.
  3155. */
  3156. declare const INJECTOR_SCOPE: InjectionToken<InjectorScope | null>;
  3157. /**
  3158. * An `Injector` that's part of the environment injector hierarchy, which exists outside of the
  3159. * component tree.
  3160. */
  3161. declare abstract class EnvironmentInjector implements Injector {
  3162. /**
  3163. * Retrieves an instance from the injector based on the provided token.
  3164. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  3165. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  3166. */
  3167. abstract get<T>(token: ProviderToken<T>, notFoundValue: undefined, options: InjectOptions & {
  3168. optional?: false;
  3169. }): T;
  3170. /**
  3171. * Retrieves an instance from the injector based on the provided token.
  3172. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  3173. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  3174. */
  3175. abstract get<T>(token: ProviderToken<T>, notFoundValue: null | undefined, options: InjectOptions): T | null;
  3176. /**
  3177. * Retrieves an instance from the injector based on the provided token.
  3178. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  3179. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  3180. */
  3181. abstract get<T>(token: ProviderToken<T>, notFoundValue?: T, options?: InjectOptions): T;
  3182. /**
  3183. * Retrieves an instance from the injector based on the provided token.
  3184. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  3185. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  3186. * @deprecated use object-based flags (`InjectOptions`) instead.
  3187. */
  3188. abstract get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): T;
  3189. /**
  3190. * @deprecated from v4.0.0 use ProviderToken<T>
  3191. * @suppress {duplicate}
  3192. */
  3193. abstract get(token: any, notFoundValue?: any): any;
  3194. /**
  3195. * Runs the given function in the context of this `EnvironmentInjector`.
  3196. *
  3197. * Within the function's stack frame, [`inject`](api/core/inject) can be used to inject
  3198. * dependencies from this injector. Note that `inject` is only usable synchronously, and cannot be
  3199. * used in any asynchronous callbacks or after any `await` points.
  3200. *
  3201. * @param fn the closure to be run in the context of this injector
  3202. * @returns the return value of the function, if any
  3203. * @deprecated use the standalone function `runInInjectionContext` instead
  3204. */
  3205. abstract runInContext<ReturnT>(fn: () => ReturnT): ReturnT;
  3206. abstract destroy(): void;
  3207. }
  3208. /**
  3209. * A schema definition associated with an NgModule.
  3210. *
  3211. * @see {@link NgModule}
  3212. * @see {@link CUSTOM_ELEMENTS_SCHEMA}
  3213. * @see {@link NO_ERRORS_SCHEMA}
  3214. *
  3215. * @param name The name of a defined schema.
  3216. *
  3217. * @publicApi
  3218. */
  3219. interface SchemaMetadata {
  3220. name: string;
  3221. }
  3222. /**
  3223. * Defines a schema that allows an NgModule to contain the following:
  3224. * - Non-Angular elements named with dash case (`-`).
  3225. * - Element properties named with dash case (`-`).
  3226. * Dash case is the naming convention for custom elements.
  3227. *
  3228. * @publicApi
  3229. */
  3230. declare const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata;
  3231. /**
  3232. * Defines a schema that allows any property on any element.
  3233. *
  3234. * This schema allows you to ignore the errors related to any unknown elements or properties in a
  3235. * template. The usage of this schema is generally discouraged because it prevents useful validation
  3236. * and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.
  3237. *
  3238. * @publicApi
  3239. */
  3240. declare const NO_ERRORS_SCHEMA: SchemaMetadata;
  3241. /**
  3242. * Defines the CSS styles encapsulation policies for the {@link /api/core/Component Component} decorator's
  3243. * `encapsulation` option.
  3244. *
  3245. * See {@link Component#encapsulation encapsulation}.
  3246. *
  3247. * @usageNotes
  3248. * ### Example
  3249. *
  3250. * {@example core/ts/metadata/encapsulation.ts region='longform'}
  3251. *
  3252. * @publicApi
  3253. */
  3254. declare enum ViewEncapsulation$1 {
  3255. /**
  3256. * Emulates a native Shadow DOM encapsulation behavior by adding a specific attribute to the
  3257. * component's host element and applying the same attribute to all the CSS selectors provided
  3258. * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls}.
  3259. *
  3260. * This is the default option.
  3261. */
  3262. Emulated = 0,
  3263. /**
  3264. * Doesn't provide any sort of CSS style encapsulation, meaning that all the styles provided
  3265. * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls} are applicable
  3266. * to any HTML element of the application regardless of their host Component.
  3267. */
  3268. None = 2,
  3269. /**
  3270. * Uses the browser's native Shadow DOM API to encapsulate CSS styles, meaning that it creates
  3271. * a ShadowRoot for the component's host element which is then used to encapsulate
  3272. * all the Component's styling.
  3273. */
  3274. ShadowDom = 3
  3275. }
  3276. /**
  3277. * Definition of what a factory function should look like.
  3278. */
  3279. type FactoryFn<T> = {
  3280. /**
  3281. * Subclasses without an explicit constructor call through to the factory of their base
  3282. * definition, providing it with their own constructor to instantiate.
  3283. */
  3284. <U extends T>(t?: Type$1<U>): U;
  3285. /**
  3286. * If no constructor to instantiate is provided, an instance of type T itself is created.
  3287. */
  3288. (t?: undefined): T;
  3289. };
  3290. /** Flags describing an input for a directive. */
  3291. declare enum InputFlags {
  3292. None = 0,
  3293. SignalBased = 1,
  3294. HasDecoratorInputTransform = 2
  3295. }
  3296. /**
  3297. * Definition of what a template rendering function should look like for a component.
  3298. */
  3299. type ComponentTemplate<T> = {
  3300. <U extends T>(rf: RenderFlags, ctx: T | U): void;
  3301. };
  3302. /**
  3303. * Definition of what a view queries function should look like.
  3304. */
  3305. type ViewQueriesFunction<T> = <U extends T>(rf: RenderFlags, ctx: U) => void;
  3306. /**
  3307. * Definition of what a content queries function should look like.
  3308. */
  3309. type ContentQueriesFunction<T> = <U extends T>(rf: RenderFlags, ctx: U, directiveIndex: number) => void;
  3310. interface ClassDebugInfo {
  3311. className: string;
  3312. filePath?: string;
  3313. lineNumber?: number;
  3314. forbidOrphanRendering?: boolean;
  3315. }
  3316. /**
  3317. * Flags passed into template functions to determine which blocks (i.e. creation, update)
  3318. * should be executed.
  3319. *
  3320. * Typically, a template runs both the creation block and the update block on initialization and
  3321. * subsequent runs only execute the update block. However, dynamically created views require that
  3322. * the creation block be executed separately from the update block (for backwards compat).
  3323. */
  3324. declare const enum RenderFlags {
  3325. Create = 1,
  3326. Update = 2
  3327. }
  3328. /**
  3329. * A subclass of `Type` which has a static `ɵcmp`:`ComponentDef` field making it
  3330. * consumable for rendering.
  3331. */
  3332. interface ComponentType<T> extends Type$1<T> {
  3333. ɵcmp: unknown;
  3334. }
  3335. /**
  3336. * A subclass of `Type` which has a static `ɵdir`:`DirectiveDef` field making it
  3337. * consumable for rendering.
  3338. */
  3339. interface DirectiveType<T> extends Type$1<T> {
  3340. ɵdir: unknown;
  3341. ɵfac: unknown;
  3342. }
  3343. /**
  3344. * A subclass of `Type` which has a static `ɵpipe`:`PipeDef` field making it
  3345. * consumable for rendering.
  3346. */
  3347. interface PipeType<T> extends Type$1<T> {
  3348. ɵpipe: unknown;
  3349. }
  3350. /**
  3351. * Runtime link information for Directives.
  3352. *
  3353. * This is an internal data structure used by the render to link
  3354. * directives into templates.
  3355. *
  3356. * NOTE: Always use `defineDirective` function to create this object,
  3357. * never create the object directly since the shape of this object
  3358. * can change between versions.
  3359. *
  3360. * @param Selector type metadata specifying the selector of the directive or component
  3361. *
  3362. * See: {@link defineDirective}
  3363. */
  3364. interface DirectiveDef<T> {
  3365. /**
  3366. * A dictionary mapping the inputs' public name to their minified property names
  3367. * (along with flags if there are any).
  3368. */
  3369. readonly inputs: Record<string, [
  3370. minifiedName: string,
  3371. flags: InputFlags,
  3372. transform: InputTransformFunction | null
  3373. ]>;
  3374. /**
  3375. * Contains the raw input information produced by the compiler. Can be
  3376. * used to do further processing after the `inputs` have been inverted.
  3377. */
  3378. readonly inputConfig: {
  3379. [P in keyof T]?: string | [InputFlags, string, string?, InputTransformFunction?];
  3380. };
  3381. /**
  3382. * @deprecated This is only here because `NgOnChanges` incorrectly uses declared name instead of
  3383. * public or minified name.
  3384. */
  3385. readonly declaredInputs: Record<string, string>;
  3386. /**
  3387. * A dictionary mapping the outputs' minified property names to their public API names, which
  3388. * are their aliases if any, or their original unminified property names
  3389. * (as in `@Output('alias') propertyName: any;`).
  3390. */
  3391. readonly outputs: Record<string, string>;
  3392. /**
  3393. * Function to create and refresh content queries associated with a given directive.
  3394. */
  3395. contentQueries: ContentQueriesFunction<T> | null;
  3396. /**
  3397. * Query-related instructions for a directive. Note that while directives don't have a
  3398. * view and as such view queries won't necessarily do anything, there might be
  3399. * components that extend the directive.
  3400. */
  3401. viewQuery: ViewQueriesFunction<T> | null;
  3402. /**
  3403. * Refreshes host bindings on the associated directive.
  3404. */
  3405. readonly hostBindings: HostBindingsFunction<T> | null;
  3406. /**
  3407. * The number of bindings in this directive `hostBindings` (including pure fn bindings).
  3408. *
  3409. * Used to calculate the length of the component's LView array, so we
  3410. * can pre-fill the array and set the host binding start index.
  3411. */
  3412. readonly hostVars: number;
  3413. /**
  3414. * Assign static attribute values to a host element.
  3415. *
  3416. * This property will assign static attribute values as well as class and style
  3417. * values to a host element. Since attribute values can consist of different types of values, the
  3418. * `hostAttrs` array must include the values in the following format:
  3419. *
  3420. * attrs = [
  3421. * // static attributes (like `title`, `name`, `id`...)
  3422. * attr1, value1, attr2, value,
  3423. *
  3424. * // a single namespace value (like `x:id`)
  3425. * NAMESPACE_MARKER, namespaceUri1, name1, value1,
  3426. *
  3427. * // another single namespace value (like `x:name`)
  3428. * NAMESPACE_MARKER, namespaceUri2, name2, value2,
  3429. *
  3430. * // a series of CSS classes that will be applied to the element (no spaces)
  3431. * CLASSES_MARKER, class1, class2, class3,
  3432. *
  3433. * // a series of CSS styles (property + value) that will be applied to the element
  3434. * STYLES_MARKER, prop1, value1, prop2, value2
  3435. * ]
  3436. *
  3437. * All non-class and non-style attributes must be defined at the start of the list
  3438. * first before all class and style values are set. When there is a change in value
  3439. * type (like when classes and styles are introduced) a marker must be used to separate
  3440. * the entries. The marker values themselves are set via entries found in the
  3441. * [AttributeMarker] enum.
  3442. */
  3443. readonly hostAttrs: TAttributes | null;
  3444. /** Token representing the directive. Used by DI. */
  3445. readonly type: Type$1<T>;
  3446. /** Function that resolves providers and publishes them into the DI system. */
  3447. providersResolver: (<U extends T>(def: DirectiveDef<U>, processProvidersFn?: ProcessProvidersFunction) => void) | null;
  3448. /** The selectors that will be used to match nodes to this directive. */
  3449. readonly selectors: CssSelectorList;
  3450. /**
  3451. * Name under which the directive is exported (for use with local references in template)
  3452. */
  3453. readonly exportAs: string[] | null;
  3454. /**
  3455. * Whether this directive (or component) is standalone.
  3456. */
  3457. readonly standalone: boolean;
  3458. /**
  3459. * Whether this directive (or component) uses the signals authoring experience.
  3460. */
  3461. readonly signals: boolean;
  3462. /**
  3463. * Factory function used to create a new directive instance. Will be null initially.
  3464. * Populated when the factory is first requested by directive instantiation logic.
  3465. */
  3466. readonly factory: FactoryFn<T> | null;
  3467. /**
  3468. * The features applied to this directive
  3469. */
  3470. readonly features: DirectiveDefFeature[] | null;
  3471. /**
  3472. * Info related to debugging/troubleshooting for this component. This info is only available in
  3473. * dev mode.
  3474. */
  3475. debugInfo: ClassDebugInfo | null;
  3476. /**
  3477. * Function that will add the host directives to the list of matches during directive matching.
  3478. * Patched onto the definition by the `HostDirectivesFeature`.
  3479. * @param currentDef Definition that has been matched.
  3480. * @param matchedDefs List of all matches for a specified node. Will be mutated to include the
  3481. * host directives.
  3482. * @param hostDirectiveDefs Mapping of directive definitions to their host directive
  3483. * configuration. Host directives will be added to the map as they're being matched to the node.
  3484. */
  3485. findHostDirectiveDefs: ((currentDef: DirectiveDef<unknown>, matchedDefs: DirectiveDef<unknown>[], hostDirectiveDefs: HostDirectiveDefs) => void) | null;
  3486. /**
  3487. * Additional directives to be applied whenever the directive has been matched.
  3488. *
  3489. * `HostDirectiveConfig` objects represent a host directive that can be resolved eagerly and were
  3490. * already pre-processed when the definition was created. A function needs to be resolved lazily
  3491. * during directive matching, because it's a forward reference.
  3492. *
  3493. * **Note:** we can't `HostDirectiveConfig` in the array, because there's no way to distinguish if
  3494. * a function in the array is a `Type` or a `() => HostDirectiveConfig[]`.
  3495. */
  3496. hostDirectives: (HostDirectiveDef | (() => HostDirectiveConfig[]))[] | null;
  3497. setInput: (<U extends T>(this: DirectiveDef<U>, instance: U, inputSignalNode: null | InputSignalNode<unknown, unknown>, value: any, publicName: string, privateName: string) => void) | null;
  3498. }
  3499. /**
  3500. * Runtime link information for Components.
  3501. *
  3502. * This is an internal data structure used by the render to link
  3503. * components into templates.
  3504. *
  3505. * NOTE: Always use `defineComponent` function to create this object,
  3506. * never create the object directly since the shape of this object
  3507. * can change between versions.
  3508. *
  3509. * See: {@link defineComponent}
  3510. */
  3511. interface ComponentDef<T> extends DirectiveDef<T> {
  3512. /**
  3513. * Unique ID for the component. Used in view encapsulation and
  3514. * to keep track of the injector in standalone components.
  3515. */
  3516. readonly id: string;
  3517. /**
  3518. * The View template of the component.
  3519. */
  3520. readonly template: ComponentTemplate<T>;
  3521. /** Constants associated with the component's view. */
  3522. readonly consts: TConstantsOrFactory | null;
  3523. /**
  3524. * An array of `ngContent[selector]` values that were found in the template.
  3525. */
  3526. readonly ngContentSelectors?: string[];
  3527. /**
  3528. * A set of styles that the component needs to be present for component to render correctly.
  3529. */
  3530. readonly styles: string[];
  3531. /**
  3532. * The number of nodes, local refs, and pipes in this component template.
  3533. *
  3534. * Used to calculate the length of the component's LView array, so we
  3535. * can pre-fill the array and set the binding start index.
  3536. */
  3537. readonly decls: number;
  3538. /**
  3539. * The number of bindings in this component template (including pure fn bindings).
  3540. *
  3541. * Used to calculate the length of the component's LView array, so we
  3542. * can pre-fill the array and set the host binding start index.
  3543. */
  3544. readonly vars: number;
  3545. /**
  3546. * Query-related instructions for a component.
  3547. */
  3548. viewQuery: ViewQueriesFunction<T> | null;
  3549. /**
  3550. * The view encapsulation type, which determines how styles are applied to
  3551. * DOM elements. One of
  3552. * - `Emulated` (default): Emulate native scoping of styles.
  3553. * - `Native`: Use the native encapsulation mechanism of the renderer.
  3554. * - `ShadowDom`: Use modern [ShadowDOM](https://w3c.github.io/webcomponents/spec/shadow/) and
  3555. * create a ShadowRoot for component's host element.
  3556. * - `None`: Do not provide any template or style encapsulation.
  3557. */
  3558. readonly encapsulation: ViewEncapsulation$1;
  3559. /**
  3560. * Defines arbitrary developer-defined data to be stored on a renderer instance.
  3561. * This is useful for renderers that delegate to other renderers.
  3562. */
  3563. readonly data: {
  3564. [kind: string]: any;
  3565. animation?: any[];
  3566. };
  3567. /** Whether or not this component's ChangeDetectionStrategy is OnPush */
  3568. readonly onPush: boolean;
  3569. /** Whether or not this component is signal-based. */
  3570. readonly signals: boolean;
  3571. /**
  3572. * Registry of directives and components that may be found in this view.
  3573. *
  3574. * The property is either an array of `DirectiveDef`s or a function which returns the array of
  3575. * `DirectiveDef`s. The function is necessary to be able to support forward declarations.
  3576. */
  3577. directiveDefs: DirectiveDefListOrFactory | null;
  3578. /**
  3579. * Registry of pipes that may be found in this view.
  3580. *
  3581. * The property is either an array of `PipeDefs`s or a function which returns the array of
  3582. * `PipeDefs`s. The function is necessary to be able to support forward declarations.
  3583. */
  3584. pipeDefs: PipeDefListOrFactory | null;
  3585. /**
  3586. * Unfiltered list of all dependencies of a component, or `null` if none.
  3587. */
  3588. dependencies: TypeOrFactory<DependencyTypeList> | null;
  3589. /**
  3590. * The set of schemas that declare elements to be allowed in the component's template.
  3591. */
  3592. schemas: SchemaMetadata[] | null;
  3593. /**
  3594. * Ivy runtime uses this place to store the computed tView for the component. This gets filled on
  3595. * the first run of component.
  3596. */
  3597. tView: TView | null;
  3598. /**
  3599. * A function used by the framework to create standalone injectors.
  3600. */
  3601. getStandaloneInjector: ((parentInjector: EnvironmentInjector) => EnvironmentInjector | null) | null;
  3602. /**
  3603. * A function used by the framework to create the list of external runtime style URLs.
  3604. */
  3605. getExternalStyles: ((encapsulationId?: string) => string[]) | null;
  3606. /**
  3607. * Used to store the result of `noSideEffects` function so that it is not removed by closure
  3608. * compiler. The property should never be read.
  3609. */
  3610. readonly _?: unknown;
  3611. }
  3612. /**
  3613. * Runtime link information for Pipes.
  3614. *
  3615. * This is an internal data structure used by the renderer to link
  3616. * pipes into templates.
  3617. *
  3618. * NOTE: Always use `definePipe` function to create this object,
  3619. * never create the object directly since the shape of this object
  3620. * can change between versions.
  3621. *
  3622. * See: {@link definePipe}
  3623. */
  3624. interface PipeDef<T> {
  3625. /** Token representing the pipe. */
  3626. type: Type$1<T>;
  3627. /**
  3628. * Pipe name.
  3629. *
  3630. * Used to resolve pipe in templates.
  3631. */
  3632. readonly name: string;
  3633. /**
  3634. * Factory function used to create a new pipe instance. Will be null initially.
  3635. * Populated when the factory is first requested by pipe instantiation logic.
  3636. */
  3637. factory: FactoryFn<T> | null;
  3638. /**
  3639. * Whether or not the pipe is pure.
  3640. *
  3641. * Pure pipes result only depends on the pipe input and not on internal
  3642. * state of the pipe.
  3643. */
  3644. readonly pure: boolean;
  3645. /**
  3646. * Whether this pipe is standalone.
  3647. */
  3648. readonly standalone: boolean;
  3649. onDestroy: (() => void) | null;
  3650. }
  3651. interface DirectiveDefFeature {
  3652. <T>(directiveDef: DirectiveDef<T>): void;
  3653. /**
  3654. * Marks a feature as something that {@link InheritDefinitionFeature} will execute
  3655. * during inheritance.
  3656. *
  3657. * NOTE: DO NOT SET IN ROOT OF MODULE! Doing so will result in tree-shakers/bundlers
  3658. * identifying the change as a side effect, and the feature will be included in
  3659. * every bundle.
  3660. */
  3661. ngInherit?: true;
  3662. }
  3663. /** Runtime information used to configure a host directive. */
  3664. interface HostDirectiveDef<T = unknown> {
  3665. /** Class representing the host directive. */
  3666. directive: Type$1<T>;
  3667. /** Directive inputs that have been exposed. */
  3668. inputs: HostDirectiveBindingMap;
  3669. /** Directive outputs that have been exposed. */
  3670. outputs: HostDirectiveBindingMap;
  3671. }
  3672. /**
  3673. * Mapping between the public aliases of directive bindings and the underlying inputs/outputs that
  3674. * they represent. Also serves as an allowlist of the inputs/outputs from the host directive that
  3675. * the author has decided to expose.
  3676. */
  3677. type HostDirectiveBindingMap = {
  3678. [publicName: string]: string;
  3679. };
  3680. /**
  3681. * Mapping between a directive that was used as a host directive
  3682. * and the configuration that was used to define it as such.
  3683. */
  3684. type HostDirectiveDefs = Map<DirectiveDef<unknown>, HostDirectiveDef>;
  3685. /** Value that can be used to configure a host directive. */
  3686. type HostDirectiveConfig = Type$1<unknown> | {
  3687. directive: Type$1<unknown>;
  3688. inputs?: string[];
  3689. outputs?: string[];
  3690. };
  3691. interface ComponentDefFeature {
  3692. <T>(componentDef: ComponentDef<T>): void;
  3693. /**
  3694. * Marks a feature as something that {@link InheritDefinitionFeature} will execute
  3695. * during inheritance.
  3696. *
  3697. * NOTE: DO NOT SET IN ROOT OF MODULE! Doing so will result in tree-shakers/bundlers
  3698. * identifying the change as a side effect, and the feature will be included in
  3699. * every bundle.
  3700. */
  3701. ngInherit?: true;
  3702. }
  3703. /** Function that can be used to transform incoming input values. */
  3704. type InputTransformFunction = (value: any) => any;
  3705. /**
  3706. * Type used for directiveDefs on component definition.
  3707. *
  3708. * The function is necessary to be able to support forward declarations.
  3709. */
  3710. type DirectiveDefListOrFactory = (() => DirectiveDefList) | DirectiveDefList;
  3711. type DirectiveDefList = (DirectiveDef<any> | ComponentDef<any>)[];
  3712. type DependencyType = DirectiveType<any> | ComponentType<any> | PipeType<any> | Type$1<any>;
  3713. type DependencyTypeList = Array<DependencyType>;
  3714. type TypeOrFactory<T> = T | (() => T);
  3715. type HostBindingsFunction<T> = <U extends T>(rf: RenderFlags, ctx: U) => void;
  3716. /**
  3717. * Type used for PipeDefs on component definition.
  3718. *
  3719. * The function is necessary to be able to support forward declarations.
  3720. */
  3721. type PipeDefListOrFactory = (() => PipeDefList) | PipeDefList;
  3722. type PipeDefList = PipeDef<any>[];
  3723. /**
  3724. * NgModule scope info as provided by AoT compiler
  3725. *
  3726. * In full compilation Ivy resolved all the "module with providers" and forward refs the whole array
  3727. * if at least one element is forward refed. So we end up with type `Type<any>[]|(() =>
  3728. * Type<any>[])`.
  3729. *
  3730. * In local mode the compiler passes the raw info as they are to the runtime functions as it is not
  3731. * possible to resolve them any further due to limited info at compile time. So we end up with type
  3732. * `RawScopeInfoFromDecorator[]`.
  3733. */
  3734. interface NgModuleScopeInfoFromDecorator {
  3735. /** List of components, directives, and pipes declared by this module. */
  3736. declarations?: Type$1<any>[] | (() => Type$1<any>[]) | RawScopeInfoFromDecorator[];
  3737. /** List of modules or `ModuleWithProviders` or standalone components imported by this module. */
  3738. imports?: Type$1<any>[] | (() => Type$1<any>[]) | RawScopeInfoFromDecorator[];
  3739. /**
  3740. * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this
  3741. * module.
  3742. */
  3743. exports?: Type$1<any>[] | (() => Type$1<any>[]) | RawScopeInfoFromDecorator[];
  3744. /**
  3745. * The set of components that are bootstrapped when this module is bootstrapped. This field is
  3746. * only available in local compilation mode. In full compilation mode bootstrap info is passed
  3747. * directly to the module def runtime after statically analyzed and resolved.
  3748. */
  3749. bootstrap?: Type$1<any>[] | (() => Type$1<any>[]) | RawScopeInfoFromDecorator[];
  3750. }
  3751. /**
  3752. * The array element type passed to:
  3753. * - NgModule's annotation imports/exports/declarations fields
  3754. * - standalone component annotation imports field
  3755. */
  3756. type RawScopeInfoFromDecorator = Type$1<any> | ModuleWithProviders<any> | (() => Type$1<any>) | (() => ModuleWithProviders<any>) | any[];
  3757. /**
  3758. * Basic set of data structures used for identifying a defer block
  3759. * and triggering defer blocks
  3760. */
  3761. interface DehydratedDeferBlock {
  3762. lView: LView;
  3763. tNode: TNode;
  3764. lContainer: LContainer;
  3765. }
  3766. /**
  3767. * Describes the shape of a function generated by the compiler
  3768. * to download dependencies that can be defer-loaded.
  3769. */
  3770. type DependencyResolverFn = () => Array<Promise<DependencyType>>;
  3771. /**
  3772. * Describes the state of defer block dependency loading.
  3773. */
  3774. declare enum DeferDependenciesLoadingState {
  3775. /** Initial state, dependency loading is not yet triggered */
  3776. NOT_STARTED = 0,
  3777. /** Dependency loading is in progress */
  3778. IN_PROGRESS = 1,
  3779. /** Dependency loading has completed successfully */
  3780. COMPLETE = 2,
  3781. /** Dependency loading has failed */
  3782. FAILED = 3
  3783. }
  3784. /** Configuration object for a loading block as it is stored in the component constants. */
  3785. type DeferredLoadingBlockConfig = [minimumTime: number | null, afterTime: number | null];
  3786. /** Configuration object for a placeholder block as it is stored in the component constants. */
  3787. type DeferredPlaceholderBlockConfig = [minimumTime: number | null];
  3788. /**
  3789. * Describes the data shared across all instances of a defer block.
  3790. */
  3791. interface TDeferBlockDetails {
  3792. /**
  3793. * Index in an LView and TData arrays where a template for the primary content
  3794. * can be found.
  3795. */
  3796. primaryTmplIndex: number;
  3797. /**
  3798. * Index in an LView and TData arrays where a template for the loading block can be found.
  3799. */
  3800. loadingTmplIndex: number | null;
  3801. /**
  3802. * Extra configuration parameters (such as `after` and `minimum`) for the loading block.
  3803. */
  3804. loadingBlockConfig: DeferredLoadingBlockConfig | null;
  3805. /**
  3806. * Index in an LView and TData arrays where a template for the placeholder block can be found.
  3807. */
  3808. placeholderTmplIndex: number | null;
  3809. /**
  3810. * Extra configuration parameters (such as `after` and `minimum`) for the placeholder block.
  3811. */
  3812. placeholderBlockConfig: DeferredPlaceholderBlockConfig | null;
  3813. /**
  3814. * Index in an LView and TData arrays where a template for the error block can be found.
  3815. */
  3816. errorTmplIndex: number | null;
  3817. /**
  3818. * Compiler-generated function that loads all dependencies for a defer block.
  3819. */
  3820. dependencyResolverFn: DependencyResolverFn | null;
  3821. /**
  3822. * Keeps track of the current loading state of defer block dependencies.
  3823. */
  3824. loadingState: DeferDependenciesLoadingState;
  3825. /**
  3826. * Dependency loading Promise. This Promise is helpful for cases when there
  3827. * are multiple instances of a defer block (e.g. if it was used inside of an *ngFor),
  3828. * which all await the same set of dependencies.
  3829. */
  3830. loadingPromise: Promise<unknown> | null;
  3831. /**
  3832. * List of providers collected from all NgModules that were imported by
  3833. * standalone components used within this defer block.
  3834. */
  3835. providers: Provider[] | null;
  3836. /**
  3837. * List of hydrate triggers for a given block
  3838. */
  3839. hydrateTriggers: Map<DeferBlockTrigger, HydrateTriggerDetails | null> | null;
  3840. /**
  3841. * Defer block flags, which should be used for all
  3842. * instances of a given defer block (the flags that should be
  3843. * placed into the `TDeferDetails` at runtime).
  3844. */
  3845. flags: TDeferDetailsFlags;
  3846. /**
  3847. * Tracks debugging information about the deferred block.
  3848. */
  3849. debug: {
  3850. /** Text representations of the block's triggers. */
  3851. triggers?: Set<string>;
  3852. } | null;
  3853. }
  3854. /**
  3855. * Specifies defer block flags, which should be used for all
  3856. * instances of a given defer block (the flags that should be
  3857. * placed into the `TDeferDetails` at runtime).
  3858. */
  3859. declare const enum TDeferDetailsFlags {
  3860. Default = 0,
  3861. /**
  3862. * Whether or not the defer block has hydrate triggers.
  3863. */
  3864. HasHydrateTriggers = 1
  3865. }
  3866. /**
  3867. * Describes the current state of this defer block instance.
  3868. *
  3869. * @publicApi
  3870. */
  3871. declare enum DeferBlockState {
  3872. /** The placeholder block content is rendered */
  3873. Placeholder = 0,
  3874. /** The loading block content is rendered */
  3875. Loading = 1,
  3876. /** The main content block content is rendered */
  3877. Complete = 2,
  3878. /** The error block content is rendered */
  3879. Error = 3
  3880. }
  3881. /**
  3882. * Represents defer trigger types.
  3883. */
  3884. declare const enum DeferBlockTrigger {
  3885. Idle = 0,
  3886. Immediate = 1,
  3887. Viewport = 2,
  3888. Interaction = 3,
  3889. Hover = 4,
  3890. Timer = 5,
  3891. When = 6,
  3892. Never = 7
  3893. }
  3894. /** * Describes specified delay (in ms) in the `hydrate on timer()` trigger. */
  3895. interface HydrateTimerTriggerDetails {
  3896. delay: number;
  3897. }
  3898. /** * Describes all possible hydration trigger details specified in a template. */
  3899. type HydrateTriggerDetails = HydrateTimerTriggerDetails;
  3900. /**
  3901. * Internal structure used for configuration of defer block behavior.
  3902. * */
  3903. interface DeferBlockConfig {
  3904. behavior: DeferBlockBehavior;
  3905. }
  3906. /**
  3907. * Options for configuring defer blocks behavior.
  3908. * @publicApi
  3909. */
  3910. declare enum DeferBlockBehavior {
  3911. /**
  3912. * Manual triggering mode for defer blocks. Provides control over when defer blocks render
  3913. * and which state they render.
  3914. */
  3915. Manual = 0,
  3916. /**
  3917. * Playthrough mode for defer blocks. This mode behaves like defer blocks would in a browser.
  3918. * This is the default behavior in test environments.
  3919. */
  3920. Playthrough = 1
  3921. }
  3922. /**
  3923. * **INTERNAL**, avoid referencing it in application code.
  3924. *
  3925. * Describes a helper class that allows to intercept a call to retrieve current
  3926. * dependency loading function and replace it with a different implementation.
  3927. * This interceptor class is needed to allow testing blocks in different states
  3928. * by simulating loading response.
  3929. */
  3930. interface DeferBlockDependencyInterceptor {
  3931. /**
  3932. * Invoked for each defer block when dependency loading function is accessed.
  3933. */
  3934. intercept(dependencyFn: DependencyResolverFn | null): DependencyResolverFn | null;
  3935. /**
  3936. * Allows to configure an interceptor function.
  3937. */
  3938. setInterceptor(interceptorFn: (current: DependencyResolverFn) => DependencyResolverFn): void;
  3939. }
  3940. /**
  3941. * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property
  3942. * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly
  3943. * handled.
  3944. *
  3945. * See DomSanitizer for more details on security in Angular applications.
  3946. *
  3947. * @publicApi
  3948. */
  3949. declare enum SecurityContext {
  3950. NONE = 0,
  3951. HTML = 1,
  3952. STYLE = 2,
  3953. SCRIPT = 3,
  3954. URL = 4,
  3955. RESOURCE_URL = 5
  3956. }
  3957. /**
  3958. * Sanitizer is used by the views to sanitize potentially dangerous values.
  3959. *
  3960. * @publicApi
  3961. */
  3962. declare abstract class Sanitizer {
  3963. abstract sanitize(context: SecurityContext, value: {} | string | null): string | null;
  3964. /** @nocollapse */
  3965. static ɵprov: unknown;
  3966. }
  3967. /** Actions that are supported by the tracing framework. */
  3968. declare enum TracingAction {
  3969. CHANGE_DETECTION = 0,
  3970. AFTER_NEXT_RENDER = 1
  3971. }
  3972. /** A single tracing snapshot. */
  3973. interface TracingSnapshot {
  3974. run<T>(action: TracingAction, fn: () => T): T;
  3975. /** Disposes of the tracing snapshot. Must be run exactly once per TracingSnapshot. */
  3976. dispose(): void;
  3977. }
  3978. /**
  3979. * Injection token for a `TracingService`, optionally provided.
  3980. */
  3981. declare const TracingService: InjectionToken<TracingService<TracingSnapshot>>;
  3982. /**
  3983. * Tracing mechanism which can associate causes (snapshots) with runs of
  3984. * subsequent operations.
  3985. *
  3986. * Not defined by Angular directly, but defined in contexts where tracing is
  3987. * desired.
  3988. */
  3989. interface TracingService<T extends TracingSnapshot> {
  3990. /**
  3991. * Take a snapshot of the current context which will be stored by Angular and
  3992. * used when additional work is performed that was scheduled in this context.
  3993. *
  3994. * @param linkedSnapshot Optional snapshot to use link to the current context.
  3995. * The caller is no longer responsible for calling dispose on the linkedSnapshot.
  3996. *
  3997. * @return The tracing snapshot. The caller is responsible for diposing of the
  3998. * snapshot.
  3999. */
  4000. snapshot(linkedSnapshot: T | null): T;
  4001. /**
  4002. * Wrap an event listener bound by the framework for tracing.
  4003. * @param element Element on which the event is bound.
  4004. * @param eventName Name of the event.
  4005. * @param handler Event handler.
  4006. * @return A new event handler to be bound instead of the original one.
  4007. */
  4008. wrapEventListener?<T extends Function>(element: HTMLElement, eventName: string, handler: T): T;
  4009. }
  4010. /**
  4011. * The phase to run an `afterRender` or `afterNextRender` callback in.
  4012. *
  4013. * Callbacks in the same phase run in the order they are registered. Phases run in the
  4014. * following order after each render:
  4015. *
  4016. * 1. `AfterRenderPhase.EarlyRead`
  4017. * 2. `AfterRenderPhase.Write`
  4018. * 3. `AfterRenderPhase.MixedReadWrite`
  4019. * 4. `AfterRenderPhase.Read`
  4020. *
  4021. * Angular is unable to verify or enforce that phases are used correctly, and instead
  4022. * relies on each developer to follow the guidelines documented for each value and
  4023. * carefully choose the appropriate one, refactoring their code if necessary. By doing
  4024. * so, Angular is better able to minimize the performance degradation associated with
  4025. * manual DOM access, ensuring the best experience for the end users of your application
  4026. * or library.
  4027. *
  4028. * @deprecated Specify the phase for your callback to run in by passing a spec-object as the first
  4029. * parameter to `afterRender` or `afterNextRender` instead of a function.
  4030. */
  4031. declare enum AfterRenderPhase {
  4032. /**
  4033. * Use `AfterRenderPhase.EarlyRead` for callbacks that only need to **read** from the
  4034. * DOM before a subsequent `AfterRenderPhase.Write` callback, for example to perform
  4035. * custom layout that the browser doesn't natively support. Prefer the
  4036. * `AfterRenderPhase.EarlyRead` phase if reading can wait until after the write phase.
  4037. * **Never** write to the DOM in this phase.
  4038. *
  4039. * <div class="docs-alert docs-alert-important">
  4040. *
  4041. * Using this value can degrade performance.
  4042. * Instead, prefer using built-in browser functionality when possible.
  4043. *
  4044. * </div>
  4045. */
  4046. EarlyRead = 0,
  4047. /**
  4048. * Use `AfterRenderPhase.Write` for callbacks that only **write** to the DOM. **Never**
  4049. * read from the DOM in this phase.
  4050. */
  4051. Write = 1,
  4052. /**
  4053. * Use `AfterRenderPhase.MixedReadWrite` for callbacks that read from or write to the
  4054. * DOM, that haven't been refactored to use a different phase. **Never** use this phase if
  4055. * it is possible to divide the work among the other phases instead.
  4056. *
  4057. * <div class="docs-alert docs-alert-critical">
  4058. *
  4059. * Using this value can **significantly** degrade performance.
  4060. * Instead, prefer dividing work into the appropriate phase callbacks.
  4061. *
  4062. * </div>
  4063. */
  4064. MixedReadWrite = 2,
  4065. /**
  4066. * Use `AfterRenderPhase.Read` for callbacks that only **read** from the DOM. **Never**
  4067. * write to the DOM in this phase.
  4068. */
  4069. Read = 3
  4070. }
  4071. /**
  4072. * A callback that runs after render.
  4073. *
  4074. * @developerPreview
  4075. */
  4076. interface AfterRenderRef {
  4077. /**
  4078. * Shut down the callback, preventing it from being called again.
  4079. */
  4080. destroy(): void;
  4081. }
  4082. declare class AfterRenderManager {
  4083. impl: AfterRenderImpl | null;
  4084. execute(): void;
  4085. /** @nocollapse */
  4086. static ɵprov: unknown;
  4087. }
  4088. declare class AfterRenderImpl {
  4089. private readonly ngZone;
  4090. private readonly scheduler;
  4091. private readonly errorHandler;
  4092. /** Current set of active sequences. */
  4093. private readonly sequences;
  4094. /** Tracks registrations made during the current set of executions. */
  4095. private readonly deferredRegistrations;
  4096. /** Whether the `AfterRenderManager` is currently executing hooks. */
  4097. executing: boolean;
  4098. constructor();
  4099. /**
  4100. * Run the sequence of phases of hooks, once through. As a result of executing some hooks, more
  4101. * might be scheduled.
  4102. */
  4103. execute(): void;
  4104. register(sequence: AfterRenderSequence): void;
  4105. addSequence(sequence: AfterRenderSequence): void;
  4106. unregister(sequence: AfterRenderSequence): void;
  4107. protected maybeTrace<T>(fn: () => T, snapshot: TracingSnapshot | null): T;
  4108. /** @nocollapse */
  4109. static ɵprov: unknown;
  4110. }
  4111. type AfterRenderHook = (value?: unknown) => unknown;
  4112. type AfterRenderHooks = [
  4113. AfterRenderHook | undefined,
  4114. AfterRenderHook | undefined,
  4115. AfterRenderHook | undefined,
  4116. AfterRenderHook | undefined
  4117. ];
  4118. declare class AfterRenderSequence implements AfterRenderRef {
  4119. readonly impl: AfterRenderImpl;
  4120. readonly hooks: AfterRenderHooks;
  4121. readonly view: LView | undefined;
  4122. once: boolean;
  4123. snapshot: TracingSnapshot | null;
  4124. /**
  4125. * Whether this sequence errored or was destroyed during this execution, and hooks should no
  4126. * longer run for it.
  4127. */
  4128. erroredOrDestroyed: boolean;
  4129. /**
  4130. * The value returned by the last hook execution (if any), ready to be pipelined into the next
  4131. * one.
  4132. */
  4133. pipelinedValue: unknown;
  4134. private unregisterOnDestroy;
  4135. constructor(impl: AfterRenderImpl, hooks: AfterRenderHooks, view: LView | undefined, once: boolean, destroyRef: DestroyRef | null, snapshot?: TracingSnapshot | null);
  4136. afterRun(): void;
  4137. destroy(): void;
  4138. }
  4139. interface ReactiveLViewConsumer extends ReactiveNode {
  4140. lView: LView | null;
  4141. }
  4142. /**
  4143. * Abstraction that encompasses any kind of effect that can be scheduled.
  4144. */
  4145. interface SchedulableEffect {
  4146. run(): void;
  4147. zone: {
  4148. run<T>(fn: () => T): T;
  4149. } | null;
  4150. }
  4151. /**
  4152. * A scheduler which manages the execution of effects.
  4153. */
  4154. declare abstract class EffectScheduler {
  4155. /**
  4156. * Schedule the given effect to be executed at a later time.
  4157. *
  4158. * It is an error to attempt to execute any effects synchronously during a scheduling operation.
  4159. */
  4160. abstract schedule(e: SchedulableEffect): void;
  4161. /**
  4162. * Run any scheduled effects.
  4163. */
  4164. abstract flush(): void;
  4165. /** Remove a scheduled effect */
  4166. abstract remove(e: SchedulableEffect): void;
  4167. /** @nocollapse */
  4168. static ɵprov: unknown;
  4169. }
  4170. /**
  4171. * A wrapper around `ZoneAwareQueueingScheduler` that schedules flushing via the microtask queue
  4172. * when.
  4173. */
  4174. declare class ZoneAwareEffectScheduler implements EffectScheduler {
  4175. private queuedEffectCount;
  4176. private queues;
  4177. schedule(handle: SchedulableEffect): void;
  4178. remove(handle: SchedulableEffect): void;
  4179. private enqueue;
  4180. /**
  4181. * Run all scheduled effects.
  4182. *
  4183. * Execution order of effects within the same zone is guaranteed to be FIFO, but there is no
  4184. * ordering guarantee between effects scheduled in different zones.
  4185. */
  4186. flush(): void;
  4187. private flushQueue;
  4188. }
  4189. /**
  4190. * A global reactive effect, which can be manually destroyed.
  4191. *
  4192. * @developerPreview
  4193. */
  4194. interface EffectRef {
  4195. /**
  4196. * Shut down the effect, removing it from any upcoming scheduled executions.
  4197. */
  4198. destroy(): void;
  4199. }
  4200. /**
  4201. * Options passed to the `effect` function.
  4202. *
  4203. * @developerPreview
  4204. */
  4205. interface CreateEffectOptions {
  4206. /**
  4207. * The `Injector` in which to create the effect.
  4208. *
  4209. * If this is not provided, the current [injection context](guide/di/dependency-injection-context)
  4210. * will be used instead (via `inject`).
  4211. */
  4212. injector?: Injector;
  4213. /**
  4214. * Whether the `effect` should require manual cleanup.
  4215. *
  4216. * If this is `false` (the default) the effect will automatically register itself to be cleaned up
  4217. * with the current `DestroyRef`.
  4218. */
  4219. manualCleanup?: boolean;
  4220. /**
  4221. * Always create a root effect (which is scheduled as a microtask) regardless of whether `effect`
  4222. * is called within a component.
  4223. */
  4224. forceRoot?: true;
  4225. /**
  4226. * @deprecated no longer required, signal writes are allowed by default.
  4227. */
  4228. allowSignalWrites?: boolean;
  4229. /**
  4230. * A debug name for the effect. Used in Angular DevTools to identify the effect.
  4231. */
  4232. debugName?: string;
  4233. }
  4234. /**
  4235. * An effect can, optionally, register a cleanup function. If registered, the cleanup is executed
  4236. * before the next effect run. The cleanup function makes it possible to "cancel" any work that the
  4237. * previous effect run might have started.
  4238. *
  4239. * @developerPreview
  4240. */
  4241. type EffectCleanupFn = () => void;
  4242. /**
  4243. * A callback passed to the effect function that makes it possible to register cleanup logic.
  4244. *
  4245. * @developerPreview
  4246. */
  4247. type EffectCleanupRegisterFn = (cleanupFn: EffectCleanupFn) => void;
  4248. /**
  4249. * Registers an "effect" that will be scheduled & executed whenever the signals that it reads
  4250. * changes.
  4251. *
  4252. * Angular has two different kinds of effect: component effects and root effects. Component effects
  4253. * are created when `effect()` is called from a component, directive, or within a service of a
  4254. * component/directive. Root effects are created when `effect()` is called from outside the
  4255. * component tree, such as in a root service, or when the `forceRoot` option is provided.
  4256. *
  4257. * The two effect types differ in their timing. Component effects run as a component lifecycle
  4258. * event during Angular's synchronization (change detection) process, and can safely read input
  4259. * signals or create/destroy views that depend on component state. Root effects run as microtasks
  4260. * and have no connection to the component tree or change detection.
  4261. *
  4262. * `effect()` must be run in injection context, unless the `injector` option is manually specified.
  4263. *
  4264. * @developerPreview
  4265. */
  4266. declare function effect(effectFn: (onCleanup: EffectCleanupRegisterFn) => void, options?: CreateEffectOptions): EffectRef;
  4267. interface EffectNode extends ReactiveNode, SchedulableEffect {
  4268. hasRun: boolean;
  4269. cleanupFns: EffectCleanupFn[] | undefined;
  4270. injector: Injector;
  4271. notifier: ChangeDetectionScheduler;
  4272. onDestroyFn: () => void;
  4273. fn: (cleanupFn: EffectCleanupRegisterFn) => void;
  4274. run(): void;
  4275. destroy(): void;
  4276. maybeCleanup(): void;
  4277. }
  4278. interface ViewEffectNode extends EffectNode {
  4279. view: LView;
  4280. }
  4281. /**
  4282. * An unmodifiable list of items that Angular keeps up to date when the state
  4283. * of the application changes.
  4284. *
  4285. * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}
  4286. * provide.
  4287. *
  4288. * Implements an iterable interface, therefore it can be used in both ES6
  4289. * javascript `for (var i of items)` loops as well as in Angular templates with
  4290. * `*ngFor="let i of myList"`.
  4291. *
  4292. * Changes can be observed by subscribing to the changes `Observable`.
  4293. *
  4294. * NOTE: In the future this class will implement an `Observable` interface.
  4295. *
  4296. * @usageNotes
  4297. * ### Example
  4298. * ```ts
  4299. * @Component({...})
  4300. * class Container {
  4301. * @ViewChildren(Item) items:QueryList<Item>;
  4302. * }
  4303. * ```
  4304. *
  4305. * @publicApi
  4306. */
  4307. declare class QueryList<T> implements Iterable<T> {
  4308. private _emitDistinctChangesOnly;
  4309. readonly dirty = true;
  4310. private _onDirty?;
  4311. private _results;
  4312. private _changesDetected;
  4313. private _changes;
  4314. readonly length: number;
  4315. readonly first: T;
  4316. readonly last: T;
  4317. /**
  4318. * Returns `Observable` of `QueryList` notifying the subscriber of changes.
  4319. */
  4320. get changes(): Observable<any>;
  4321. /**
  4322. * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change
  4323. * has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in
  4324. * the same result)
  4325. */
  4326. constructor(_emitDistinctChangesOnly?: boolean);
  4327. /**
  4328. * Returns the QueryList entry at `index`.
  4329. */
  4330. get(index: number): T | undefined;
  4331. /**
  4332. * See
  4333. * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
  4334. */
  4335. map<U>(fn: (item: T, index: number, array: T[]) => U): U[];
  4336. /**
  4337. * See
  4338. * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
  4339. */
  4340. filter<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S): S[];
  4341. filter(predicate: (value: T, index: number, array: readonly T[]) => unknown): T[];
  4342. /**
  4343. * See
  4344. * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
  4345. */
  4346. find(fn: (item: T, index: number, array: T[]) => boolean): T | undefined;
  4347. /**
  4348. * See
  4349. * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
  4350. */
  4351. reduce<U>(fn: (prevValue: U, curValue: T, curIndex: number, array: T[]) => U, init: U): U;
  4352. /**
  4353. * See
  4354. * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
  4355. */
  4356. forEach(fn: (item: T, index: number, array: T[]) => void): void;
  4357. /**
  4358. * See
  4359. * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
  4360. */
  4361. some(fn: (value: T, index: number, array: T[]) => boolean): boolean;
  4362. /**
  4363. * Returns a copy of the internal results list as an Array.
  4364. */
  4365. toArray(): T[];
  4366. toString(): string;
  4367. /**
  4368. * Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that
  4369. * on change detection, it will not notify of changes to the queries, unless a new change
  4370. * occurs.
  4371. *
  4372. * @param resultsTree The query results to store
  4373. * @param identityAccessor Optional function for extracting stable object identity from a value
  4374. * in the array. This function is executed for each element of the query result list while
  4375. * comparing current query list with the new one (provided as a first argument of the `reset`
  4376. * function) to detect if the lists are different. If the function is not provided, elements
  4377. * are compared as is (without any pre-processing).
  4378. */
  4379. reset(resultsTree: Array<T | any[]>, identityAccessor?: (value: T) => unknown): void;
  4380. /**
  4381. * Triggers a change event by emitting on the `changes` {@link EventEmitter}.
  4382. */
  4383. notifyOnChanges(): void;
  4384. /** internal */
  4385. setDirty(): void;
  4386. /** internal */
  4387. destroy(): void;
  4388. [Symbol.iterator]: () => Iterator<T>;
  4389. }
  4390. /**
  4391. * An object representing query metadata extracted from query annotations.
  4392. */
  4393. interface TQueryMetadata {
  4394. predicate: ProviderToken<unknown> | string[];
  4395. read: any;
  4396. flags: QueryFlags;
  4397. }
  4398. /**
  4399. * A set of flags to be used with Queries.
  4400. *
  4401. * NOTE: Ensure changes here are reflected in `packages/compiler/src/render3/view/compiler.ts`
  4402. */
  4403. declare const enum QueryFlags {
  4404. /**
  4405. * No flags
  4406. */
  4407. none = 0,
  4408. /**
  4409. * Whether or not the query should descend into children.
  4410. */
  4411. descendants = 1,
  4412. /**
  4413. * The query can be computed statically and hence can be assigned eagerly.
  4414. *
  4415. * NOTE: Backwards compatibility with ViewEngine.
  4416. */
  4417. isStatic = 2,
  4418. /**
  4419. * If the `QueryList` should fire change event only if actual change to query was computed (vs old
  4420. * behavior where the change was fired whenever the query was recomputed, even if the recomputed
  4421. * query resulted in the same list.)
  4422. */
  4423. emitDistinctChangesOnly = 4
  4424. }
  4425. /**
  4426. * TQuery objects represent all the query-related data that remain the same from one view instance
  4427. * to another and can be determined on the very first template pass. Most notably TQuery holds all
  4428. * the matches for a given view.
  4429. */
  4430. interface TQuery {
  4431. /**
  4432. * Query metadata extracted from query annotations.
  4433. */
  4434. metadata: TQueryMetadata;
  4435. /**
  4436. * Index of a query in a declaration view in case of queries propagated to en embedded view, -1
  4437. * for queries declared in a given view. We are storing this index so we can find a parent query
  4438. * to clone for an embedded view (when an embedded view is created).
  4439. */
  4440. indexInDeclarationView: number;
  4441. /**
  4442. * Matches collected on the first template pass. Each match is a pair of:
  4443. * - TNode index;
  4444. * - match index;
  4445. *
  4446. * A TNode index can be either:
  4447. * - a positive number (the most common case) to indicate a matching TNode;
  4448. * - a negative number to indicate that a given query is crossing a <ng-template> element and
  4449. * results from views created based on TemplateRef should be inserted at this place.
  4450. *
  4451. * A match index is a number used to find an actual value (for a given node) when query results
  4452. * are materialized. This index can have one of the following values:
  4453. * - -2 - indicates that we need to read a special token (TemplateRef, ViewContainerRef etc.);
  4454. * - -1 - indicates that we need to read a default value based on the node type (TemplateRef for
  4455. * ng-template and ElementRef for other elements);
  4456. * - a positive number - index of an injectable to be read from the element injector.
  4457. */
  4458. matches: number[] | null;
  4459. /**
  4460. * A flag indicating if a given query crosses an <ng-template> element. This flag exists for
  4461. * performance reasons: we can notice that queries not crossing any <ng-template> elements will
  4462. * have matches from a given view only (and adapt processing accordingly).
  4463. */
  4464. crossesNgTemplate: boolean;
  4465. /**
  4466. * A method call when a given query is crossing an element (or element container). This is where a
  4467. * given TNode is matched against a query predicate.
  4468. * @param tView
  4469. * @param tNode
  4470. */
  4471. elementStart(tView: TView, tNode: TNode): void;
  4472. /**
  4473. * A method called when processing the elementEnd instruction - this is mostly useful to determine
  4474. * if a given content query should match any nodes past this point.
  4475. * @param tNode
  4476. */
  4477. elementEnd(tNode: TNode): void;
  4478. /**
  4479. * A method called when processing the template instruction. This is where a
  4480. * given TContainerNode is matched against a query predicate.
  4481. * @param tView
  4482. * @param tNode
  4483. */
  4484. template(tView: TView, tNode: TNode): void;
  4485. /**
  4486. * A query-related method called when an embedded TView is created based on the content of a
  4487. * <ng-template> element. We call this method to determine if a given query should be propagated
  4488. * to the embedded view and if so - return a cloned TQuery for this embedded view.
  4489. * @param tNode
  4490. * @param childQueryIndex
  4491. */
  4492. embeddedTView(tNode: TNode, childQueryIndex: number): TQuery | null;
  4493. }
  4494. /**
  4495. * TQueries represent a collection of individual TQuery objects tracked in a given view. Most of the
  4496. * methods on this interface are simple proxy methods to the corresponding functionality on TQuery.
  4497. */
  4498. interface TQueries {
  4499. /**
  4500. * Adds a new TQuery to a collection of queries tracked in a given view.
  4501. * @param tQuery
  4502. */
  4503. track(tQuery: TQuery): void;
  4504. /**
  4505. * Returns a TQuery instance for at the given index in the queries array.
  4506. * @param index
  4507. */
  4508. getByIndex(index: number): TQuery;
  4509. /**
  4510. * Returns the number of queries tracked in a given view.
  4511. */
  4512. length: number;
  4513. /**
  4514. * A proxy method that iterates over all the TQueries in a given TView and calls the corresponding
  4515. * `elementStart` on each and every TQuery.
  4516. * @param tView
  4517. * @param tNode
  4518. */
  4519. elementStart(tView: TView, tNode: TNode): void;
  4520. /**
  4521. * A proxy method that iterates over all the TQueries in a given TView and calls the corresponding
  4522. * `elementEnd` on each and every TQuery.
  4523. * @param tNode
  4524. */
  4525. elementEnd(tNode: TNode): void;
  4526. /**
  4527. * A proxy method that iterates over all the TQueries in a given TView and calls the corresponding
  4528. * `template` on each and every TQuery.
  4529. * @param tView
  4530. * @param tNode
  4531. */
  4532. template(tView: TView, tNode: TNode): void;
  4533. /**
  4534. * A proxy method that iterates over all the TQueries in a given TView and calls the corresponding
  4535. * `embeddedTView` on each and every TQuery.
  4536. * @param tNode
  4537. */
  4538. embeddedTView(tNode: TNode): TQueries | null;
  4539. }
  4540. /**
  4541. * An interface that represents query-related information specific to a view instance. Most notably
  4542. * it contains:
  4543. * - materialized query matches;
  4544. * - a pointer to a QueryList where materialized query results should be reported.
  4545. */
  4546. interface LQuery<T> {
  4547. /**
  4548. * Materialized query matches for a given view only (!). Results are initialized lazily so the
  4549. * array of matches is set to `null` initially.
  4550. */
  4551. matches: (T | null)[] | null;
  4552. /**
  4553. * A QueryList where materialized query results should be reported.
  4554. */
  4555. queryList: QueryList<T>;
  4556. /**
  4557. * Clones an LQuery for an embedded view. A cloned query shares the same `QueryList` but has a
  4558. * separate collection of materialized matches.
  4559. */
  4560. clone(): LQuery<T>;
  4561. /**
  4562. * Called when an embedded view, impacting results of this query, is inserted or removed.
  4563. */
  4564. setDirty(): void;
  4565. }
  4566. /**
  4567. * lQueries represent a collection of individual LQuery objects tracked in a given view.
  4568. */
  4569. interface LQueries {
  4570. /**
  4571. * A collection of queries tracked in a given view.
  4572. */
  4573. queries: LQuery<any>[];
  4574. /**
  4575. * A method called when a new embedded view is created. As a result a set of LQueries applicable
  4576. * for a new embedded view is instantiated (cloned) from the declaration view.
  4577. * @param tView
  4578. */
  4579. createEmbeddedView(tView: TView): LQueries | null;
  4580. /**
  4581. * A method called when an embedded view is inserted into a container. As a result all impacted
  4582. * `LQuery` objects (and associated `QueryList`) are marked as dirty.
  4583. * @param tView
  4584. */
  4585. insertView(tView: TView): void;
  4586. /**
  4587. * A method called when an embedded view is detached from a container. As a result all impacted
  4588. * `LQuery` objects (and associated `QueryList`) are marked as dirty.
  4589. * @param tView
  4590. */
  4591. detachView(tView: TView): void;
  4592. /**
  4593. * A method called when a view finishes its creation pass. As a result all impacted
  4594. * `LQuery` objects (and associated `QueryList`) are marked as dirty. This additional dirty
  4595. * marking gives us a precise point in time where we can collect results for a given view in an
  4596. * atomic way.
  4597. * @param tView
  4598. */
  4599. finishViewCreation(tView: TView): void;
  4600. }
  4601. /**
  4602. * Used by `RendererFactory2` to associate custom rendering data and styles
  4603. * with a rendering implementation.
  4604. * @publicApi
  4605. */
  4606. interface RendererType2 {
  4607. /**
  4608. * A unique identifying string for the new renderer, used when creating
  4609. * unique styles for encapsulation.
  4610. */
  4611. id: string;
  4612. /**
  4613. * The view encapsulation type, which determines how styles are applied to
  4614. * DOM elements. One of
  4615. * - `Emulated` (default): Emulate native scoping of styles.
  4616. * - `Native`: Use the native encapsulation mechanism of the renderer.
  4617. * - `ShadowDom`: Use modern [Shadow
  4618. * DOM](https://w3c.github.io/webcomponents/spec/shadow/) and
  4619. * create a ShadowRoot for component's host element.
  4620. * - `None`: Do not provide any template or style encapsulation.
  4621. */
  4622. encapsulation: ViewEncapsulation$1;
  4623. /**
  4624. * Defines CSS styles to be stored on a renderer instance.
  4625. */
  4626. styles: string[];
  4627. /**
  4628. * Defines arbitrary developer-defined data to be stored on a renderer instance.
  4629. * This is useful for renderers that delegate to other renderers.
  4630. */
  4631. data: {
  4632. [kind: string]: any;
  4633. };
  4634. /**
  4635. * A function used by the framework to create the list of external runtime style URLs.
  4636. */
  4637. getExternalStyles?: ((encapsulationId?: string) => string[]) | null;
  4638. }
  4639. /**
  4640. * Flags for renderer-specific style modifiers.
  4641. * @publicApi
  4642. */
  4643. declare enum RendererStyleFlags2 {
  4644. /**
  4645. * Marks a style as important.
  4646. */
  4647. Important = 1,
  4648. /**
  4649. * Marks a style as using dash case naming (this-is-dash-case).
  4650. */
  4651. DashCase = 2
  4652. }
  4653. /**
  4654. * Creates and initializes a custom renderer that implements the `Renderer2` base class.
  4655. *
  4656. * @publicApi
  4657. */
  4658. declare abstract class RendererFactory2 {
  4659. /**
  4660. * Creates and initializes a custom renderer for a host DOM element.
  4661. * @param hostElement The element to render.
  4662. * @param type The base class to implement.
  4663. * @returns The new custom renderer instance.
  4664. */
  4665. abstract createRenderer(hostElement: any, type: RendererType2 | null): Renderer2;
  4666. /**
  4667. * A callback invoked when rendering has begun.
  4668. */
  4669. abstract begin?(): void;
  4670. /**
  4671. * A callback invoked when rendering has completed.
  4672. */
  4673. abstract end?(): void;
  4674. /**
  4675. * Use with animations test-only mode. Notifies the test when rendering has completed.
  4676. * @returns The asynchronous result of the developer-defined function.
  4677. */
  4678. abstract whenRenderingDone?(): Promise<any>;
  4679. }
  4680. /**
  4681. * Extend this base class to implement custom rendering. By default, Angular
  4682. * renders a template into DOM. You can use custom rendering to intercept
  4683. * rendering calls, or to render to something other than DOM.
  4684. *
  4685. * Create your custom renderer using `RendererFactory2`.
  4686. *
  4687. * Use a custom renderer to bypass Angular's templating and
  4688. * make custom UI changes that can't be expressed declaratively.
  4689. * For example if you need to set a property or an attribute whose name is
  4690. * not statically known, use the `setProperty()` or
  4691. * `setAttribute()` method.
  4692. *
  4693. * @publicApi
  4694. */
  4695. declare abstract class Renderer2 {
  4696. /**
  4697. * Use to store arbitrary developer-defined data on a renderer instance,
  4698. * as an object containing key-value pairs.
  4699. * This is useful for renderers that delegate to other renderers.
  4700. */
  4701. abstract get data(): {
  4702. [key: string]: any;
  4703. };
  4704. /**
  4705. * Implement this callback to destroy the renderer or the host element.
  4706. */
  4707. abstract destroy(): void;
  4708. /**
  4709. * Implement this callback to create an instance of the host element.
  4710. * @param name An identifying name for the new element, unique within the namespace.
  4711. * @param namespace The namespace for the new element.
  4712. * @returns The new element.
  4713. */
  4714. abstract createElement(name: string, namespace?: string | null): any;
  4715. /**
  4716. * Implement this callback to add a comment to the DOM of the host element.
  4717. * @param value The comment text.
  4718. * @returns The modified element.
  4719. */
  4720. abstract createComment(value: string): any;
  4721. /**
  4722. * Implement this callback to add text to the DOM of the host element.
  4723. * @param value The text string.
  4724. * @returns The modified element.
  4725. */
  4726. abstract createText(value: string): any;
  4727. /**
  4728. * If null or undefined, the view engine won't call it.
  4729. * This is used as a performance optimization for production mode.
  4730. */
  4731. destroyNode: ((node: any) => void) | null;
  4732. /**
  4733. * Appends a child to a given parent node in the host element DOM.
  4734. * @param parent The parent node.
  4735. * @param newChild The new child node.
  4736. */
  4737. abstract appendChild(parent: any, newChild: any): void;
  4738. /**
  4739. * Implement this callback to insert a child node at a given position in a parent node
  4740. * in the host element DOM.
  4741. * @param parent The parent node.
  4742. * @param newChild The new child nodes.
  4743. * @param refChild The existing child node before which `newChild` is inserted.
  4744. * @param isMove Optional argument which signifies if the current `insertBefore` is a result of a
  4745. * move. Animation uses this information to trigger move animations. In the past the Animation
  4746. * would always assume that any `insertBefore` is a move. This is not strictly true because
  4747. * with runtime i18n it is possible to invoke `insertBefore` as a result of i18n and it should
  4748. * not trigger an animation move.
  4749. */
  4750. abstract insertBefore(parent: any, newChild: any, refChild: any, isMove?: boolean): void;
  4751. /**
  4752. * Implement this callback to remove a child node from the host element's DOM.
  4753. * @param parent The parent node.
  4754. * @param oldChild The child node to remove.
  4755. * @param isHostElement Optionally signal to the renderer whether this element is a host element
  4756. * or not
  4757. */
  4758. abstract removeChild(parent: any, oldChild: any, isHostElement?: boolean): void;
  4759. /**
  4760. * Implement this callback to prepare an element to be bootstrapped
  4761. * as a root element, and return the element instance.
  4762. * @param selectorOrNode The DOM element.
  4763. * @param preserveContent Whether the contents of the root element
  4764. * should be preserved, or cleared upon bootstrap (default behavior).
  4765. * Use with `ViewEncapsulation.ShadowDom` to allow simple native
  4766. * content projection via `<slot>` elements.
  4767. * @returns The root element.
  4768. */
  4769. abstract selectRootElement(selectorOrNode: string | any, preserveContent?: boolean): any;
  4770. /**
  4771. * Implement this callback to get the parent of a given node
  4772. * in the host element's DOM.
  4773. * @param node The child node to query.
  4774. * @returns The parent node, or null if there is no parent.
  4775. * This is because the check is synchronous,
  4776. * and the caller can't rely on checking for null.
  4777. */
  4778. abstract parentNode(node: any): any;
  4779. /**
  4780. * Implement this callback to get the next sibling node of a given node
  4781. * in the host element's DOM.
  4782. * @returns The sibling node, or null if there is no sibling.
  4783. * This is because the check is synchronous,
  4784. * and the caller can't rely on checking for null.
  4785. */
  4786. abstract nextSibling(node: any): any;
  4787. /**
  4788. * Implement this callback to set an attribute value for an element in the DOM.
  4789. * @param el The element.
  4790. * @param name The attribute name.
  4791. * @param value The new value.
  4792. * @param namespace The namespace.
  4793. */
  4794. abstract setAttribute(el: any, name: string, value: string, namespace?: string | null): void;
  4795. /**
  4796. * Implement this callback to remove an attribute from an element in the DOM.
  4797. * @param el The element.
  4798. * @param name The attribute name.
  4799. * @param namespace The namespace.
  4800. */
  4801. abstract removeAttribute(el: any, name: string, namespace?: string | null): void;
  4802. /**
  4803. * Implement this callback to add a class to an element in the DOM.
  4804. * @param el The element.
  4805. * @param name The class name.
  4806. */
  4807. abstract addClass(el: any, name: string): void;
  4808. /**
  4809. * Implement this callback to remove a class from an element in the DOM.
  4810. * @param el The element.
  4811. * @param name The class name.
  4812. */
  4813. abstract removeClass(el: any, name: string): void;
  4814. /**
  4815. * Implement this callback to set a CSS style for an element in the DOM.
  4816. * @param el The element.
  4817. * @param style The name of the style.
  4818. * @param value The new value.
  4819. * @param flags Flags for style variations. No flags are set by default.
  4820. */
  4821. abstract setStyle(el: any, style: string, value: any, flags?: RendererStyleFlags2): void;
  4822. /**
  4823. * Implement this callback to remove the value from a CSS style for an element in the DOM.
  4824. * @param el The element.
  4825. * @param style The name of the style.
  4826. * @param flags Flags for style variations to remove, if set. ???
  4827. */
  4828. abstract removeStyle(el: any, style: string, flags?: RendererStyleFlags2): void;
  4829. /**
  4830. * Implement this callback to set the value of a property of an element in the DOM.
  4831. * @param el The element.
  4832. * @param name The property name.
  4833. * @param value The new value.
  4834. */
  4835. abstract setProperty(el: any, name: string, value: any): void;
  4836. /**
  4837. * Implement this callback to set the value of a node in the host element.
  4838. * @param node The node.
  4839. * @param value The new value.
  4840. */
  4841. abstract setValue(node: any, value: string): void;
  4842. /**
  4843. * Implement this callback to start an event listener.
  4844. * @param target The context in which to listen for events. Can be
  4845. * the entire window or document, the body of the document, or a specific
  4846. * DOM element.
  4847. * @param eventName The event to listen for.
  4848. * @param callback A handler function to invoke when the event occurs.
  4849. * @param options Options that configure how the event listener is bound.
  4850. * @returns An "unlisten" function for disposing of this handler.
  4851. */
  4852. abstract listen(target: 'window' | 'document' | 'body' | any, eventName: string, callback: (event: any) => boolean | void, options?: ListenerOptions): () => void;
  4853. }
  4854. /**
  4855. * This enum is meant to be used by `ɵtype` properties of the different renderers implemented
  4856. * by the framework
  4857. *
  4858. * We choose to not add `ɵtype` to `Renderer2` to no expose it to the public API.
  4859. */
  4860. declare const enum AnimationRendererType {
  4861. Regular = 0,
  4862. Delegated = 1
  4863. }
  4864. /**
  4865. * Options that can be used to configure an event listener.
  4866. * @publicApi
  4867. */
  4868. interface ListenerOptions {
  4869. capture?: boolean;
  4870. once?: boolean;
  4871. passive?: boolean;
  4872. }
  4873. /**
  4874. * The goal here is to make sure that the browser DOM API is the Renderer.
  4875. * We do this by defining a subset of DOM API to be the renderer and then
  4876. * use that at runtime for rendering.
  4877. *
  4878. * At runtime we can then use the DOM api directly, in server or web-worker
  4879. * it will be easy to implement such API.
  4880. */
  4881. type GlobalTargetName = 'document' | 'window' | 'body';
  4882. type GlobalTargetResolver = (element: any) => EventTarget;
  4883. /**
  4884. * Procedural style of API needed to create elements and text nodes.
  4885. *
  4886. * In non-native browser environments (e.g. platforms such as web-workers), this is the
  4887. * facade that enables element manipulation. In practice, this is implemented by `Renderer2`.
  4888. */
  4889. interface Renderer {
  4890. destroy(): void;
  4891. createComment(value: string): RComment;
  4892. createElement(name: string, namespace?: string | null): RElement;
  4893. createText(value: string): RText;
  4894. /**
  4895. * This property is allowed to be null / undefined,
  4896. * in which case the view engine won't call it.
  4897. * This is used as a performance optimization for production mode.
  4898. */
  4899. destroyNode?: ((node: RNode) => void) | null;
  4900. appendChild(parent: RElement, newChild: RNode): void;
  4901. insertBefore(parent: RNode, newChild: RNode, refChild: RNode | null, isMove?: boolean): void;
  4902. removeChild(parent: RElement | null, oldChild: RNode, isHostElement?: boolean): void;
  4903. selectRootElement(selectorOrNode: string | any, preserveContent?: boolean): RElement;
  4904. parentNode(node: RNode): RElement | null;
  4905. nextSibling(node: RNode): RNode | null;
  4906. setAttribute(el: RElement, name: string, value: string | TrustedHTML | TrustedScript | TrustedScriptURL, namespace?: string | null): void;
  4907. removeAttribute(el: RElement, name: string, namespace?: string | null): void;
  4908. addClass(el: RElement, name: string): void;
  4909. removeClass(el: RElement, name: string): void;
  4910. setStyle(el: RElement, style: string, value: any, flags?: RendererStyleFlags2): void;
  4911. removeStyle(el: RElement, style: string, flags?: RendererStyleFlags2): void;
  4912. setProperty(el: RElement, name: string, value: any): void;
  4913. setValue(node: RText | RComment, value: string): void;
  4914. listen(target: GlobalTargetName | RNode, eventName: string, callback: (event: any) => boolean | void, options?: ListenerOptions): () => void;
  4915. }
  4916. interface RendererFactory {
  4917. createRenderer(hostElement: RElement | null, rendererType: RendererType2 | null): Renderer;
  4918. begin?(): void;
  4919. end?(): void;
  4920. }
  4921. declare const HOST = 0;
  4922. declare const TVIEW = 1;
  4923. declare const FLAGS = 2;
  4924. declare const PARENT = 3;
  4925. declare const NEXT = 4;
  4926. declare const T_HOST = 5;
  4927. declare const HYDRATION = 6;
  4928. declare const CLEANUP = 7;
  4929. declare const CONTEXT = 8;
  4930. declare const INJECTOR$1 = 9;
  4931. declare const ENVIRONMENT = 10;
  4932. declare const RENDERER = 11;
  4933. declare const CHILD_HEAD = 12;
  4934. declare const CHILD_TAIL = 13;
  4935. declare const DECLARATION_VIEW = 14;
  4936. declare const DECLARATION_COMPONENT_VIEW = 15;
  4937. declare const DECLARATION_LCONTAINER = 16;
  4938. declare const PREORDER_HOOK_FLAGS = 17;
  4939. declare const QUERIES = 18;
  4940. declare const ID = 19;
  4941. declare const EMBEDDED_VIEW_INJECTOR = 20;
  4942. declare const ON_DESTROY_HOOKS = 21;
  4943. declare const EFFECTS_TO_SCHEDULE = 22;
  4944. declare const EFFECTS = 23;
  4945. declare const REACTIVE_TEMPLATE_CONSUMER = 24;
  4946. declare const AFTER_RENDER_SEQUENCES_TO_ADD = 25;
  4947. interface OpaqueViewState {
  4948. '__brand__': 'Brand for OpaqueViewState that nothing will match';
  4949. }
  4950. /**
  4951. * `LView` stores all of the information needed to process the instructions as
  4952. * they are invoked from the template. Each embedded view and component view has its
  4953. * own `LView`. When processing a particular view, we set the `viewData` to that
  4954. * `LView`. When that view is done processing, the `viewData` is set back to
  4955. * whatever the original `viewData` was before (the parent `LView`).
  4956. *
  4957. * Keeping separate state for each view facilities view insertion / deletion, so we
  4958. * don't have to edit the data array based on which views are present.
  4959. */
  4960. interface LView<T = unknown> extends Array<any> {
  4961. /**
  4962. * The node into which this `LView` is inserted.
  4963. */
  4964. [HOST]: RElement | null;
  4965. /**
  4966. * The static data for this view. We need a reference to this so we can easily walk up the
  4967. * node tree in DI and get the TView.data array associated with a node (where the
  4968. * directive defs are stored).
  4969. */
  4970. readonly [TVIEW]: TView;
  4971. /** Flags for this view. See LViewFlags for more info. */
  4972. [FLAGS]: LViewFlags;
  4973. /**
  4974. * This may store an {@link LView} or {@link LContainer}.
  4975. *
  4976. * `LView` - The parent view. This is needed when we exit the view and must restore the previous
  4977. * LView. Without this, the render method would have to keep a stack of
  4978. * views as it is recursively rendering templates.
  4979. *
  4980. * `LContainer` - The current view is part of a container, and is an embedded view.
  4981. */
  4982. [PARENT]: LView | LContainer | null;
  4983. /**
  4984. *
  4985. * The next sibling LView or LContainer.
  4986. *
  4987. * Allows us to propagate between sibling view states that aren't in the same
  4988. * container. Embedded views already have a node.next, but it is only set for
  4989. * views in the same container. We need a way to link component views and views
  4990. * across containers as well.
  4991. */
  4992. [NEXT]: LView | LContainer | null;
  4993. /** Queries active for this view - nodes from a view are reported to those queries. */
  4994. [QUERIES]: LQueries | null;
  4995. /**
  4996. * Store the `TNode` of the location where the current `LView` is inserted into.
  4997. *
  4998. * Given:
  4999. * ```html
  5000. * <div>
  5001. * <ng-template><span></span></ng-template>
  5002. * </div>
  5003. * ```
  5004. *
  5005. * We end up with two `TView`s.
  5006. * - `parent` `TView` which contains `<div><!-- anchor --></div>`
  5007. * - `child` `TView` which contains `<span></span>`
  5008. *
  5009. * Typically the `child` is inserted into the declaration location of the `parent`, but it can be
  5010. * inserted anywhere. Because it can be inserted anywhere it is not possible to store the
  5011. * insertion information in the `TView` and instead we must store it in the `LView[T_HOST]`.
  5012. *
  5013. * So to determine where is our insertion parent we would execute:
  5014. * ```ts
  5015. * const parentLView = lView[PARENT];
  5016. * const parentTNode = lView[T_HOST];
  5017. * const insertionParent = parentLView[parentTNode.index];
  5018. * ```
  5019. *
  5020. *
  5021. * If `null`, this is the root view of an application (root component is in this view) and it has
  5022. * no parents.
  5023. */
  5024. [T_HOST]: TNode | null;
  5025. /**
  5026. * When a view is destroyed, listeners need to be released and outputs need to be
  5027. * unsubscribed. This context array stores both listener functions wrapped with
  5028. * their context and output subscription instances for a particular view.
  5029. *
  5030. * These change per LView instance, so they cannot be stored on TView. Instead,
  5031. * TView.cleanup saves an index to the necessary context in this array.
  5032. *
  5033. * After `LView` is created it is possible to attach additional instance specific functions at the
  5034. * end of the `lView[CLEANUP]` because we know that no more `T` level cleanup functions will be
  5035. * added here.
  5036. */
  5037. [CLEANUP]: any[] | null;
  5038. /**
  5039. * - For dynamic views, this is the context with which to render the template (e.g.
  5040. * `NgForContext`), or `{}` if not defined explicitly.
  5041. * - For root view of the root component it's a reference to the component instance itself.
  5042. * - For components, the context is a reference to the component instance itself.
  5043. * - For inline views, the context is null.
  5044. */
  5045. [CONTEXT]: T;
  5046. /** A Module Injector to be used as fall back after Element Injectors are consulted. */
  5047. readonly [INJECTOR$1]: Injector;
  5048. /**
  5049. * Contextual data that is shared across multiple instances of `LView` in the same application.
  5050. */
  5051. [ENVIRONMENT]: LViewEnvironment;
  5052. /** Renderer to be used for this view. */
  5053. [RENDERER]: Renderer;
  5054. /**
  5055. * Reference to the first LView or LContainer beneath this LView in
  5056. * the hierarchy.
  5057. *
  5058. * Necessary to store this so views can traverse through their nested views
  5059. * to remove listeners and call onDestroy callbacks.
  5060. */
  5061. [CHILD_HEAD]: LView | LContainer | null;
  5062. /**
  5063. * The last LView or LContainer beneath this LView in the hierarchy.
  5064. *
  5065. * The tail allows us to quickly add a new state to the end of the view list
  5066. * without having to propagate starting from the first child.
  5067. */
  5068. [CHILD_TAIL]: LView | LContainer | null;
  5069. /**
  5070. * View where this view's template was declared.
  5071. *
  5072. * The template for a dynamically created view may be declared in a different view than
  5073. * it is inserted. We already track the "insertion view" (view where the template was
  5074. * inserted) in LView[PARENT], but we also need access to the "declaration view"
  5075. * (view where the template was declared). Otherwise, we wouldn't be able to call the
  5076. * view's template function with the proper contexts. Context should be inherited from
  5077. * the declaration view tree, not the insertion view tree.
  5078. *
  5079. * Example (AppComponent template):
  5080. *
  5081. * <ng-template #foo></ng-template> <-- declared here -->
  5082. * <some-comp [tpl]="foo"></some-comp> <-- inserted inside this component -->
  5083. *
  5084. * The <ng-template> above is declared in the AppComponent template, but it will be passed into
  5085. * SomeComp and inserted there. In this case, the declaration view would be the AppComponent,
  5086. * but the insertion view would be SomeComp. When we are removing views, we would want to
  5087. * traverse through the insertion view to clean up listeners. When we are calling the
  5088. * template function during change detection, we need the declaration view to get inherited
  5089. * context.
  5090. */
  5091. [DECLARATION_VIEW]: LView | null;
  5092. /**
  5093. * Points to the declaration component view, used to track transplanted `LView`s.
  5094. *
  5095. * See: `DECLARATION_VIEW` which points to the actual `LView` where it was declared, whereas
  5096. * `DECLARATION_COMPONENT_VIEW` points to the component which may not be same as
  5097. * `DECLARATION_VIEW`.
  5098. *
  5099. * Example:
  5100. * ```html
  5101. * <#VIEW #myComp>
  5102. * <div *ngIf="true">
  5103. * <ng-template #myTmpl>...</ng-template>
  5104. * </div>
  5105. * </#VIEW>
  5106. * ```
  5107. * In the above case `DECLARATION_VIEW` for `myTmpl` points to the `LView` of `ngIf` whereas
  5108. * `DECLARATION_COMPONENT_VIEW` points to `LView` of the `myComp` which owns the template.
  5109. *
  5110. * The reason for this is that all embedded views are always check-always whereas the component
  5111. * view can be check-always or on-push. When we have a transplanted view it is important to
  5112. * determine if we have transplanted a view from check-always declaration to on-push insertion
  5113. * point. In such a case the transplanted view needs to be added to the `LContainer` in the
  5114. * declared `LView` and CD during the declared view CD (in addition to the CD at the insertion
  5115. * point.) (Any transplanted views which are intra Component are of no interest because the CD
  5116. * strategy of declaration and insertion will always be the same, because it is the same
  5117. * component.)
  5118. *
  5119. * Queries already track moved views in `LView[DECLARATION_LCONTAINER]` and
  5120. * `LContainer[MOVED_VIEWS]`. However the queries also track `LView`s which moved within the same
  5121. * component `LView`. Transplanted views are a subset of moved views, and we use
  5122. * `DECLARATION_COMPONENT_VIEW` to differentiate them. As in this example.
  5123. *
  5124. * Example showing intra component `LView` movement.
  5125. * ```html
  5126. * <#VIEW #myComp>
  5127. * <div *ngIf="condition; then thenBlock else elseBlock"></div>
  5128. * <ng-template #thenBlock>Content to render when condition is true.</ng-template>
  5129. * <ng-template #elseBlock>Content to render when condition is false.</ng-template>
  5130. * </#VIEW>
  5131. * ```
  5132. * The `thenBlock` and `elseBlock` is moved but not transplanted.
  5133. *
  5134. * Example showing inter component `LView` movement (transplanted view).
  5135. * ```html
  5136. * <#VIEW #myComp>
  5137. * <ng-template #myTmpl>...</ng-template>
  5138. * <insertion-component [template]="myTmpl"></insertion-component>
  5139. * </#VIEW>
  5140. * ```
  5141. * In the above example `myTmpl` is passed into a different component. If `insertion-component`
  5142. * instantiates `myTmpl` and `insertion-component` is on-push then the `LContainer` needs to be
  5143. * marked as containing transplanted views and those views need to be CD as part of the
  5144. * declaration CD.
  5145. *
  5146. *
  5147. * When change detection runs, it iterates over `[MOVED_VIEWS]` and CDs any child `LView`s where
  5148. * the `DECLARATION_COMPONENT_VIEW` of the current component and the child `LView` does not match
  5149. * (it has been transplanted across components.)
  5150. *
  5151. * Note: `[DECLARATION_COMPONENT_VIEW]` points to itself if the LView is a component view (the
  5152. * simplest / most common case).
  5153. *
  5154. * see also:
  5155. * - https://hackmd.io/@mhevery/rJUJsvv9H write up of the problem
  5156. * - `LContainer[HAS_TRANSPLANTED_VIEWS]` which marks which `LContainer` has transplanted views.
  5157. * - `LContainer[TRANSPLANT_HEAD]` and `LContainer[TRANSPLANT_TAIL]` storage for transplanted
  5158. * - `LView[DECLARATION_LCONTAINER]` similar problem for queries
  5159. * - `LContainer[MOVED_VIEWS]` similar problem for queries
  5160. */
  5161. [DECLARATION_COMPONENT_VIEW]: LView;
  5162. /**
  5163. * A declaration point of embedded views (ones instantiated based on the content of a
  5164. * <ng-template>), null for other types of views.
  5165. *
  5166. * We need to track all embedded views created from a given declaration point so we can prepare
  5167. * query matches in a proper order (query matches are ordered based on their declaration point and
  5168. * _not_ the insertion point).
  5169. */
  5170. [DECLARATION_LCONTAINER]: LContainer | null;
  5171. /**
  5172. * More flags for this view. See PreOrderHookFlags for more info.
  5173. */
  5174. [PREORDER_HOOK_FLAGS]: PreOrderHookFlags;
  5175. /** Unique ID of the view. Used for `__ngContext__` lookups in the `LView` registry. */
  5176. [ID]: number;
  5177. /**
  5178. * A container related to hydration annotation information that's associated with this LView.
  5179. */
  5180. [HYDRATION]: DehydratedView | null;
  5181. /**
  5182. * Optional injector assigned to embedded views that takes
  5183. * precedence over the element and module injectors.
  5184. */
  5185. readonly [EMBEDDED_VIEW_INJECTOR]: Injector | null;
  5186. /**
  5187. * Effect scheduling operations that need to run during this views's update pass.
  5188. */
  5189. [EFFECTS_TO_SCHEDULE]: Array<() => void> | null;
  5190. [EFFECTS]: Set<ViewEffectNode> | null;
  5191. /**
  5192. * A collection of callbacks functions that are executed when a given LView is destroyed. Those
  5193. * are user defined, LView-specific destroy callbacks that don't have any corresponding TView
  5194. * entries.
  5195. */
  5196. [ON_DESTROY_HOOKS]: Array<() => void> | null;
  5197. /**
  5198. * The `Consumer` for this `LView`'s template so that signal reads can be tracked.
  5199. *
  5200. * This is initially `null` and gets assigned a consumer after template execution
  5201. * if any signals were read.
  5202. */
  5203. [REACTIVE_TEMPLATE_CONSUMER]: ReactiveLViewConsumer | null;
  5204. [AFTER_RENDER_SEQUENCES_TO_ADD]: AfterRenderSequence[] | null;
  5205. }
  5206. /**
  5207. * Contextual data that is shared across multiple instances of `LView` in the same application.
  5208. */
  5209. interface LViewEnvironment {
  5210. /** Factory to be used for creating Renderer. */
  5211. rendererFactory: RendererFactory;
  5212. /** An optional custom sanitizer. */
  5213. sanitizer: Sanitizer | null;
  5214. /** Scheduler for change detection to notify when application state changes. */
  5215. changeDetectionScheduler: ChangeDetectionScheduler | null;
  5216. }
  5217. /** Flags associated with an LView (saved in LView[FLAGS]) */
  5218. declare const enum LViewFlags {
  5219. /** The state of the init phase on the first 2 bits */
  5220. InitPhaseStateIncrementer = 1,
  5221. InitPhaseStateMask = 3,
  5222. /**
  5223. * Whether or not the view is in creationMode.
  5224. *
  5225. * This must be stored in the view rather than using `data` as a marker so that
  5226. * we can properly support embedded views. Otherwise, when exiting a child view
  5227. * back into the parent view, `data` will be defined and `creationMode` will be
  5228. * improperly reported as false.
  5229. */
  5230. CreationMode = 4,
  5231. /**
  5232. * Whether or not this LView instance is on its first processing pass.
  5233. *
  5234. * An LView instance is considered to be on its "first pass" until it
  5235. * has completed one creation mode run and one update mode run. At this
  5236. * time, the flag is turned off.
  5237. */
  5238. FirstLViewPass = 8,
  5239. /** Whether this view has default change detection strategy (checks always) or onPush */
  5240. CheckAlways = 16,
  5241. /** Whether there are any i18n blocks inside this LView. */
  5242. HasI18n = 32,
  5243. /** Whether or not this view is currently dirty (needing check) */
  5244. Dirty = 64,
  5245. /** Whether or not this view is currently attached to change detection tree. */
  5246. Attached = 128,
  5247. /** Whether or not this view is destroyed. */
  5248. Destroyed = 256,
  5249. /** Whether or not this view is the root view */
  5250. IsRoot = 512,
  5251. /**
  5252. * Whether this moved LView needs to be refreshed. Similar to the Dirty flag, but used for
  5253. * transplanted and signal views where the parent/ancestor views are not marked dirty as well.
  5254. * i.e. "Refresh just this view". Used in conjunction with the HAS_CHILD_VIEWS_TO_REFRESH
  5255. * flag.
  5256. */
  5257. RefreshView = 1024,
  5258. /** Indicates that the view **or any of its ancestors** have an embedded view injector. */
  5259. HasEmbeddedViewInjector = 2048,
  5260. /** Indicates that the view was created with `signals: true`. */
  5261. SignalView = 4096,
  5262. /**
  5263. * Indicates that this LView has a view underneath it that needs to be refreshed during change
  5264. * detection. This flag indicates that even if this view is not dirty itself, we still need to
  5265. * traverse its children during change detection.
  5266. */
  5267. HasChildViewsToRefresh = 8192,
  5268. /**
  5269. * This is the count of the bits the 1 was shifted above (base 10)
  5270. */
  5271. IndexWithinInitPhaseShift = 14,
  5272. /**
  5273. * Index of the current init phase on last 21 bits
  5274. */
  5275. IndexWithinInitPhaseIncrementer = 16384,
  5276. IndexWithinInitPhaseReset = 16383
  5277. }
  5278. /** More flags associated with an LView (saved in LView[PREORDER_HOOK_FLAGS]) */
  5279. declare const enum PreOrderHookFlags {
  5280. /**
  5281. The index of the next pre-order hook to be called in the hooks array, on the first 16
  5282. bits
  5283. */
  5284. IndexOfTheNextPreOrderHookMaskMask = 65535,
  5285. /**
  5286. * The number of init hooks that have already been called, on the last 16 bits
  5287. */
  5288. NumberOfInitHooksCalledIncrementer = 65536,
  5289. NumberOfInitHooksCalledShift = 16,
  5290. NumberOfInitHooksCalledMask = 4294901760
  5291. }
  5292. /**
  5293. * Stores a set of OpCodes to process `HostBindingsFunction` associated with a current view.
  5294. *
  5295. * In order to invoke `HostBindingsFunction` we need:
  5296. * 1. 'elementIdx`: Index to the element associated with the `HostBindingsFunction`.
  5297. * 2. 'directiveIdx`: Index to the directive associated with the `HostBindingsFunction`. (This will
  5298. * become the context for the `HostBindingsFunction` invocation.)
  5299. * 3. `bindingRootIdx`: Location where the bindings for the `HostBindingsFunction` start. Internally
  5300. * `HostBindingsFunction` binding indexes start from `0` so we need to add `bindingRootIdx` to
  5301. * it.
  5302. * 4. `HostBindingsFunction`: A host binding function to execute.
  5303. *
  5304. * The above information needs to be encoded into the `HostBindingOpCodes` in an efficient manner.
  5305. *
  5306. * 1. `elementIdx` is encoded into the `HostBindingOpCodes` as `~elementIdx` (so a negative number);
  5307. * 2. `directiveIdx`
  5308. * 3. `bindingRootIdx`
  5309. * 4. `HostBindingsFunction` is passed in as is.
  5310. *
  5311. * The `HostBindingOpCodes` array contains:
  5312. * - negative number to select the element index.
  5313. * - followed by 1 or more of:
  5314. * - a number to select the directive index
  5315. * - a number to select the bindingRoot index
  5316. * - and a function to invoke.
  5317. *
  5318. * ## Example
  5319. *
  5320. * ```ts
  5321. * const hostBindingOpCodes = [
  5322. * ~30, // Select element 30
  5323. * 40, 45, MyDir.ɵdir.hostBindings // Invoke host bindings on MyDir on element 30;
  5324. * // directiveIdx = 40; bindingRootIdx = 45;
  5325. * 50, 55, OtherDir.ɵdir.hostBindings // Invoke host bindings on OtherDire on element 30
  5326. * // directiveIdx = 50; bindingRootIdx = 55;
  5327. * ]
  5328. * ```
  5329. *
  5330. * ## Pseudocode
  5331. * ```ts
  5332. * const hostBindingOpCodes = tView.hostBindingOpCodes;
  5333. * if (hostBindingOpCodes === null) return;
  5334. * for (let i = 0; i < hostBindingOpCodes.length; i++) {
  5335. * const opCode = hostBindingOpCodes[i] as number;
  5336. * if (opCode < 0) {
  5337. * // Negative numbers are element indexes.
  5338. * setSelectedIndex(~opCode);
  5339. * } else {
  5340. * // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.
  5341. * const directiveIdx = opCode;
  5342. * const bindingRootIndx = hostBindingOpCodes[++i] as number;
  5343. * const hostBindingFn = hostBindingOpCodes[++i] as HostBindingsFunction<any>;
  5344. * setBindingRootForHostBindings(bindingRootIndx, directiveIdx);
  5345. * const context = lView[directiveIdx];
  5346. * hostBindingFn(RenderFlags.Update, context);
  5347. * }
  5348. * }
  5349. * ```
  5350. *
  5351. */
  5352. interface HostBindingOpCodes extends Array<number | HostBindingsFunction<any>> {
  5353. __brand__: 'HostBindingOpCodes';
  5354. debug?: string[];
  5355. }
  5356. /**
  5357. * Explicitly marks `TView` as a specific type in `ngDevMode`
  5358. *
  5359. * It is useful to know conceptually what time of `TView` we are dealing with when
  5360. * debugging an application (even if the runtime does not need it.) For this reason
  5361. * we store this information in the `ngDevMode` `TView` and than use it for
  5362. * better debugging experience.
  5363. */
  5364. declare const enum TViewType {
  5365. /**
  5366. * Root `TView` is the used to bootstrap components into. It is used in conjunction with
  5367. * `LView` which takes an existing DOM node not owned by Angular and wraps it in `TView`/`LView`
  5368. * so that other components can be loaded into it.
  5369. */
  5370. Root = 0,
  5371. /**
  5372. * `TView` associated with a Component. This would be the `TView` directly associated with the
  5373. * component view (as opposed an `Embedded` `TView` which would be a child of `Component` `TView`)
  5374. */
  5375. Component = 1,
  5376. /**
  5377. * `TView` associated with a template. Such as `*ngIf`, `<ng-template>` etc... A `Component`
  5378. * can have zero or more `Embedded` `TView`s.
  5379. */
  5380. Embedded = 2
  5381. }
  5382. /**
  5383. * The static data for an LView (shared between all templates of a
  5384. * given type).
  5385. *
  5386. * Stored on the `ComponentDef.tView`.
  5387. */
  5388. interface TView {
  5389. /**
  5390. * Type of `TView` (`Root`|`Component`|`Embedded`).
  5391. */
  5392. type: TViewType;
  5393. /**
  5394. * This is a blueprint used to generate LView instances for this TView. Copying this
  5395. * blueprint is faster than creating a new LView from scratch.
  5396. */
  5397. blueprint: LView;
  5398. /**
  5399. * The template function used to refresh the view of dynamically created views
  5400. * and components. Will be null for inline views.
  5401. */
  5402. template: ComponentTemplate<{}> | null;
  5403. /**
  5404. * A function containing query-related instructions.
  5405. */
  5406. viewQuery: ViewQueriesFunction<{}> | null;
  5407. /**
  5408. * A `TNode` representing the declaration location of this `TView` (not part of this TView).
  5409. */
  5410. declTNode: TNode | null;
  5411. /** Whether or not this template has been processed in creation mode. */
  5412. firstCreatePass: boolean;
  5413. /**
  5414. * Whether or not this template has been processed in update mode (e.g. change detected)
  5415. *
  5416. * `firstUpdatePass` is used by styling to set up `TData` to contain metadata about the styling
  5417. * instructions. (Mainly to build up a linked list of styling priority order.)
  5418. *
  5419. * Typically this function gets cleared after first execution. If exception is thrown then this
  5420. * flag can remain turned un until there is first successful (no exception) pass. This means that
  5421. * individual styling instructions keep track of if they have already been added to the linked
  5422. * list to prevent double adding.
  5423. */
  5424. firstUpdatePass: boolean;
  5425. /** Static data equivalent of LView.data[]. Contains TNodes, PipeDefInternal or TI18n. */
  5426. data: TData;
  5427. /**
  5428. * The binding start index is the index at which the data array
  5429. * starts to store bindings only. Saving this value ensures that we
  5430. * will begin reading bindings at the correct point in the array when
  5431. * we are in update mode.
  5432. *
  5433. * -1 means that it has not been initialized.
  5434. */
  5435. bindingStartIndex: number;
  5436. /**
  5437. * The index where the "expando" section of `LView` begins. The expando
  5438. * section contains injectors, directive instances, and host binding values.
  5439. * Unlike the "decls" and "vars" sections of `LView`, the length of this
  5440. * section cannot be calculated at compile-time because directives are matched
  5441. * at runtime to preserve locality.
  5442. *
  5443. * We store this start index so we know where to start checking host bindings
  5444. * in `setHostBindings`.
  5445. */
  5446. expandoStartIndex: number;
  5447. /**
  5448. * Whether or not there are any static view queries tracked on this view.
  5449. *
  5450. * We store this so we know whether or not we should do a view query
  5451. * refresh after creation mode to collect static query results.
  5452. */
  5453. staticViewQueries: boolean;
  5454. /**
  5455. * Whether or not there are any static content queries tracked on this view.
  5456. *
  5457. * We store this so we know whether or not we should do a content query
  5458. * refresh after creation mode to collect static query results.
  5459. */
  5460. staticContentQueries: boolean;
  5461. /**
  5462. * A reference to the first child node located in the view.
  5463. */
  5464. firstChild: TNode | null;
  5465. /**
  5466. * Stores the OpCodes to be replayed during change-detection to process the `HostBindings`
  5467. *
  5468. * See `HostBindingOpCodes` for encoding details.
  5469. */
  5470. hostBindingOpCodes: HostBindingOpCodes | null;
  5471. /**
  5472. * Full registry of directives and components that may be found in this view.
  5473. *
  5474. * It's necessary to keep a copy of the full def list on the TView so it's possible
  5475. * to render template functions without a host component.
  5476. */
  5477. directiveRegistry: DirectiveDefList | null;
  5478. /**
  5479. * Full registry of pipes that may be found in this view.
  5480. *
  5481. * The property is either an array of `PipeDefs`s or a function which returns the array of
  5482. * `PipeDefs`s. The function is necessary to be able to support forward declarations.
  5483. *
  5484. * It's necessary to keep a copy of the full def list on the TView so it's possible
  5485. * to render template functions without a host component.
  5486. */
  5487. pipeRegistry: PipeDefList | null;
  5488. /**
  5489. * Array of ngOnInit, ngOnChanges and ngDoCheck hooks that should be executed for this view in
  5490. * creation mode.
  5491. *
  5492. * This array has a flat structure and contains TNode indices, directive indices (where an
  5493. * instance can be found in `LView`) and hook functions. TNode index is followed by the directive
  5494. * index and a hook function. If there are multiple hooks for a given TNode, the TNode index is
  5495. * not repeated and the next lifecycle hook information is stored right after the previous hook
  5496. * function. This is done so that at runtime the system can efficiently iterate over all of the
  5497. * functions to invoke without having to make any decisions/lookups.
  5498. */
  5499. preOrderHooks: HookData | null;
  5500. /**
  5501. * Array of ngOnChanges and ngDoCheck hooks that should be executed for this view in update mode.
  5502. *
  5503. * This array has the same structure as the `preOrderHooks` one.
  5504. */
  5505. preOrderCheckHooks: HookData | null;
  5506. /**
  5507. * Array of ngAfterContentInit and ngAfterContentChecked hooks that should be executed
  5508. * for this view in creation mode.
  5509. *
  5510. * Even indices: Directive index
  5511. * Odd indices: Hook function
  5512. */
  5513. contentHooks: HookData | null;
  5514. /**
  5515. * Array of ngAfterContentChecked hooks that should be executed for this view in update
  5516. * mode.
  5517. *
  5518. * Even indices: Directive index
  5519. * Odd indices: Hook function
  5520. */
  5521. contentCheckHooks: HookData | null;
  5522. /**
  5523. * Array of ngAfterViewInit and ngAfterViewChecked hooks that should be executed for
  5524. * this view in creation mode.
  5525. *
  5526. * Even indices: Directive index
  5527. * Odd indices: Hook function
  5528. */
  5529. viewHooks: HookData | null;
  5530. /**
  5531. * Array of ngAfterViewChecked hooks that should be executed for this view in
  5532. * update mode.
  5533. *
  5534. * Even indices: Directive index
  5535. * Odd indices: Hook function
  5536. */
  5537. viewCheckHooks: HookData | null;
  5538. /**
  5539. * Array of ngOnDestroy hooks that should be executed when this view is destroyed.
  5540. *
  5541. * Even indices: Directive index
  5542. * Odd indices: Hook function
  5543. */
  5544. destroyHooks: DestroyHookData | null;
  5545. /**
  5546. * When a view is destroyed, listeners need to be released and outputs need to be
  5547. * unsubscribed. This cleanup array stores both listener data (in chunks of 4)
  5548. * and output data (in chunks of 2) for a particular view. Combining the arrays
  5549. * saves on memory (70 bytes per array) and on a few bytes of code size (for two
  5550. * separate for loops).
  5551. *
  5552. * If it's a native DOM listener or output subscription being stored:
  5553. * 1st index is: event name `name = tView.cleanup[i+0]`
  5554. * 2nd index is: index of native element or a function that retrieves global target (window,
  5555. * document or body) reference based on the native element:
  5556. * `typeof idxOrTargetGetter === 'function'`: global target getter function
  5557. * `typeof idxOrTargetGetter === 'number'`: index of native element
  5558. *
  5559. * 3rd index is: index of listener function `listener = lView[CLEANUP][tView.cleanup[i+2]]`
  5560. * 4th index is: `useCaptureOrIndx = tView.cleanup[i+3]`
  5561. * `typeof useCaptureOrIndx == 'boolean' : useCapture boolean
  5562. * `typeof useCaptureOrIndx == 'number':
  5563. * `useCaptureOrIndx >= 0` `removeListener = LView[CLEANUP][useCaptureOrIndx]`
  5564. * `useCaptureOrIndx < 0` `subscription = LView[CLEANUP][-useCaptureOrIndx]`
  5565. *
  5566. * If it's an output subscription or query list destroy hook:
  5567. * 1st index is: output unsubscribe function / query list destroy function
  5568. * 2nd index is: index of function context in LView.cleanupInstances[]
  5569. * `tView.cleanup[i+0].call(lView[CLEANUP][tView.cleanup[i+1]])`
  5570. */
  5571. cleanup: any[] | null;
  5572. /**
  5573. * A list of element indices for child components that will need to be
  5574. * refreshed when the current view has finished its check. These indices have
  5575. * already been adjusted for the HEADER_OFFSET.
  5576. *
  5577. */
  5578. components: number[] | null;
  5579. /**
  5580. * A collection of queries tracked in a given view.
  5581. */
  5582. queries: TQueries | null;
  5583. /**
  5584. * An array of indices pointing to directives with content queries alongside with the
  5585. * corresponding query index. Each entry in this array is a tuple of:
  5586. * - index of the first content query index declared by a given directive;
  5587. * - index of a directive.
  5588. *
  5589. * We are storing those indexes so we can refresh content queries as part of a view refresh
  5590. * process.
  5591. */
  5592. contentQueries: number[] | null;
  5593. /**
  5594. * Set of schemas that declare elements to be allowed inside the view.
  5595. */
  5596. schemas: SchemaMetadata[] | null;
  5597. /**
  5598. * Array of constants for the view. Includes attribute arrays, local definition arrays etc.
  5599. * Used for directive matching, attribute bindings, local definitions and more.
  5600. */
  5601. consts: TConstants | null;
  5602. /**
  5603. * Indicates that there was an error before we managed to complete the first create pass of the
  5604. * view. This means that the view is likely corrupted and we should try to recover it.
  5605. */
  5606. incompleteFirstPass: boolean;
  5607. /**
  5608. * Unique id of this TView for hydration purposes:
  5609. * - TViewType.Embedded: a unique id generated during serialization on the server
  5610. * - TViewType.Component: an id generated based on component properties
  5611. * (see `getComponentId` function for details)
  5612. */
  5613. ssrId: string | null;
  5614. }
  5615. /** Single hook callback function. */
  5616. type HookFn = () => void;
  5617. /**
  5618. * Information necessary to call a hook. E.g. the callback that
  5619. * needs to invoked and the index at which to find its context.
  5620. */
  5621. type HookEntry = number | HookFn;
  5622. /**
  5623. * Array of hooks that should be executed for a view and their directive indices.
  5624. *
  5625. * For each node of the view, the following data is stored:
  5626. * 1) Node index (optional)
  5627. * 2) A series of number/function pairs where:
  5628. * - even indices are directive indices
  5629. * - odd indices are hook functions
  5630. *
  5631. * Special cases:
  5632. * - a negative directive index flags an init hook (ngOnInit, ngAfterContentInit, ngAfterViewInit)
  5633. */
  5634. type HookData = HookEntry[];
  5635. /**
  5636. * Array of destroy hooks that should be executed for a view and their directive indices.
  5637. *
  5638. * The array is set up as a series of number/function or number/(number|function)[]:
  5639. * - Even indices represent the context with which hooks should be called.
  5640. * - Odd indices are the hook functions themselves. If a value at an odd index is an array,
  5641. * it represents the destroy hooks of a `multi` provider where:
  5642. * - Even indices represent the index of the provider for which we've registered a destroy hook,
  5643. * inside of the `multi` provider array.
  5644. * - Odd indices are the destroy hook functions.
  5645. * For example:
  5646. * LView: `[0, 1, 2, AService, 4, [BService, CService, DService]]`
  5647. * destroyHooks: `[3, AService.ngOnDestroy, 5, [0, BService.ngOnDestroy, 2, DService.ngOnDestroy]]`
  5648. *
  5649. * In the example above `AService` is a type provider with an `ngOnDestroy`, whereas `BService`,
  5650. * `CService` and `DService` are part of a `multi` provider where only `BService` and `DService`
  5651. * have an `ngOnDestroy` hook.
  5652. */
  5653. type DestroyHookData = (HookEntry | HookData)[];
  5654. /**
  5655. * Static data that corresponds to the instance-specific data array on an LView.
  5656. *
  5657. * Each node's static data is stored in tData at the same index that it's stored
  5658. * in the data array. Any nodes that do not have static data store a null value in
  5659. * tData to avoid a sparse array.
  5660. *
  5661. * Each pipe's definition is stored here at the same index as its pipe instance in
  5662. * the data array.
  5663. *
  5664. * Each host property's name is stored here at the same index as its value in the
  5665. * data array.
  5666. *
  5667. * Each property binding name is stored here at the same index as its value in
  5668. * the data array. If the binding is an interpolation, the static string values
  5669. * are stored parallel to the dynamic values. Example:
  5670. *
  5671. * id="prefix {{ v0 }} a {{ v1 }} b {{ v2 }} suffix"
  5672. *
  5673. * LView | TView.data
  5674. *------------------------
  5675. * v0 value | 'a'
  5676. * v1 value | 'b'
  5677. * v2 value | id � prefix � suffix
  5678. *
  5679. * Injector bloom filters are also stored here.
  5680. */
  5681. type TData = (TNode | PipeDef<any> | DirectiveDef<any> | ComponentDef<any> | number | TStylingRange | TStylingKey | ProviderToken<any> | TI18n | I18nUpdateOpCodes | TIcu | null | string | TDeferBlockDetails)[];
  5682. /**
  5683. * `DestroyRef` lets you set callbacks to run for any cleanup or destruction behavior.
  5684. * The scope of this destruction depends on where `DestroyRef` is injected. If `DestroyRef`
  5685. * is injected in a component or directive, the callbacks run when that component or
  5686. * directive is destroyed. Otherwise the callbacks run when a corresponding injector is destroyed.
  5687. *
  5688. * @publicApi
  5689. */
  5690. declare abstract class DestroyRef {
  5691. /**
  5692. * Registers a destroy callback in a given lifecycle scope. Returns a cleanup function that can
  5693. * be invoked to unregister the callback.
  5694. *
  5695. * @usageNotes
  5696. * ### Example
  5697. * ```ts
  5698. * const destroyRef = inject(DestroyRef);
  5699. *
  5700. * // register a destroy callback
  5701. * const unregisterFn = destroyRef.onDestroy(() => doSomethingOnDestroy());
  5702. *
  5703. * // stop the destroy callback from executing if needed
  5704. * unregisterFn();
  5705. * ```
  5706. */
  5707. abstract onDestroy(callback: () => void): () => void;
  5708. }
  5709. /**
  5710. * An `OutputEmitterRef` is created by the `output()` function and can be
  5711. * used to emit values to consumers of your directive or component.
  5712. *
  5713. * Consumers of your directive/component can bind to the output and
  5714. * subscribe to changes via the bound event syntax. For example:
  5715. *
  5716. * ```html
  5717. * <my-comp (valueChange)="processNewValue($event)" />
  5718. * ```
  5719. *
  5720. * @publicAPI
  5721. */
  5722. declare class OutputEmitterRef<T> implements OutputRef<T> {
  5723. private destroyed;
  5724. private listeners;
  5725. private errorHandler;
  5726. constructor();
  5727. subscribe(callback: (value: T) => void): OutputRefSubscription;
  5728. /** Emits a new value to the output. */
  5729. emit(value: T): void;
  5730. }
  5731. /** Gets the owning `DestroyRef` for the given output. */
  5732. declare function getOutputDestroyRef(ref: OutputRef<unknown>): DestroyRef | undefined;
  5733. /**
  5734. * Options for declaring an output.
  5735. *
  5736. * @publicAPI
  5737. */
  5738. interface OutputOptions {
  5739. alias?: string;
  5740. }
  5741. /**
  5742. * The `output` function allows declaration of Angular outputs in
  5743. * directives and components.
  5744. *
  5745. * You can use outputs to emit values to parent directives and component.
  5746. * Parents can subscribe to changes via:
  5747. *
  5748. * - template event bindings. For example, `(myOutput)="doSomething($event)"`
  5749. * - programmatic subscription by using `OutputRef#subscribe`.
  5750. *
  5751. * @usageNotes
  5752. *
  5753. * To use `output()`, import the function from `@angular/core`.
  5754. *
  5755. * ```ts
  5756. * import {output} from '@angular/core';
  5757. * ```
  5758. *
  5759. * Inside your component, introduce a new class member and initialize
  5760. * it with a call to `output`.
  5761. *
  5762. * ```ts
  5763. * @Directive({
  5764. * ...
  5765. * })
  5766. * export class MyDir {
  5767. * nameChange = output<string>(); // OutputEmitterRef<string>
  5768. * onClick = output(); // OutputEmitterRef<void>
  5769. * }
  5770. * ```
  5771. *
  5772. * You can emit values to consumers of your directive, by using
  5773. * the `emit` method from `OutputEmitterRef`.
  5774. *
  5775. * ```ts
  5776. * updateName(newName: string): void {
  5777. * this.nameChange.emit(newName);
  5778. * }
  5779. * ```
  5780. * @initializerApiFunction {"showTypesInSignaturePreview": true}
  5781. * @publicAPI
  5782. */
  5783. declare function output<T = void>(opts?: OutputOptions): OutputEmitterRef<T>;
  5784. /**
  5785. * Type of the `viewChild` function. The viewChild function creates a singular view query.
  5786. *
  5787. * It is a special function that also provides access to required query results via the `.required`
  5788. * property.
  5789. *
  5790. * @publicAPI
  5791. * @docsPrivate Ignored because `viewChild` is the canonical API entry.
  5792. */
  5793. interface ViewChildFunction {
  5794. /**
  5795. * Initializes a view child query. Consider using `viewChild.required` for queries that should
  5796. * always match.
  5797. *
  5798. * @publicAPI
  5799. */
  5800. <LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  5801. read: ProviderToken<ReadT>;
  5802. debugName?: string;
  5803. }): Signal<ReadT | undefined>;
  5804. <LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  5805. debugName?: string;
  5806. }): Signal<LocatorT | undefined>;
  5807. /**
  5808. * Initializes a view child query that is expected to always match an element.
  5809. *
  5810. * @publicAPI
  5811. */
  5812. required: {
  5813. <LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  5814. debugName?: string;
  5815. }): Signal<LocatorT>;
  5816. <LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  5817. read: ProviderToken<ReadT>;
  5818. debugName?: string;
  5819. }): Signal<ReadT>;
  5820. };
  5821. }
  5822. /**
  5823. * Initializes a view child query.
  5824. *
  5825. * Consider using `viewChild.required` for queries that should always match.
  5826. *
  5827. * @usageNotes
  5828. * Create a child query in your component by declaring a
  5829. * class field and initializing it with the `viewChild()` function.
  5830. *
  5831. * ```angular-ts
  5832. * @Component({template: '<div #el></div><my-component #cmp />'})
  5833. * export class TestComponent {
  5834. * divEl = viewChild<ElementRef>('el'); // Signal<ElementRef|undefined>
  5835. * divElRequired = viewChild.required<ElementRef>('el'); // Signal<ElementRef>
  5836. * cmp = viewChild(MyComponent); // Signal<MyComponent|undefined>
  5837. * cmpRequired = viewChild.required(MyComponent); // Signal<MyComponent>
  5838. * }
  5839. * ```
  5840. *
  5841. * @publicAPI
  5842. * @initializerApiFunction
  5843. */
  5844. declare const viewChild: ViewChildFunction;
  5845. declare function viewChildren<LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  5846. debugName?: string;
  5847. }): Signal<ReadonlyArray<LocatorT>>;
  5848. declare function viewChildren<LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  5849. read: ProviderToken<ReadT>;
  5850. debugName?: string;
  5851. }): Signal<ReadonlyArray<ReadT>>;
  5852. /**
  5853. * Type of the `contentChild` function.
  5854. *
  5855. * The contentChild function creates a singular content query. It is a special function that also
  5856. * provides access to required query results via the `.required` property.
  5857. *
  5858. * @publicAPI
  5859. * @docsPrivate Ignored because `contentChild` is the canonical API entry.
  5860. */
  5861. interface ContentChildFunction {
  5862. /**
  5863. * Initializes a content child query.
  5864. *
  5865. * Consider using `contentChild.required` for queries that should always match.
  5866. * @publicAPI
  5867. */
  5868. <LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  5869. descendants?: boolean;
  5870. read?: undefined;
  5871. debugName?: string;
  5872. }): Signal<LocatorT | undefined>;
  5873. <LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  5874. descendants?: boolean;
  5875. read: ProviderToken<ReadT>;
  5876. debugName?: string;
  5877. }): Signal<ReadT | undefined>;
  5878. /**
  5879. * Initializes a content child query that is always expected to match.
  5880. */
  5881. required: {
  5882. <LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  5883. descendants?: boolean;
  5884. read?: undefined;
  5885. debugName?: string;
  5886. }): Signal<LocatorT>;
  5887. <LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  5888. descendants?: boolean;
  5889. read: ProviderToken<ReadT>;
  5890. debugName?: string;
  5891. }): Signal<ReadT>;
  5892. };
  5893. }
  5894. /**
  5895. * Initializes a content child query. Consider using `contentChild.required` for queries that should
  5896. * always match.
  5897. *
  5898. * @usageNotes
  5899. * Create a child query in your component by declaring a
  5900. * class field and initializing it with the `contentChild()` function.
  5901. *
  5902. * ```ts
  5903. * @Component({...})
  5904. * export class TestComponent {
  5905. * headerEl = contentChild<ElementRef>('h'); // Signal<ElementRef|undefined>
  5906. * headerElElRequired = contentChild.required<ElementRef>('h'); // Signal<ElementRef>
  5907. * header = contentChild(MyHeader); // Signal<MyHeader|undefined>
  5908. * headerRequired = contentChild.required(MyHeader); // Signal<MyHeader>
  5909. * }
  5910. * ```
  5911. *
  5912. * @initializerApiFunction
  5913. * @publicAPI
  5914. */
  5915. declare const contentChild: ContentChildFunction;
  5916. declare function contentChildren<LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  5917. descendants?: boolean;
  5918. read?: undefined;
  5919. debugName?: string;
  5920. }): Signal<ReadonlyArray<LocatorT>>;
  5921. declare function contentChildren<LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  5922. descendants?: boolean;
  5923. read: ProviderToken<ReadT>;
  5924. debugName?: string;
  5925. }): Signal<ReadonlyArray<ReadT>>;
  5926. /**
  5927. * Type of the Attribute decorator / constructor function.
  5928. *
  5929. * @publicApi
  5930. */
  5931. interface AttributeDecorator {
  5932. /**
  5933. * Parameter decorator for a directive constructor that designates
  5934. * a host-element attribute whose value is injected as a constant string literal.
  5935. *
  5936. * @usageNotes
  5937. *
  5938. * Suppose we have an `<input>` element and want to know its `type`.
  5939. *
  5940. * ```html
  5941. * <input type="text">
  5942. * ```
  5943. *
  5944. * The following example uses the decorator to inject the string literal `text` in a directive.
  5945. *
  5946. * {@example core/ts/metadata/metadata.ts region='attributeMetadata'}
  5947. *
  5948. * The following example uses the decorator in a component constructor.
  5949. *
  5950. * {@example core/ts/metadata/metadata.ts region='attributeFactory'}
  5951. *
  5952. */
  5953. (name: string): any;
  5954. new (name: string): Attribute;
  5955. }
  5956. /**
  5957. * Type of the Attribute metadata.
  5958. *
  5959. * @publicApi
  5960. */
  5961. interface Attribute {
  5962. /**
  5963. * The name of the attribute whose value can be injected.
  5964. */
  5965. attributeName: string;
  5966. }
  5967. /**
  5968. * Attribute decorator and metadata.
  5969. *
  5970. * @Annotation
  5971. * @publicApi
  5972. */
  5973. declare const Attribute: AttributeDecorator;
  5974. /**
  5975. * Represents a basic change from a previous to a new value for a single
  5976. * property on a directive instance. Passed as a value in a
  5977. * {@link SimpleChanges} object to the `ngOnChanges` hook.
  5978. *
  5979. * @see {@link OnChanges}
  5980. *
  5981. * @publicApi
  5982. */
  5983. declare class SimpleChange {
  5984. previousValue: any;
  5985. currentValue: any;
  5986. firstChange: boolean;
  5987. constructor(previousValue: any, currentValue: any, firstChange: boolean);
  5988. /**
  5989. * Check whether the new value is the first value assigned.
  5990. */
  5991. isFirstChange(): boolean;
  5992. }
  5993. /**
  5994. * A hashtable of changes represented by {@link SimpleChange} objects stored
  5995. * at the declared property name they belong to on a Directive or Component. This is
  5996. * the type passed to the `ngOnChanges` hook.
  5997. *
  5998. * @see {@link OnChanges}
  5999. *
  6000. * @publicApi
  6001. */
  6002. interface SimpleChanges {
  6003. [propName: string]: SimpleChange;
  6004. }
  6005. /**
  6006. * @description
  6007. * A lifecycle hook that is called when any data-bound property of a directive changes.
  6008. * Define an `ngOnChanges()` method to handle the changes.
  6009. *
  6010. * @see {@link DoCheck}
  6011. * @see {@link OnInit}
  6012. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6013. *
  6014. * @usageNotes
  6015. * The following snippet shows how a component can implement this interface to
  6016. * define an on-changes handler for an input property.
  6017. *
  6018. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnChanges'}
  6019. *
  6020. * @publicApi
  6021. */
  6022. interface OnChanges {
  6023. /**
  6024. * A callback method that is invoked immediately after the
  6025. * default change detector has checked data-bound properties
  6026. * if at least one has changed, and before the view and content
  6027. * children are checked.
  6028. * @param changes The changed properties.
  6029. */
  6030. ngOnChanges(changes: SimpleChanges): void;
  6031. }
  6032. /**
  6033. * @description
  6034. * A lifecycle hook that is called after Angular has initialized
  6035. * all data-bound properties of a directive.
  6036. * Define an `ngOnInit()` method to handle any additional initialization tasks.
  6037. *
  6038. * @see {@link AfterContentInit}
  6039. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6040. *
  6041. * @usageNotes
  6042. * The following snippet shows how a component can implement this interface to
  6043. * define its own initialization method.
  6044. *
  6045. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnInit'}
  6046. *
  6047. * @publicApi
  6048. */
  6049. interface OnInit {
  6050. /**
  6051. * A callback method that is invoked immediately after the
  6052. * default change detector has checked the directive's
  6053. * data-bound properties for the first time,
  6054. * and before any of the view or content children have been checked.
  6055. * It is invoked only once when the directive is instantiated.
  6056. */
  6057. ngOnInit(): void;
  6058. }
  6059. /**
  6060. * A lifecycle hook that invokes a custom change-detection function for a directive,
  6061. * in addition to the check performed by the default change-detector.
  6062. *
  6063. * The default change-detection algorithm looks for differences by comparing
  6064. * bound-property values by reference across change detection runs. You can use this
  6065. * hook to check for and respond to changes by some other means.
  6066. *
  6067. * When the default change detector detects changes, it invokes `ngOnChanges()` if supplied,
  6068. * regardless of whether you perform additional change detection.
  6069. * Typically, you should not use both `DoCheck` and `OnChanges` to respond to
  6070. * changes on the same input.
  6071. *
  6072. * @see {@link OnChanges}
  6073. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6074. *
  6075. * @usageNotes
  6076. * The following snippet shows how a component can implement this interface
  6077. * to invoke it own change-detection cycle.
  6078. *
  6079. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='DoCheck'}
  6080. *
  6081. * For a more complete example and discussion, see
  6082. * [Defining custom change detection](guide/components/lifecycle#defining-custom-change-detection).
  6083. *
  6084. * @publicApi
  6085. */
  6086. interface DoCheck {
  6087. /**
  6088. * A callback method that performs change-detection, invoked
  6089. * after the default change-detector runs.
  6090. * See `KeyValueDiffers` and `IterableDiffers` for implementing
  6091. * custom change checking for collections.
  6092. *
  6093. */
  6094. ngDoCheck(): void;
  6095. }
  6096. /**
  6097. * A lifecycle hook that is called when a directive, pipe, or service is destroyed.
  6098. * Use for any custom cleanup that needs to occur when the
  6099. * instance is destroyed.
  6100. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6101. *
  6102. * @usageNotes
  6103. * The following snippet shows how a component can implement this interface
  6104. * to define its own custom clean-up method.
  6105. *
  6106. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnDestroy'}
  6107. *
  6108. * @publicApi
  6109. */
  6110. interface OnDestroy {
  6111. /**
  6112. * A callback method that performs custom clean-up, invoked immediately
  6113. * before a directive, pipe, or service instance is destroyed.
  6114. */
  6115. ngOnDestroy(): void;
  6116. }
  6117. /**
  6118. * @description
  6119. * A lifecycle hook that is called after Angular has fully initialized
  6120. * all content of a directive. It will run only once when the projected content is initialized.
  6121. * Define an `ngAfterContentInit()` method to handle any additional initialization tasks.
  6122. *
  6123. * @see {@link OnInit}
  6124. * @see {@link AfterViewInit}
  6125. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6126. *
  6127. * @usageNotes
  6128. * The following snippet shows how a component can implement this interface to
  6129. * define its own content initialization method.
  6130. *
  6131. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterContentInit'}
  6132. *
  6133. * @publicApi
  6134. */
  6135. interface AfterContentInit {
  6136. /**
  6137. * A callback method that is invoked immediately after
  6138. * Angular has completed initialization of all of the directive's
  6139. * content.
  6140. * It is invoked only once when the directive is instantiated.
  6141. */
  6142. ngAfterContentInit(): void;
  6143. }
  6144. /**
  6145. * @description
  6146. * A lifecycle hook that is called after the default change detector has
  6147. * completed checking all content of a directive. It will run after the content
  6148. * has been checked and most of the time it's during a change detection cycle.
  6149. *
  6150. * @see {@link AfterViewChecked}
  6151. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6152. *
  6153. * @usageNotes
  6154. * The following snippet shows how a component can implement this interface to
  6155. * define its own after-check functionality.
  6156. *
  6157. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterContentChecked'}
  6158. *
  6159. * @publicApi
  6160. */
  6161. interface AfterContentChecked {
  6162. /**
  6163. * A callback method that is invoked immediately after the
  6164. * default change detector has completed checking all of the directive's
  6165. * content.
  6166. */
  6167. ngAfterContentChecked(): void;
  6168. }
  6169. /**
  6170. * @description
  6171. * A lifecycle hook that is called after Angular has fully initialized
  6172. * a component's view.
  6173. * Define an `ngAfterViewInit()` method to handle any additional initialization tasks.
  6174. *
  6175. * @see {@link OnInit}
  6176. * @see {@link AfterContentInit}
  6177. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6178. *
  6179. * @usageNotes
  6180. * The following snippet shows how a component can implement this interface to
  6181. * define its own view initialization method.
  6182. *
  6183. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterViewInit'}
  6184. *
  6185. * @publicApi
  6186. */
  6187. interface AfterViewInit {
  6188. /**
  6189. * A callback method that is invoked immediately after
  6190. * Angular has completed initialization of a component's view.
  6191. * It is invoked only once when the view is instantiated.
  6192. *
  6193. */
  6194. ngAfterViewInit(): void;
  6195. }
  6196. /**
  6197. * @description
  6198. * A lifecycle hook that is called after the default change detector has
  6199. * completed checking a component's view for changes.
  6200. *
  6201. * @see {@link AfterContentChecked}
  6202. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6203. *
  6204. * @usageNotes
  6205. * The following snippet shows how a component can implement this interface to
  6206. * define its own after-check functionality.
  6207. *
  6208. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterViewChecked'}
  6209. *
  6210. * @publicApi
  6211. */
  6212. interface AfterViewChecked {
  6213. /**
  6214. * A callback method that is invoked immediately after the
  6215. * default change detector has completed one change-check cycle
  6216. * for a component's view.
  6217. */
  6218. ngAfterViewChecked(): void;
  6219. }
  6220. /**
  6221. * Type of the Query metadata.
  6222. *
  6223. * @publicApi
  6224. */
  6225. interface Query {
  6226. descendants: boolean;
  6227. emitDistinctChangesOnly: boolean;
  6228. first: boolean;
  6229. read: any;
  6230. isViewQuery: boolean;
  6231. selector: any;
  6232. static?: boolean;
  6233. }
  6234. /**
  6235. * Base class for query metadata.
  6236. *
  6237. * @see {@link ContentChildren}
  6238. * @see {@link ContentChild}
  6239. * @see {@link ViewChildren}
  6240. * @see {@link ViewChild}
  6241. *
  6242. * @publicApi
  6243. */
  6244. declare abstract class Query {
  6245. }
  6246. /**
  6247. * Type of the ContentChildren decorator / constructor function.
  6248. *
  6249. * @see {@link ContentChildren}
  6250. * @publicApi
  6251. */
  6252. interface ContentChildrenDecorator {
  6253. /**
  6254. * @description
  6255. * Property decorator that configures a content query.
  6256. *
  6257. * Use to get the `QueryList` of elements or directives from the content DOM.
  6258. * Any time a child element is added, removed, or moved, the query list will be
  6259. * updated, and the changes observable of the query list will emit a new value.
  6260. *
  6261. * Content queries are set before the `ngAfterContentInit` callback is called.
  6262. *
  6263. * Does not retrieve elements or directives that are in other components' templates,
  6264. * since a component's template is always a black box to its ancestors.
  6265. *
  6266. * **Metadata Properties**:
  6267. *
  6268. * * **selector** - The directive type or the name used for querying.
  6269. * * **descendants** - If `true` include all descendants of the element. If `false` then only
  6270. * query direct children of the element.
  6271. * * **emitDistinctChangesOnly** - The ` QueryList#changes` observable will emit new values only
  6272. * if the QueryList result has changed. When `false` the `changes` observable might emit even
  6273. * if the QueryList has not changed.
  6274. * ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and
  6275. * removed in future versions of Angular.
  6276. * * **read** - Used to read a different token from the queried elements.
  6277. *
  6278. * The following selectors are supported.
  6279. * * Any class with the `@Component` or `@Directive` decorator
  6280. * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
  6281. * with `@ContentChildren('cmp')`)
  6282. * * Any provider defined in the child component tree of the current component (e.g.
  6283. * `@ContentChildren(SomeService) someService: SomeService`)
  6284. * * Any provider defined through a string token (e.g. `@ContentChildren('someToken')
  6285. * someTokenVal: any`)
  6286. * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with
  6287. * `@ContentChildren(TemplateRef) template;`)
  6288. *
  6289. * In addition, multiple string selectors can be separated with a comma (e.g.
  6290. * `@ContentChildren('cmp1,cmp2')`)
  6291. *
  6292. * The following values are supported by `read`:
  6293. * * Any class with the `@Component` or `@Directive` decorator
  6294. * * Any provider defined on the injector of the component that is matched by the `selector` of
  6295. * this query
  6296. * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
  6297. * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
  6298. *
  6299. * @usageNotes
  6300. *
  6301. * Here is a simple demonstration of how the `ContentChildren` decorator can be used.
  6302. *
  6303. * {@example core/di/ts/contentChildren/content_children_howto.ts region='HowTo'}
  6304. *
  6305. * ### Tab-pane example
  6306. *
  6307. * Here is a slightly more realistic example that shows how `ContentChildren` decorators
  6308. * can be used to implement a tab pane component.
  6309. *
  6310. * {@example core/di/ts/contentChildren/content_children_example.ts region='Component'}
  6311. *
  6312. * @Annotation
  6313. */
  6314. (selector: ProviderToken<unknown> | Function | string, opts?: {
  6315. descendants?: boolean;
  6316. emitDistinctChangesOnly?: boolean;
  6317. read?: any;
  6318. }): any;
  6319. new (selector: ProviderToken<unknown> | Function | string, opts?: {
  6320. descendants?: boolean;
  6321. emitDistinctChangesOnly?: boolean;
  6322. read?: any;
  6323. }): Query;
  6324. }
  6325. /**
  6326. * Type of the ContentChildren metadata.
  6327. *
  6328. *
  6329. * @Annotation
  6330. * @publicApi
  6331. */
  6332. type ContentChildren = Query;
  6333. /**
  6334. * ContentChildren decorator and metadata.
  6335. *
  6336. *
  6337. * @Annotation
  6338. * @publicApi
  6339. */
  6340. declare const ContentChildren: ContentChildrenDecorator;
  6341. /**
  6342. * Type of the ContentChild decorator / constructor function.
  6343. *
  6344. * @publicApi
  6345. */
  6346. interface ContentChildDecorator {
  6347. /**
  6348. * @description
  6349. * Property decorator that configures a content query.
  6350. *
  6351. * Use to get the first element or the directive matching the selector from the content DOM.
  6352. * If the content DOM changes, and a new child matches the selector,
  6353. * the property will be updated.
  6354. *
  6355. * Does not retrieve elements or directives that are in other components' templates,
  6356. * since a component's template is always a black box to its ancestors.
  6357. *
  6358. * **Metadata Properties**:
  6359. *
  6360. * * **selector** - The directive type or the name used for querying.
  6361. * * **descendants** - If `true` (default) include all descendants of the element. If `false` then
  6362. * only query direct children of the element.
  6363. * * **read** - Used to read a different token from the queried element.
  6364. * * **static** - True to resolve query results before change detection runs,
  6365. * false to resolve after change detection. Defaults to false.
  6366. *
  6367. * The following selectors are supported.
  6368. * * Any class with the `@Component` or `@Directive` decorator
  6369. * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
  6370. * with `@ContentChild('cmp')`)
  6371. * * Any provider defined in the child component tree of the current component (e.g.
  6372. * `@ContentChild(SomeService) someService: SomeService`)
  6373. * * Any provider defined through a string token (e.g. `@ContentChild('someToken') someTokenVal:
  6374. * any`)
  6375. * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ContentChild(TemplateRef)
  6376. * template;`)
  6377. *
  6378. * The following values are supported by `read`:
  6379. * * Any class with the `@Component` or `@Directive` decorator
  6380. * * Any provider defined on the injector of the component that is matched by the `selector` of
  6381. * this query
  6382. * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
  6383. * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
  6384. *
  6385. * Difference between dynamic and static queries:
  6386. *
  6387. * | Queries | Details |
  6388. * |:--- |:--- |
  6389. * | Dynamic queries \(`static: false`\) | The query resolves before the `ngAfterContentInit()`
  6390. * callback is called. The result will be updated for changes to your view, such as changes to
  6391. * `ngIf` and `ngFor` blocks. | | Static queries \(`static: true`\) | The query resolves once
  6392. * the view has been created, but before change detection runs (before the `ngOnInit()` callback
  6393. * is called). The result, though, will never be updated to reflect changes to your view, such as
  6394. * changes to `ngIf` and `ngFor` blocks. |
  6395. *
  6396. * @usageNotes
  6397. *
  6398. * {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'}
  6399. *
  6400. * ### Example
  6401. *
  6402. * {@example core/di/ts/contentChild/content_child_example.ts region='Component'}
  6403. *
  6404. * @Annotation
  6405. */
  6406. (selector: ProviderToken<unknown> | Function | string, opts?: {
  6407. descendants?: boolean;
  6408. read?: any;
  6409. static?: boolean;
  6410. }): any;
  6411. new (selector: ProviderToken<unknown> | Function | string, opts?: {
  6412. descendants?: boolean;
  6413. read?: any;
  6414. static?: boolean;
  6415. }): ContentChild;
  6416. }
  6417. /**
  6418. * Type of the ContentChild metadata.
  6419. *
  6420. * @publicApi
  6421. */
  6422. type ContentChild = Query;
  6423. /**
  6424. * ContentChild decorator and metadata.
  6425. *
  6426. *
  6427. * @Annotation
  6428. *
  6429. * @publicApi
  6430. */
  6431. declare const ContentChild: ContentChildDecorator;
  6432. /**
  6433. * Type of the ViewChildren decorator / constructor function.
  6434. *
  6435. * @see {@link ViewChildren}
  6436. *
  6437. * @publicApi
  6438. */
  6439. interface ViewChildrenDecorator {
  6440. /**
  6441. * @description
  6442. * Property decorator that configures a view query.
  6443. *
  6444. * Use to get the `QueryList` of elements or directives from the view DOM.
  6445. * Any time a child element is added, removed, or moved, the query list will be updated,
  6446. * and the changes observable of the query list will emit a new value.
  6447. *
  6448. * View queries are set before the `ngAfterViewInit` callback is called.
  6449. *
  6450. * **Metadata Properties**:
  6451. *
  6452. * * **selector** - The directive type or the name used for querying.
  6453. * * **read** - Used to read a different token from the queried elements.
  6454. * * **emitDistinctChangesOnly** - The ` QueryList#changes` observable will emit new values only
  6455. * if the QueryList result has changed. When `false` the `changes` observable might emit even
  6456. * if the QueryList has not changed.
  6457. * ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and
  6458. * removed in future versions of Angular.
  6459. *
  6460. * The following selectors are supported.
  6461. * * Any class with the `@Component` or `@Directive` decorator
  6462. * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
  6463. * with `@ViewChildren('cmp')`)
  6464. * * Any provider defined in the child component tree of the current component (e.g.
  6465. * `@ViewChildren(SomeService) someService!: SomeService`)
  6466. * * Any provider defined through a string token (e.g. `@ViewChildren('someToken')
  6467. * someTokenVal!: any`)
  6468. * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChildren(TemplateRef)
  6469. * template;`)
  6470. *
  6471. * In addition, multiple string selectors can be separated with a comma (e.g.
  6472. * `@ViewChildren('cmp1,cmp2')`)
  6473. *
  6474. * The following values are supported by `read`:
  6475. * * Any class with the `@Component` or `@Directive` decorator
  6476. * * Any provider defined on the injector of the component that is matched by the `selector` of
  6477. * this query
  6478. * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
  6479. * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
  6480. *
  6481. * @usageNotes
  6482. *
  6483. * {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'}
  6484. *
  6485. * ### Another example
  6486. *
  6487. * {@example core/di/ts/viewChildren/view_children_example.ts region='Component'}
  6488. *
  6489. * @Annotation
  6490. */
  6491. (selector: ProviderToken<unknown> | Function | string, opts?: {
  6492. read?: any;
  6493. emitDistinctChangesOnly?: boolean;
  6494. }): any;
  6495. new (selector: ProviderToken<unknown> | Function | string, opts?: {
  6496. read?: any;
  6497. emitDistinctChangesOnly?: boolean;
  6498. }): ViewChildren;
  6499. }
  6500. /**
  6501. * Type of the ViewChildren metadata.
  6502. *
  6503. * @publicApi
  6504. */
  6505. type ViewChildren = Query;
  6506. /**
  6507. * ViewChildren decorator and metadata.
  6508. *
  6509. * @Annotation
  6510. * @publicApi
  6511. */
  6512. declare const ViewChildren: ViewChildrenDecorator;
  6513. /**
  6514. * Type of the ViewChild decorator / constructor function.
  6515. *
  6516. * @see {@link ViewChild}
  6517. * @publicApi
  6518. */
  6519. interface ViewChildDecorator {
  6520. /**
  6521. * @description
  6522. * Property decorator that configures a view query.
  6523. * The change detector looks for the first element or the directive matching the selector
  6524. * in the view DOM. If the view DOM changes, and a new child matches the selector,
  6525. * the property is updated.
  6526. *
  6527. * **Metadata Properties**:
  6528. *
  6529. * * **selector** - The directive type or the name used for querying.
  6530. * * **read** - Used to read a different token from the queried elements.
  6531. * * **static** - `true` to resolve query results before change detection runs,
  6532. * `false` to resolve after change detection. Defaults to `false`.
  6533. *
  6534. *
  6535. * The following selectors are supported.
  6536. * * Any class with the `@Component` or `@Directive` decorator
  6537. * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
  6538. * with `@ViewChild('cmp')`)
  6539. * * Any provider defined in the child component tree of the current component (e.g.
  6540. * `@ViewChild(SomeService) someService: SomeService`)
  6541. * * Any provider defined through a string token (e.g. `@ViewChild('someToken') someTokenVal:
  6542. * any`)
  6543. * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChild(TemplateRef)
  6544. * template;`)
  6545. *
  6546. * The following values are supported by `read`:
  6547. * * Any class with the `@Component` or `@Directive` decorator
  6548. * * Any provider defined on the injector of the component that is matched by the `selector` of
  6549. * this query
  6550. * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
  6551. * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
  6552. *
  6553. * Difference between dynamic and static queries:
  6554. * * Dynamic queries \(`static: false`\) - The query resolves before the `ngAfterViewInit()`
  6555. * callback is called. The result will be updated for changes to your view, such as changes to
  6556. * `ngIf` and `ngFor` blocks.
  6557. * * Static queries \(`static: true`\) - The query resolves once
  6558. * the view has been created, but before change detection runs (before the `ngOnInit()` callback
  6559. * is called). The result, though, will never be updated to reflect changes to your view, such as
  6560. * changes to `ngIf` and `ngFor` blocks.
  6561. *
  6562. * @usageNotes
  6563. *
  6564. * ### Example 1
  6565. *
  6566. * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}
  6567. *
  6568. * ### Example 2
  6569. *
  6570. * {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'}
  6571. *
  6572. * @Annotation
  6573. */
  6574. (selector: ProviderToken<unknown> | Function | string, opts?: {
  6575. read?: any;
  6576. static?: boolean;
  6577. }): any;
  6578. new (selector: ProviderToken<unknown> | Function | string, opts?: {
  6579. read?: any;
  6580. static?: boolean;
  6581. }): ViewChild;
  6582. }
  6583. /**
  6584. * Type of the ViewChild metadata.
  6585. *
  6586. * @publicApi
  6587. */
  6588. type ViewChild = Query;
  6589. /**
  6590. * ViewChild decorator and metadata.
  6591. *
  6592. * @Annotation
  6593. * @publicApi
  6594. */
  6595. declare const ViewChild: ViewChildDecorator;
  6596. /**
  6597. * The strategy that the default change detector uses to detect changes.
  6598. * When set, takes effect the next time change detection is triggered.
  6599. *
  6600. * @see {@link /api/core/ChangeDetectorRef?tab=usage-notes Change detection usage}
  6601. * @see {@link /best-practices/skipping-subtrees Skipping component subtrees}
  6602. *
  6603. * @publicApi
  6604. */
  6605. declare enum ChangeDetectionStrategy$1 {
  6606. /**
  6607. * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated
  6608. * until reactivated by setting the strategy to `Default` (`CheckAlways`).
  6609. * Change detection can still be explicitly invoked.
  6610. * This strategy applies to all child directives and cannot be overridden.
  6611. */
  6612. OnPush = 0,
  6613. /**
  6614. * Use the default `CheckAlways` strategy, in which change detection is automatic until
  6615. * explicitly deactivated.
  6616. */
  6617. Default = 1
  6618. }
  6619. /**
  6620. * An interface implemented by all Angular type decorators, which allows them to be used as
  6621. * decorators as well as Angular syntax.
  6622. *
  6623. * ```ts
  6624. * @ng.Component({...})
  6625. * class MyClass {...}
  6626. * ```
  6627. *
  6628. * @publicApi
  6629. */
  6630. interface TypeDecorator {
  6631. /**
  6632. * Invoke as decorator.
  6633. */
  6634. <T extends Type$1<any>>(type: T): T;
  6635. (target: Object, propertyKey?: string | symbol, parameterIndex?: number): void;
  6636. (target: unknown, context: unknown): void;
  6637. }
  6638. /**
  6639. * Type of the Directive decorator / constructor function.
  6640. * @publicApi
  6641. */
  6642. interface DirectiveDecorator {
  6643. /**
  6644. * Decorator that marks a class as an Angular directive.
  6645. * You can define your own directives to attach custom behavior to elements in the DOM.
  6646. *
  6647. * The options provide configuration metadata that determines
  6648. * how the directive should be processed, instantiated and used at
  6649. * runtime.
  6650. *
  6651. * Directive classes, like component classes, can implement
  6652. * [life-cycle hooks](guide/components/lifecycle) to influence their configuration and behavior.
  6653. *
  6654. *
  6655. * @usageNotes
  6656. * To define a directive, mark the class with the decorator and provide metadata.
  6657. *
  6658. * ```ts
  6659. * import {Directive} from '@angular/core';
  6660. *
  6661. * @Directive({
  6662. * selector: 'my-directive',
  6663. * })
  6664. * export class MyDirective {
  6665. * ...
  6666. * }
  6667. * ```
  6668. *
  6669. * ### Declaring directives
  6670. *
  6671. * In order to make a directive available to other components in your application, you should do
  6672. * one of the following:
  6673. * - either mark the directive as [standalone](guide/components/importing),
  6674. * - or declare it in an NgModule by adding it to the `declarations` and `exports` fields.
  6675. *
  6676. * ** Marking a directive as standalone **
  6677. *
  6678. * You can add the `standalone: true` flag to the Directive decorator metadata to declare it as
  6679. * [standalone](guide/components/importing):
  6680. *
  6681. * ```ts
  6682. * @Directive({
  6683. * standalone: true,
  6684. * selector: 'my-directive',
  6685. * })
  6686. * class MyDirective {}
  6687. * ```
  6688. *
  6689. * When marking a directive as standalone, please make sure that the directive is not already
  6690. * declared in an NgModule.
  6691. *
  6692. *
  6693. * ** Declaring a directive in an NgModule **
  6694. *
  6695. * Another approach is to declare a directive in an NgModule:
  6696. *
  6697. * ```ts
  6698. * @Directive({
  6699. * selector: 'my-directive',
  6700. * })
  6701. * class MyDirective {}
  6702. *
  6703. * @NgModule({
  6704. * declarations: [MyDirective, SomeComponent],
  6705. * exports: [MyDirective], // making it available outside of this module
  6706. * })
  6707. * class SomeNgModule {}
  6708. * ```
  6709. *
  6710. * When declaring a directive in an NgModule, please make sure that:
  6711. * - the directive is declared in exactly one NgModule.
  6712. * - the directive is not standalone.
  6713. * - you do not re-declare a directive imported from another module.
  6714. * - the directive is included into the `exports` field as well if you want this directive to be
  6715. * accessible for components outside of the NgModule.
  6716. *
  6717. *
  6718. * @Annotation
  6719. */
  6720. (obj?: Directive): TypeDecorator;
  6721. /**
  6722. * See the `Directive` decorator.
  6723. */
  6724. new (obj?: Directive): Directive;
  6725. }
  6726. /**
  6727. * Directive decorator and metadata.
  6728. *
  6729. * @Annotation
  6730. * @publicApi
  6731. */
  6732. interface Directive {
  6733. /**
  6734. * The CSS selector that identifies this directive in a template
  6735. * and triggers instantiation of the directive.
  6736. *
  6737. * Declare as one of the following:
  6738. *
  6739. * - `element-name`: Select by element name.
  6740. * - `.class`: Select by class name.
  6741. * - `[attribute]`: Select by attribute name.
  6742. * - `[attribute=value]`: Select by attribute name and value.
  6743. * - `:not(sub_selector)`: Select only if the element does not match the `sub_selector`.
  6744. * - `selector1, selector2`: Select if either `selector1` or `selector2` matches.
  6745. *
  6746. * Angular only allows directives to apply on CSS selectors that do not cross
  6747. * element boundaries.
  6748. *
  6749. * For the following template HTML, a directive with an `input[type=text]` selector,
  6750. * would be instantiated only on the `<input type="text">` element.
  6751. *
  6752. * ```html
  6753. * <form>
  6754. * <input type="text">
  6755. * <input type="radio">
  6756. * <form>
  6757. * ```
  6758. *
  6759. */
  6760. selector?: string;
  6761. /**
  6762. * Enumerates the set of data-bound input properties for a directive
  6763. *
  6764. * Angular automatically updates input properties during change detection.
  6765. * The `inputs` property accepts either strings or object literals that configure the directive
  6766. * properties that should be exposed as inputs.
  6767. *
  6768. * When an object literal is passed in, the `name` property indicates which property on the
  6769. * class the input should write to, while the `alias` determines the name under
  6770. * which the input will be available in template bindings. The `required` property indicates that
  6771. * the input is required which will trigger a compile-time error if it isn't passed in when the
  6772. * directive is used.
  6773. *
  6774. * When a string is passed into the `inputs` array, it can have a format of `'name'` or
  6775. * `'name: alias'` where `name` is the property on the class that the directive should write
  6776. * to, while the `alias` determines the name under which the input will be available in
  6777. * template bindings. String-based input definitions are assumed to be optional.
  6778. *
  6779. * @usageNotes
  6780. *
  6781. * The following example creates a component with two data-bound properties.
  6782. *
  6783. * ```ts
  6784. * @Component({
  6785. * selector: 'bank-account',
  6786. * inputs: ['bankName', {name: 'id', alias: 'account-id'}],
  6787. * template: `
  6788. * Bank Name: {{bankName}}
  6789. * Account Id: {{id}}
  6790. * `
  6791. * })
  6792. * class BankAccount {
  6793. * bankName: string;
  6794. * id: string;
  6795. * }
  6796. * ```
  6797. *
  6798. */
  6799. inputs?: ({
  6800. name: string;
  6801. alias?: string;
  6802. required?: boolean;
  6803. transform?: (value: any) => any;
  6804. } | string)[];
  6805. /**
  6806. * Enumerates the set of event-bound output properties.
  6807. *
  6808. * When an output property emits an event, an event handler attached to that event
  6809. * in the template is invoked.
  6810. *
  6811. * The `outputs` property defines a set of `directiveProperty` to `alias`
  6812. * configuration:
  6813. *
  6814. * - `directiveProperty` specifies the component property that emits events.
  6815. * - `alias` specifies the DOM property the event handler is attached to.
  6816. *
  6817. * @usageNotes
  6818. *
  6819. * ```ts
  6820. * @Component({
  6821. * selector: 'child-dir',
  6822. * outputs: [ 'bankNameChange' ],
  6823. * template: `<input (input)="bankNameChange.emit($event.target.value)" />`
  6824. * })
  6825. * class ChildDir {
  6826. * bankNameChange: EventEmitter<string> = new EventEmitter<string>();
  6827. * }
  6828. *
  6829. * @Component({
  6830. * selector: 'main',
  6831. * template: `
  6832. * {{ bankName }} <child-dir (bankNameChange)="onBankNameChange($event)"></child-dir>
  6833. * `
  6834. * })
  6835. * class MainComponent {
  6836. * bankName: string;
  6837. *
  6838. * onBankNameChange(bankName: string) {
  6839. * this.bankName = bankName;
  6840. * }
  6841. * }
  6842. * ```
  6843. *
  6844. */
  6845. outputs?: string[];
  6846. /**
  6847. * Configures the injector of this
  6848. * directive or component with a token
  6849. * that maps to a provider of a dependency.
  6850. */
  6851. providers?: Provider[];
  6852. /**
  6853. * Defines the name that can be used in the template to assign this directive to a variable.
  6854. *
  6855. * @usageNotes
  6856. *
  6857. * ```ts
  6858. * @Directive({
  6859. * selector: 'child-dir',
  6860. * exportAs: 'child'
  6861. * })
  6862. * class ChildDir {
  6863. * }
  6864. *
  6865. * @Component({
  6866. * selector: 'main',
  6867. * template: `<child-dir #c="child"></child-dir>`
  6868. * })
  6869. * class MainComponent {
  6870. * }
  6871. * ```
  6872. *
  6873. */
  6874. exportAs?: string;
  6875. /**
  6876. * Configures the queries that will be injected into the directive.
  6877. *
  6878. * Content queries are set before the `ngAfterContentInit` callback is called.
  6879. * View queries are set before the `ngAfterViewInit` callback is called.
  6880. *
  6881. * @usageNotes
  6882. *
  6883. * The following example shows how queries are defined
  6884. * and when their results are available in lifecycle hooks:
  6885. *
  6886. * ```ts
  6887. * @Component({
  6888. * selector: 'someDir',
  6889. * queries: {
  6890. * contentChildren: new ContentChildren(ChildDirective),
  6891. * viewChildren: new ViewChildren(ChildDirective)
  6892. * },
  6893. * template: '<child-directive></child-directive>'
  6894. * })
  6895. * class SomeDir {
  6896. * contentChildren: QueryList<ChildDirective>,
  6897. * viewChildren: QueryList<ChildDirective>
  6898. *
  6899. * ngAfterContentInit() {
  6900. * // contentChildren is set
  6901. * }
  6902. *
  6903. * ngAfterViewInit() {
  6904. * // viewChildren is set
  6905. * }
  6906. * }
  6907. * ```
  6908. *
  6909. * @Annotation
  6910. */
  6911. queries?: {
  6912. [key: string]: any;
  6913. };
  6914. /**
  6915. * Maps class properties to host element bindings for properties,
  6916. * attributes, and events, using a set of key-value pairs.
  6917. *
  6918. * Angular automatically checks host property bindings during change detection.
  6919. * If a binding changes, Angular updates the directive's host element.
  6920. *
  6921. * When the key is a property of the host element, the property value is
  6922. * propagated to the specified DOM property.
  6923. *
  6924. * When the key is a static attribute in the DOM, the attribute value
  6925. * is propagated to the specified property in the host element.
  6926. *
  6927. * For event handling:
  6928. * - The key is the DOM event that the directive listens to.
  6929. * To listen to global events, add the target to the event name.
  6930. * The target can be `window`, `document` or `body`.
  6931. * - The value is the statement to execute when the event occurs. If the
  6932. * statement evaluates to `false`, then `preventDefault` is applied on the DOM
  6933. * event. A handler method can refer to the `$event` local variable.
  6934. *
  6935. */
  6936. host?: {
  6937. [key: string]: string;
  6938. };
  6939. /**
  6940. * When present, this directive/component is ignored by the AOT compiler.
  6941. * It remains in distributed code, and the JIT compiler attempts to compile it
  6942. * at run time, in the browser.
  6943. * To ensure the correct behavior, the app must import `@angular/compiler`.
  6944. */
  6945. jit?: true;
  6946. /**
  6947. * Angular directives marked as `standalone` do not need to be declared in an NgModule. Such
  6948. * directives don't depend on any "intermediate context" of an NgModule (ex. configured
  6949. * providers).
  6950. *
  6951. * More information about standalone components, directives, and pipes can be found in [this
  6952. * guide](guide/components/importing).
  6953. */
  6954. standalone?: boolean;
  6955. /**
  6956. * Standalone directives that should be applied to the host whenever the directive is matched.
  6957. * By default, none of the inputs or outputs of the host directives will be available on the host,
  6958. * unless they are specified in the `inputs` or `outputs` properties.
  6959. *
  6960. * You can additionally alias inputs and outputs by putting a colon and the alias after the
  6961. * original input or output name. For example, if a directive applied via `hostDirectives`
  6962. * defines an input named `menuDisabled`, you can alias this to `disabled` by adding
  6963. * `'menuDisabled: disabled'` as an entry to `inputs`.
  6964. */
  6965. hostDirectives?: (Type$1<unknown> | {
  6966. directive: Type$1<unknown>;
  6967. inputs?: string[];
  6968. outputs?: string[];
  6969. })[];
  6970. }
  6971. /**
  6972. * Type of the Directive metadata.
  6973. *
  6974. * @publicApi
  6975. */
  6976. declare const Directive: DirectiveDecorator;
  6977. /**
  6978. * Component decorator interface
  6979. *
  6980. * @publicApi
  6981. */
  6982. interface ComponentDecorator {
  6983. /**
  6984. * Decorator that marks a class as an Angular component and provides configuration
  6985. * metadata that determines how the component should be processed,
  6986. * instantiated, and used at runtime.
  6987. *
  6988. * Components are the most basic UI building block of an Angular app.
  6989. * An Angular app contains a tree of Angular components.
  6990. *
  6991. * Angular components are a subset of directives, always associated with a template.
  6992. * Unlike other directives, only one component can be instantiated for a given element in a
  6993. * template.
  6994. *
  6995. * Standalone components can be directly imported in any other standalone component or NgModule.
  6996. * NgModule based apps on the other hand require components to belong to an NgModule in
  6997. * order for them to be available to another component or application. To make a component a
  6998. * member of an NgModule, list it in the `declarations` field of the `NgModule` metadata.
  6999. *
  7000. * Note that, in addition to these options for configuring a directive,
  7001. * you can control a component's runtime behavior by implementing
  7002. * life-cycle hooks. For more information, see the
  7003. * [Lifecycle Hooks](guide/components/lifecycle) guide.
  7004. *
  7005. * @usageNotes
  7006. *
  7007. * ### Setting component inputs
  7008. *
  7009. * The following example creates a component with two data-bound properties,
  7010. * specified by the `inputs` value.
  7011. *
  7012. * {@example core/ts/metadata/directives.ts region='component-input'}
  7013. *
  7014. *
  7015. * ### Setting component outputs
  7016. *
  7017. * The following example shows two event emitters that emit on an interval. One
  7018. * emits an output every second, while the other emits every five seconds.
  7019. *
  7020. * {@example core/ts/metadata/directives.ts region='component-output-interval'}
  7021. *
  7022. * ### Injecting a class with a view provider
  7023. *
  7024. * The following simple example injects a class into a component
  7025. * using the view provider specified in component metadata:
  7026. *
  7027. * ```ts
  7028. * class Greeter {
  7029. * greet(name:string) {
  7030. * return 'Hello ' + name + '!';
  7031. * }
  7032. * }
  7033. *
  7034. * @Directive({
  7035. * selector: 'needs-greeter'
  7036. * })
  7037. * class NeedsGreeter {
  7038. * greeter:Greeter;
  7039. *
  7040. * constructor(greeter:Greeter) {
  7041. * this.greeter = greeter;
  7042. * }
  7043. * }
  7044. *
  7045. * @Component({
  7046. * selector: 'greet',
  7047. * viewProviders: [
  7048. * Greeter
  7049. * ],
  7050. * template: `<needs-greeter></needs-greeter>`
  7051. * })
  7052. * class HelloWorld {
  7053. * }
  7054. *
  7055. * ```
  7056. *
  7057. * ### Preserving whitespace
  7058. *
  7059. * Removing whitespace can greatly reduce AOT-generated code size and speed up view creation.
  7060. * As of Angular 6, the default for `preserveWhitespaces` is false (whitespace is removed).
  7061. * To change the default setting for all components in your application, set
  7062. * the `preserveWhitespaces` option of the AOT compiler.
  7063. *
  7064. * By default, the AOT compiler removes whitespace characters as follows:
  7065. * * Trims all whitespaces at the beginning and the end of a template.
  7066. * * Removes whitespace-only text nodes. For example,
  7067. *
  7068. * ```html
  7069. * <button>Action 1</button> <button>Action 2</button>
  7070. * ```
  7071. *
  7072. * becomes:
  7073. *
  7074. * ```html
  7075. * <button>Action 1</button><button>Action 2</button>
  7076. * ```
  7077. *
  7078. * * Replaces a series of whitespace characters in text nodes with a single space.
  7079. * For example, `<span>\n some text\n</span>` becomes `<span> some text </span>`.
  7080. * * Does NOT alter text nodes inside HTML tags such as `<pre>` or `<textarea>`,
  7081. * where whitespace characters are significant.
  7082. *
  7083. * Note that these transformations can influence DOM nodes layout, although impact
  7084. * should be minimal.
  7085. *
  7086. * You can override the default behavior to preserve whitespace characters
  7087. * in certain fragments of a template. For example, you can exclude an entire
  7088. * DOM sub-tree by using the `ngPreserveWhitespaces` attribute:
  7089. *
  7090. * ```html
  7091. * <div ngPreserveWhitespaces>
  7092. * whitespaces are preserved here
  7093. * <span> and here </span>
  7094. * </div>
  7095. * ```
  7096. *
  7097. * You can force a single space to be preserved in a text node by using `&ngsp;`,
  7098. * which is replaced with a space character by Angular's template
  7099. * compiler:
  7100. *
  7101. * ```html
  7102. * <a>Spaces</a>&ngsp;<a>between</a>&ngsp;<a>links.</a>
  7103. * <!-- compiled to be equivalent to:
  7104. * <a>Spaces</a> <a>between</a> <a>links.</a> -->
  7105. * ```
  7106. *
  7107. * Note that sequences of `&ngsp;` are still collapsed to just one space character when
  7108. * the `preserveWhitespaces` option is set to `false`.
  7109. *
  7110. * ```html
  7111. * <a>before</a>&ngsp;&ngsp;&ngsp;<a>after</a>
  7112. * <!-- compiled to be equivalent to:
  7113. * <a>before</a> <a>after</a> -->
  7114. * ```
  7115. *
  7116. * To preserve sequences of whitespace characters, use the
  7117. * `ngPreserveWhitespaces` attribute.
  7118. *
  7119. * @Annotation
  7120. */
  7121. (obj: Component): TypeDecorator;
  7122. /**
  7123. * See the `Component` decorator.
  7124. */
  7125. new (obj: Component): Component;
  7126. }
  7127. /**
  7128. * Supplies configuration metadata for an Angular component.
  7129. *
  7130. * @publicApi
  7131. */
  7132. interface Component extends Directive {
  7133. /**
  7134. * The change-detection strategy to use for this component.
  7135. *
  7136. * When a component is instantiated, Angular creates a change detector,
  7137. * which is responsible for propagating the component's bindings.
  7138. * The strategy is one of:
  7139. * - `ChangeDetectionStrategy#OnPush` sets the strategy to `CheckOnce` (on demand).
  7140. * - `ChangeDetectionStrategy#Default` sets the strategy to `CheckAlways`.
  7141. */
  7142. changeDetection?: ChangeDetectionStrategy$1;
  7143. /**
  7144. * Defines the set of injectable objects that are visible to its view DOM children.
  7145. * See [example](#injecting-a-class-with-a-view-provider).
  7146. *
  7147. */
  7148. viewProviders?: Provider[];
  7149. /**
  7150. * The module ID of the module that contains the component.
  7151. * The component must be able to resolve relative URLs for templates and styles.
  7152. * SystemJS exposes the `__moduleName` variable within each module.
  7153. * In CommonJS, this can be set to `module.id`.
  7154. *
  7155. * @deprecated This option does not have any effect. Will be removed in Angular v17.
  7156. */
  7157. moduleId?: string;
  7158. /**
  7159. * The relative path or absolute URL of a template file for an Angular component.
  7160. * If provided, do not supply an inline template using `template`.
  7161. *
  7162. */
  7163. templateUrl?: string;
  7164. /**
  7165. * An inline template for an Angular component. If provided,
  7166. * do not supply a template file using `templateUrl`.
  7167. *
  7168. */
  7169. template?: string;
  7170. /**
  7171. * One relative path or an absolute URL for file containing a CSS stylesheet to use
  7172. * in this component.
  7173. */
  7174. styleUrl?: string;
  7175. /**
  7176. * Relative paths or absolute URLs for files containing CSS stylesheets to use in this component.
  7177. */
  7178. styleUrls?: string[];
  7179. /**
  7180. * One or more inline CSS stylesheets to use
  7181. * in this component.
  7182. */
  7183. styles?: string | string[];
  7184. /**
  7185. * One or more animation `trigger()` calls, containing
  7186. * [`state()`](api/animations/state) and `transition()` definitions.
  7187. * See the [Animations guide](guide/animations) and animations API documentation.
  7188. *
  7189. */
  7190. animations?: any[];
  7191. /**
  7192. * An encapsulation policy for the component's styling.
  7193. * Possible values:
  7194. * - `ViewEncapsulation.Emulated`: Apply modified component styles in order to emulate
  7195. * a native Shadow DOM CSS encapsulation behavior.
  7196. * - `ViewEncapsulation.None`: Apply component styles globally without any sort of encapsulation.
  7197. * - `ViewEncapsulation.ShadowDom`: Use the browser's native Shadow DOM API to encapsulate styles.
  7198. *
  7199. * If not supplied, the value is taken from the `CompilerOptions`
  7200. * which defaults to `ViewEncapsulation.Emulated`.
  7201. *
  7202. * If the policy is `ViewEncapsulation.Emulated` and the component has no
  7203. * {@link Component#styles styles} nor {@link Component#styleUrls styleUrls},
  7204. * the policy is automatically switched to `ViewEncapsulation.None`.
  7205. */
  7206. encapsulation?: ViewEncapsulation$1;
  7207. /**
  7208. * Overrides the default interpolation start and end delimiters (`{{` and `}}`).
  7209. *
  7210. * @deprecated use Angular's default interpolation delimiters instead.
  7211. */
  7212. interpolation?: [string, string];
  7213. /**
  7214. * True to preserve or false to remove potentially superfluous whitespace characters
  7215. * from the compiled template. Whitespace characters are those matching the `\s`
  7216. * character class in JavaScript regular expressions. Default is false, unless
  7217. * overridden in compiler options.
  7218. */
  7219. preserveWhitespaces?: boolean;
  7220. /**
  7221. * Angular components marked as `standalone` do not need to be declared in an NgModule. Such
  7222. * components directly manage their own template dependencies (components, directives, and pipes
  7223. * used in a template) via the imports property.
  7224. *
  7225. * More information about standalone components, directives, and pipes can be found in [this
  7226. * guide](guide/components/importing).
  7227. */
  7228. standalone?: boolean;
  7229. /**
  7230. * The imports property specifies the standalone component's template dependencies — those
  7231. * directives, components, and pipes that can be used within its template. Standalone components
  7232. * can import other standalone components, directives, and pipes as well as existing NgModules.
  7233. *
  7234. * This property is only available for standalone components - specifying it for components
  7235. * declared in an NgModule generates a compilation error.
  7236. *
  7237. * More information about standalone components, directives, and pipes can be found in [this
  7238. * guide](guide/components/importing).
  7239. */
  7240. imports?: (Type$1<any> | ReadonlyArray<any>)[];
  7241. /**
  7242. * The set of schemas that declare elements to be allowed in a standalone component. Elements and
  7243. * properties that are neither Angular components nor directives must be declared in a schema.
  7244. *
  7245. * This property is only available for standalone components - specifying it for components
  7246. * declared in an NgModule generates a compilation error.
  7247. *
  7248. * More information about standalone components, directives, and pipes can be found in [this
  7249. * guide](guide/components/importing).
  7250. */
  7251. schemas?: SchemaMetadata[];
  7252. }
  7253. /**
  7254. * Component decorator and metadata.
  7255. *
  7256. * @Annotation
  7257. * @publicApi
  7258. */
  7259. declare const Component: ComponentDecorator;
  7260. /**
  7261. * Type of the Pipe decorator / constructor function.
  7262. *
  7263. * @publicApi
  7264. */
  7265. interface PipeDecorator {
  7266. /**
  7267. *
  7268. * Decorator that marks a class as pipe and supplies configuration metadata.
  7269. *
  7270. * A pipe class must implement the `PipeTransform` interface.
  7271. * For example, if the name is "myPipe", use a template binding expression
  7272. * such as the following:
  7273. *
  7274. * ```html
  7275. * {{ exp | myPipe }}
  7276. * ```
  7277. *
  7278. * The result of the expression is passed to the pipe's `transform()` method.
  7279. *
  7280. * A pipe must belong to an NgModule in order for it to be available
  7281. * to a template. To make it a member of an NgModule,
  7282. * list it in the `declarations` field of the `NgModule` metadata.
  7283. *
  7284. * @see [Style Guide: Pipe Names](style-guide#02-09)
  7285. *
  7286. */
  7287. (obj: Pipe): TypeDecorator;
  7288. /**
  7289. * See the `Pipe` decorator.
  7290. */
  7291. new (obj: Pipe): Pipe;
  7292. }
  7293. /**
  7294. * Type of the Pipe metadata.
  7295. *
  7296. * @publicApi
  7297. */
  7298. interface Pipe {
  7299. /**
  7300. * The pipe name to use in template bindings.
  7301. * Typically uses lowerCamelCase
  7302. * because the name cannot contain hyphens.
  7303. */
  7304. name: string;
  7305. /**
  7306. * When true, the pipe is pure, meaning that the
  7307. * `transform()` method is invoked only when its input arguments
  7308. * change. Pipes are pure by default.
  7309. *
  7310. * If the pipe has internal state (that is, the result
  7311. * depends on state other than its arguments), set `pure` to false.
  7312. * In this case, the pipe is invoked on each change-detection cycle,
  7313. * even if the arguments have not changed.
  7314. */
  7315. pure?: boolean;
  7316. /**
  7317. * Angular pipes marked as `standalone` do not need to be declared in an NgModule. Such
  7318. * pipes don't depend on any "intermediate context" of an NgModule (ex. configured providers).
  7319. *
  7320. * More information about standalone components, directives, and pipes can be found in [this
  7321. * guide](guide/components/importing).
  7322. */
  7323. standalone?: boolean;
  7324. }
  7325. /**
  7326. * @Annotation
  7327. * @publicApi
  7328. */
  7329. declare const Pipe: PipeDecorator;
  7330. /**
  7331. * @publicApi
  7332. */
  7333. interface InputDecorator {
  7334. /**
  7335. * Decorator that marks a class field as an input property and supplies configuration metadata.
  7336. * The input property is bound to a DOM property in the template. During change detection,
  7337. * Angular automatically updates the data property with the DOM property's value.
  7338. *
  7339. * @usageNotes
  7340. *
  7341. * You can supply an optional name to use in templates when the
  7342. * component is instantiated, that maps to the
  7343. * name of the bound property. By default, the original
  7344. * name of the bound property is used for input binding.
  7345. *
  7346. * The following example creates a component with two input properties,
  7347. * one of which is given a special binding name.
  7348. *
  7349. * ```ts
  7350. * import { Component, Input, numberAttribute, booleanAttribute } from '@angular/core';
  7351. * @Component({
  7352. * selector: 'bank-account',
  7353. * template: `
  7354. * Bank Name: {{bankName}}
  7355. * Account Id: {{id}}
  7356. * Account Status: {{status ? 'Active' : 'InActive'}}
  7357. * `
  7358. * })
  7359. * class BankAccount {
  7360. * // This property is bound using its original name.
  7361. * // Defining argument required as true inside the Input Decorator
  7362. * // makes this property deceleration as mandatory
  7363. * @Input({ required: true }) bankName!: string;
  7364. * // Argument alias makes this property value is bound to a different property name
  7365. * // when this component is instantiated in a template.
  7366. * // Argument transform convert the input value from string to number
  7367. * @Input({ alias:'account-id', transform: numberAttribute }) id: number;
  7368. * // Argument transform the input value from string to boolean
  7369. * @Input({ transform: booleanAttribute }) status: boolean;
  7370. * // this property is not bound, and is not automatically updated by Angular
  7371. * normalizedBankName: string;
  7372. * }
  7373. *
  7374. * @Component({
  7375. * selector: 'app',
  7376. * template: `
  7377. * <bank-account bankName="RBC" account-id="4747" status="true"></bank-account>
  7378. * `
  7379. * })
  7380. * class App {}
  7381. * ```
  7382. *
  7383. * @see [Input properties](guide/components/inputs)
  7384. * @see [Output properties](guide/components/outputs)
  7385. */
  7386. (arg?: string | Input): any;
  7387. new (arg?: string | Input): any;
  7388. }
  7389. /**
  7390. * Type of metadata for an `Input` property.
  7391. *
  7392. * @publicApi
  7393. */
  7394. interface Input {
  7395. /**
  7396. * The name of the DOM property to which the input property is bound.
  7397. */
  7398. alias?: string;
  7399. /**
  7400. * Whether the input is required for the directive to function.
  7401. */
  7402. required?: boolean;
  7403. /**
  7404. * Function with which to transform the input value before assigning it to the directive instance.
  7405. */
  7406. transform?: (value: any) => any;
  7407. }
  7408. /**
  7409. * @Annotation
  7410. * @publicApi
  7411. */
  7412. declare const Input: InputDecorator;
  7413. /**
  7414. * Type of the Output decorator / constructor function.
  7415. *
  7416. * @publicApi
  7417. */
  7418. interface OutputDecorator {
  7419. /**
  7420. * Decorator that marks a class field as an output property and supplies configuration metadata.
  7421. * The DOM property bound to the output property is automatically updated during change detection.
  7422. *
  7423. * @usageNotes
  7424. *
  7425. * You can supply an optional name to use in templates when the
  7426. * component is instantiated, that maps to the
  7427. * name of the bound property. By default, the original
  7428. * name of the bound property is used for output binding.
  7429. *
  7430. * See `Input` decorator for an example of providing a binding name.
  7431. *
  7432. * @see [Input properties](guide/components/inputs)
  7433. * @see [Output properties](guide/components/outputs)
  7434. *
  7435. */
  7436. (alias?: string): any;
  7437. new (alias?: string): any;
  7438. }
  7439. /**
  7440. * Type of the Output metadata.
  7441. *
  7442. * @publicApi
  7443. */
  7444. interface Output {
  7445. /**
  7446. * The name of the DOM property to which the output property is bound.
  7447. */
  7448. alias?: string;
  7449. }
  7450. /**
  7451. * @Annotation
  7452. * @publicApi
  7453. */
  7454. declare const Output: OutputDecorator;
  7455. /**
  7456. * Type of the HostBinding decorator / constructor function.
  7457. *
  7458. * @publicApi
  7459. */
  7460. interface HostBindingDecorator {
  7461. /**
  7462. * Decorator that marks a DOM property or an element class, style or attribute as a host-binding
  7463. * property and supplies configuration metadata. Angular automatically checks host bindings during
  7464. * change detection, and if a binding changes it updates the host element of the directive.
  7465. *
  7466. * @usageNotes
  7467. *
  7468. * The following example creates a directive that sets the `valid` and `invalid`
  7469. * class, a style color, and an id on the DOM element that has an `ngModel` directive on it.
  7470. *
  7471. * ```ts
  7472. * @Directive({selector: '[ngModel]'})
  7473. * class NgModelStatus {
  7474. * constructor(public control: NgModel) {}
  7475. * // class bindings
  7476. * @HostBinding('class.valid') get valid() { return this.control.valid; }
  7477. * @HostBinding('class.invalid') get invalid() { return this.control.invalid; }
  7478. *
  7479. * // style binding
  7480. * @HostBinding('style.color') get color() { return this.control.valid ? 'green': 'red'; }
  7481. *
  7482. * // style binding also supports a style unit extension
  7483. * @HostBinding('style.width.px') @Input() width: number = 500;
  7484. *
  7485. * // attribute binding
  7486. * @HostBinding('attr.aria-required')
  7487. * @Input() required: boolean = false;
  7488. *
  7489. * // property binding
  7490. * @HostBinding('id') get id() { return this.control.value?.length ? 'odd': 'even'; }
  7491. *
  7492. * @Component({
  7493. * selector: 'app',
  7494. * template: `<input [(ngModel)]="prop">`,
  7495. * })
  7496. * class App {
  7497. * prop;
  7498. * }
  7499. * ```
  7500. *
  7501. */
  7502. (hostPropertyName?: string): any;
  7503. new (hostPropertyName?: string): any;
  7504. }
  7505. /**
  7506. * Type of the HostBinding metadata.
  7507. *
  7508. * @publicApi
  7509. */
  7510. interface HostBinding {
  7511. /**
  7512. * The DOM property that is bound to a data property.
  7513. * This field also accepts:
  7514. * * classes, prefixed by `class.`
  7515. * * styles, prefixed by `style.`
  7516. * * attributes, prefixed by `attr.`
  7517. */
  7518. hostPropertyName?: string;
  7519. }
  7520. /**
  7521. * @Annotation
  7522. * @publicApi
  7523. */
  7524. declare const HostBinding: HostBindingDecorator;
  7525. /**
  7526. * Type of the HostListener decorator / constructor function.
  7527. *
  7528. * @publicApi
  7529. */
  7530. interface HostListenerDecorator {
  7531. /**
  7532. * Decorator that declares a DOM event to listen for,
  7533. * and provides a handler method to run when that event occurs.
  7534. *
  7535. * Angular invokes the supplied handler method when the host element emits the specified event,
  7536. * and updates the bound element with the result.
  7537. *
  7538. * If the handler method returns false, applies `preventDefault` on the bound element.
  7539. *
  7540. * @usageNotes
  7541. *
  7542. * The following example declares a directive
  7543. * that attaches a click listener to a button and counts clicks.
  7544. *
  7545. * ```ts
  7546. * @Directive({selector: 'button[counting]'})
  7547. * class CountClicks {
  7548. * numberOfClicks = 0;
  7549. *
  7550. * @HostListener('click', ['$event.target'])
  7551. * onClick(btn) {
  7552. * console.log('button', btn, 'number of clicks:', this.numberOfClicks++);
  7553. * }
  7554. * }
  7555. *
  7556. * @Component({
  7557. * selector: 'app',
  7558. * template: '<button counting>Increment</button>',
  7559. * })
  7560. * class App {}
  7561. * ```
  7562. *
  7563. * The following example registers another DOM event handler that listens for `Enter` key-press
  7564. * events on the global `window`.
  7565. * ```ts
  7566. * import { HostListener, Component } from "@angular/core";
  7567. *
  7568. * @Component({
  7569. * selector: 'app',
  7570. * template: `<h1>Hello, you have pressed enter {{counter}} number of times!</h1> Press enter
  7571. * key to increment the counter. <button (click)="resetCounter()">Reset Counter</button>`
  7572. * })
  7573. * class AppComponent {
  7574. * counter = 0;
  7575. * @HostListener('window:keydown.enter', ['$event'])
  7576. * handleKeyDown(event: KeyboardEvent) {
  7577. * this.counter++;
  7578. * }
  7579. * resetCounter() {
  7580. * this.counter = 0;
  7581. * }
  7582. * }
  7583. * ```
  7584. * The list of valid key names for `keydown` and `keyup` events
  7585. * can be found here:
  7586. * https://www.w3.org/TR/DOM-Level-3-Events-key/#named-key-attribute-values
  7587. *
  7588. * Note that keys can also be combined, e.g. `@HostListener('keydown.shift.a')`.
  7589. *
  7590. * The global target names that can be used to prefix an event name are
  7591. * `document:`, `window:` and `body:`.
  7592. *
  7593. */
  7594. (eventName: string, args?: string[]): any;
  7595. new (eventName: string, args?: string[]): any;
  7596. }
  7597. /**
  7598. * Type of the HostListener metadata.
  7599. *
  7600. * @publicApi
  7601. */
  7602. interface HostListener {
  7603. /**
  7604. * The DOM event to listen for.
  7605. */
  7606. eventName?: string;
  7607. /**
  7608. * A set of arguments to pass to the handler method when the event occurs.
  7609. */
  7610. args?: string[];
  7611. }
  7612. /**
  7613. * @Annotation
  7614. * @publicApi
  7615. */
  7616. declare const HostListener: HostListenerDecorator;
  7617. declare global {
  7618. const ngJitMode: boolean;
  7619. }
  7620. declare global {
  7621. /**
  7622. * Indicates whether the application is operating in server-rendering mode.
  7623. *
  7624. * `ngServerMode` is a global flag set by Angular's server-side rendering mechanisms,
  7625. * typically configured by `provideServerRendering` and `platformServer` during runtime.
  7626. *
  7627. * @remarks
  7628. * - **Internal Angular Flag**: This is an *internal* Angular flag (not a public API), avoid relying on it in application code.
  7629. * - **Avoid Direct Use**: This variable is intended for runtime configuration; it should not be accessed directly in application code.
  7630. */
  7631. var ngServerMode: boolean | undefined;
  7632. }
  7633. /**
  7634. * A type describing supported iterable types.
  7635. *
  7636. * @publicApi
  7637. */
  7638. type NgIterable<T> = Array<T> | Iterable<T>;
  7639. /**
  7640. * A strategy for tracking changes over time to an iterable. Used by {@link /api/common/NgForOf NgForOf} to
  7641. * respond to changes in an iterable by effecting equivalent changes in the DOM.
  7642. *
  7643. * @publicApi
  7644. */
  7645. interface IterableDiffer<V> {
  7646. /**
  7647. * Compute a difference between the previous state and the new `object` state.
  7648. *
  7649. * @param object containing the new value.
  7650. * @returns an object describing the difference. The return value is only valid until the next
  7651. * `diff()` invocation.
  7652. */
  7653. diff(object: NgIterable<V> | undefined | null): IterableChanges<V> | null;
  7654. }
  7655. /**
  7656. * An object describing the changes in the `Iterable` collection since last time
  7657. * `IterableDiffer#diff()` was invoked.
  7658. *
  7659. * @publicApi
  7660. */
  7661. interface IterableChanges<V> {
  7662. /**
  7663. * Iterate over all changes. `IterableChangeRecord` will contain information about changes
  7664. * to each item.
  7665. */
  7666. forEachItem(fn: (record: IterableChangeRecord<V>) => void): void;
  7667. /**
  7668. * Iterate over a set of operations which when applied to the original `Iterable` will produce the
  7669. * new `Iterable`.
  7670. *
  7671. * NOTE: These are not necessarily the actual operations which were applied to the original
  7672. * `Iterable`, rather these are a set of computed operations which may not be the same as the
  7673. * ones applied.
  7674. *
  7675. * @param record A change which needs to be applied
  7676. * @param previousIndex The `IterableChangeRecord#previousIndex` of the `record` refers to the
  7677. * original `Iterable` location, where as `previousIndex` refers to the transient location
  7678. * of the item, after applying the operations up to this point.
  7679. * @param currentIndex The `IterableChangeRecord#currentIndex` of the `record` refers to the
  7680. * original `Iterable` location, where as `currentIndex` refers to the transient location
  7681. * of the item, after applying the operations up to this point.
  7682. */
  7683. forEachOperation(fn: (record: IterableChangeRecord<V>, previousIndex: number | null, currentIndex: number | null) => void): void;
  7684. /**
  7685. * Iterate over changes in the order of original `Iterable` showing where the original items
  7686. * have moved.
  7687. */
  7688. forEachPreviousItem(fn: (record: IterableChangeRecord<V>) => void): void;
  7689. /** Iterate over all added items. */
  7690. forEachAddedItem(fn: (record: IterableChangeRecord<V>) => void): void;
  7691. /** Iterate over all moved items. */
  7692. forEachMovedItem(fn: (record: IterableChangeRecord<V>) => void): void;
  7693. /** Iterate over all removed items. */
  7694. forEachRemovedItem(fn: (record: IterableChangeRecord<V>) => void): void;
  7695. /**
  7696. * Iterate over all items which had their identity (as computed by the `TrackByFunction`)
  7697. * changed.
  7698. */
  7699. forEachIdentityChange(fn: (record: IterableChangeRecord<V>) => void): void;
  7700. }
  7701. /**
  7702. * Record representing the item change information.
  7703. *
  7704. * @publicApi
  7705. */
  7706. interface IterableChangeRecord<V> {
  7707. /** Current index of the item in `Iterable` or null if removed. */
  7708. readonly currentIndex: number | null;
  7709. /** Previous index of the item in `Iterable` or null if added. */
  7710. readonly previousIndex: number | null;
  7711. /** The item. */
  7712. readonly item: V;
  7713. /** Track by identity as computed by the `TrackByFunction`. */
  7714. readonly trackById: any;
  7715. }
  7716. /**
  7717. * A function optionally passed into the `NgForOf` directive to customize how `NgForOf` uniquely
  7718. * identifies items in an iterable.
  7719. *
  7720. * `NgForOf` needs to uniquely identify items in the iterable to correctly perform DOM updates
  7721. * when items in the iterable are reordered, new items are added, or existing items are removed.
  7722. *
  7723. *
  7724. * In all of these scenarios it is usually desirable to only update the DOM elements associated
  7725. * with the items affected by the change. This behavior is important to:
  7726. *
  7727. * - preserve any DOM-specific UI state (like cursor position, focus, text selection) when the
  7728. * iterable is modified
  7729. * - enable animation of item addition, removal, and iterable reordering
  7730. * - preserve the value of the `<select>` element when nested `<option>` elements are dynamically
  7731. * populated using `NgForOf` and the bound iterable is updated
  7732. *
  7733. * A common use for custom `trackBy` functions is when the model that `NgForOf` iterates over
  7734. * contains a property with a unique identifier. For example, given a model:
  7735. *
  7736. * ```ts
  7737. * class User {
  7738. * id: number;
  7739. * name: string;
  7740. * ...
  7741. * }
  7742. * ```
  7743. * a custom `trackBy` function could look like the following:
  7744. * ```ts
  7745. * function userTrackBy(index, user) {
  7746. * return user.id;
  7747. * }
  7748. * ```
  7749. *
  7750. * A custom `trackBy` function must have several properties:
  7751. *
  7752. * - be [idempotent](https://en.wikipedia.org/wiki/Idempotence) (be without side effects, and always
  7753. * return the same value for a given input)
  7754. * - return unique value for all unique inputs
  7755. * - be fast
  7756. *
  7757. * @see [`NgForOf#ngForTrackBy`](api/common/NgForOf#ngForTrackBy)
  7758. * @publicApi
  7759. */
  7760. interface TrackByFunction<T> {
  7761. /**
  7762. * @param index The index of the item within the iterable.
  7763. * @param item The item in the iterable.
  7764. */
  7765. <U extends T>(index: number, item: T & U): any;
  7766. }
  7767. /**
  7768. * Provides a factory for {@link IterableDiffer}.
  7769. *
  7770. * @publicApi
  7771. */
  7772. interface IterableDifferFactory {
  7773. supports(objects: any): boolean;
  7774. create<V>(trackByFn?: TrackByFunction<V>): IterableDiffer<V>;
  7775. }
  7776. /**
  7777. * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.
  7778. *
  7779. * @publicApi
  7780. */
  7781. declare class IterableDiffers {
  7782. private factories;
  7783. /** @nocollapse */
  7784. static ɵprov: unknown;
  7785. constructor(factories: IterableDifferFactory[]);
  7786. static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers;
  7787. /**
  7788. * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the
  7789. * inherited {@link IterableDiffers} instance with the provided factories and return a new
  7790. * {@link IterableDiffers} instance.
  7791. *
  7792. * @usageNotes
  7793. * ### Example
  7794. *
  7795. * The following example shows how to extend an existing list of factories,
  7796. * which will only be applied to the injector for this component and its children.
  7797. * This step is all that's required to make a new {@link IterableDiffer} available.
  7798. *
  7799. * ```ts
  7800. * @Component({
  7801. * viewProviders: [
  7802. * IterableDiffers.extend([new ImmutableListDiffer()])
  7803. * ]
  7804. * })
  7805. * ```
  7806. */
  7807. static extend(factories: IterableDifferFactory[]): StaticProvider;
  7808. find(iterable: any): IterableDifferFactory;
  7809. }
  7810. /**
  7811. * Type of the Inject decorator / constructor function.
  7812. *
  7813. * @publicApi
  7814. */
  7815. interface InjectDecorator {
  7816. /**
  7817. * Parameter decorator on a dependency parameter of a class constructor
  7818. * that specifies a custom provider of the dependency.
  7819. *
  7820. * @usageNotes
  7821. * The following example shows a class constructor that specifies a
  7822. * custom provider of a dependency using the parameter decorator.
  7823. *
  7824. * When `@Inject()` is not present, the injector uses the type annotation of the
  7825. * parameter as the provider.
  7826. *
  7827. * {@example core/di/ts/metadata_spec.ts region='InjectWithoutDecorator'}
  7828. *
  7829. * @see [Dependency Injection Guide](guide/di/dependency-injection
  7830. *
  7831. */
  7832. (token: any): any;
  7833. new (token: any): Inject;
  7834. }
  7835. /**
  7836. * Type of the Inject metadata.
  7837. *
  7838. * @publicApi
  7839. */
  7840. interface Inject {
  7841. /**
  7842. * A DI token that maps to the dependency to be injected.
  7843. */
  7844. token: any;
  7845. }
  7846. /**
  7847. * Inject decorator and metadata.
  7848. *
  7849. * @Annotation
  7850. * @publicApi
  7851. */
  7852. declare const Inject: InjectDecorator;
  7853. /**
  7854. * Type of the Optional decorator / constructor function.
  7855. *
  7856. * @publicApi
  7857. */
  7858. interface OptionalDecorator {
  7859. /**
  7860. * Parameter decorator to be used on constructor parameters,
  7861. * which marks the parameter as being an optional dependency.
  7862. * The DI framework provides `null` if the dependency is not found.
  7863. *
  7864. * Can be used together with other parameter decorators
  7865. * that modify how dependency injection operates.
  7866. *
  7867. * @usageNotes
  7868. *
  7869. * The following code allows the possibility of a `null` result:
  7870. *
  7871. * {@example core/di/ts/metadata_spec.ts region='Optional'}
  7872. *
  7873. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  7874. */
  7875. (): any;
  7876. new (): Optional;
  7877. }
  7878. /**
  7879. * Type of the Optional metadata.
  7880. *
  7881. * @publicApi
  7882. */
  7883. interface Optional {
  7884. }
  7885. /**
  7886. * Optional decorator and metadata.
  7887. *
  7888. * @Annotation
  7889. * @publicApi
  7890. */
  7891. declare const Optional: OptionalDecorator;
  7892. /**
  7893. * Type of the Self decorator / constructor function.
  7894. *
  7895. * @publicApi
  7896. */
  7897. interface SelfDecorator {
  7898. /**
  7899. * Parameter decorator to be used on constructor parameters,
  7900. * which tells the DI framework to start dependency resolution from the local injector.
  7901. *
  7902. * Resolution works upward through the injector hierarchy, so the children
  7903. * of this class must configure their own providers or be prepared for a `null` result.
  7904. *
  7905. * @usageNotes
  7906. *
  7907. * In the following example, the dependency can be resolved
  7908. * by the local injector when instantiating the class itself, but not
  7909. * when instantiating a child.
  7910. *
  7911. * {@example core/di/ts/metadata_spec.ts region='Self'}
  7912. *
  7913. * @see {@link SkipSelf}
  7914. * @see {@link Optional}
  7915. *
  7916. */
  7917. (): any;
  7918. new (): Self;
  7919. }
  7920. /**
  7921. * Type of the Self metadata.
  7922. *
  7923. * @publicApi
  7924. */
  7925. interface Self {
  7926. }
  7927. /**
  7928. * Self decorator and metadata.
  7929. *
  7930. * @Annotation
  7931. * @publicApi
  7932. */
  7933. declare const Self: SelfDecorator;
  7934. /**
  7935. * Type of the `SkipSelf` decorator / constructor function.
  7936. *
  7937. * @publicApi
  7938. */
  7939. interface SkipSelfDecorator {
  7940. /**
  7941. * Parameter decorator to be used on constructor parameters,
  7942. * which tells the DI framework to start dependency resolution from the parent injector.
  7943. * Resolution works upward through the injector hierarchy, so the local injector
  7944. * is not checked for a provider.
  7945. *
  7946. * @usageNotes
  7947. *
  7948. * In the following example, the dependency can be resolved when
  7949. * instantiating a child, but not when instantiating the class itself.
  7950. *
  7951. * {@example core/di/ts/metadata_spec.ts region='SkipSelf'}
  7952. *
  7953. * @see [Dependency Injection guide](guide/di/di-in-action#skip).
  7954. * @see {@link Self}
  7955. * @see {@link Optional}
  7956. *
  7957. */
  7958. (): any;
  7959. new (): SkipSelf;
  7960. }
  7961. /**
  7962. * Type of the `SkipSelf` metadata.
  7963. *
  7964. * @publicApi
  7965. */
  7966. interface SkipSelf {
  7967. }
  7968. /**
  7969. * `SkipSelf` decorator and metadata.
  7970. *
  7971. * @Annotation
  7972. * @publicApi
  7973. */
  7974. declare const SkipSelf: SkipSelfDecorator;
  7975. /**
  7976. * Type of the `Host` decorator / constructor function.
  7977. *
  7978. * @publicApi
  7979. */
  7980. interface HostDecorator {
  7981. /**
  7982. * Parameter decorator on a view-provider parameter of a class constructor
  7983. * that tells the DI framework to resolve the view by checking injectors of child
  7984. * elements, and stop when reaching the host element of the current component.
  7985. *
  7986. * @usageNotes
  7987. *
  7988. * The following shows use with the `@Optional` decorator, and allows for a `null` result.
  7989. *
  7990. * {@example core/di/ts/metadata_spec.ts region='Host'}
  7991. *
  7992. * For an extended example, see ["Dependency Injection
  7993. * Guide"](guide/di/di-in-action#optional).
  7994. */
  7995. (): any;
  7996. new (): Host;
  7997. }
  7998. /**
  7999. * Type of the Host metadata.
  8000. *
  8001. * @publicApi
  8002. */
  8003. interface Host {
  8004. }
  8005. /**
  8006. * Host decorator and metadata.
  8007. *
  8008. * @Annotation
  8009. * @publicApi
  8010. */
  8011. declare const Host: HostDecorator;
  8012. /**
  8013. * Runs the given function in the [context](guide/di/dependency-injection-context) of the given
  8014. * `Injector`.
  8015. *
  8016. * Within the function's stack frame, [`inject`](api/core/inject) can be used to inject dependencies
  8017. * from the given `Injector`. Note that `inject` is only usable synchronously, and cannot be used in
  8018. * any asynchronous callbacks or after any `await` points.
  8019. *
  8020. * @param injector the injector which will satisfy calls to [`inject`](api/core/inject) while `fn`
  8021. * is executing
  8022. * @param fn the closure to be run in the context of `injector`
  8023. * @returns the return value of the function, if any
  8024. * @publicApi
  8025. */
  8026. declare function runInInjectionContext<ReturnT>(injector: Injector, fn: () => ReturnT): ReturnT;
  8027. /**
  8028. * Asserts that the current stack frame is within an [injection
  8029. * context](guide/di/dependency-injection-context) and has access to `inject`.
  8030. *
  8031. * @param debugFn a reference to the function making the assertion (used for the error message).
  8032. *
  8033. * @publicApi
  8034. */
  8035. declare function assertInInjectionContext(debugFn: Function): void;
  8036. /**
  8037. * An interface that a function passed into `forwardRef` has to implement.
  8038. *
  8039. * @usageNotes
  8040. * ### Example
  8041. *
  8042. * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref_fn'}
  8043. * @publicApi
  8044. */
  8045. interface ForwardRefFn {
  8046. (): any;
  8047. }
  8048. /**
  8049. * Allows to refer to references which are not yet defined.
  8050. *
  8051. * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of
  8052. * DI is declared, but not yet defined. It is also used when the `token` which we use when creating
  8053. * a query is not yet defined.
  8054. *
  8055. * `forwardRef` is also used to break circularities in standalone components imports.
  8056. *
  8057. * @usageNotes
  8058. * ### Circular dependency example
  8059. * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}
  8060. *
  8061. * ### Circular standalone reference import example
  8062. * ```angular-ts
  8063. * @Component({
  8064. * standalone: true,
  8065. * imports: [ChildComponent],
  8066. * selector: 'app-parent',
  8067. * template: `<app-child [hideParent]="hideParent"></app-child>`,
  8068. * })
  8069. * export class ParentComponent {
  8070. * @Input() hideParent: boolean;
  8071. * }
  8072. *
  8073. *
  8074. * @Component({
  8075. * standalone: true,
  8076. * imports: [CommonModule, forwardRef(() => ParentComponent)],
  8077. * selector: 'app-child',
  8078. * template: `<app-parent *ngIf="!hideParent"></app-parent>`,
  8079. * })
  8080. * export class ChildComponent {
  8081. * @Input() hideParent: boolean;
  8082. * }
  8083. * ```
  8084. *
  8085. * @publicApi
  8086. */
  8087. declare function forwardRef(forwardRefFn: ForwardRefFn): Type$1<any>;
  8088. /**
  8089. * Lazily retrieves the reference value from a forwardRef.
  8090. *
  8091. * Acts as the identity function when given a non-forward-ref value.
  8092. *
  8093. * @usageNotes
  8094. * ### Example
  8095. *
  8096. * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}
  8097. *
  8098. * @see {@link forwardRef}
  8099. * @publicApi
  8100. */
  8101. declare function resolveForwardRef<T>(type: T): T;
  8102. /**
  8103. * Injectable providers used in `@Injectable` decorator.
  8104. *
  8105. * @publicApi
  8106. */
  8107. type InjectableProvider = ValueSansProvider | ExistingSansProvider | StaticClassSansProvider | ConstructorSansProvider | FactorySansProvider | ClassSansProvider;
  8108. /**
  8109. * Type of the Injectable decorator / constructor function.
  8110. *
  8111. * @publicApi
  8112. */
  8113. interface InjectableDecorator {
  8114. /**
  8115. * Decorator that marks a class as available to be
  8116. * provided and injected as a dependency.
  8117. *
  8118. * @see [Introduction to Services and DI](guide/di)
  8119. * @see [Dependency Injection Guide](guide/di/dependency-injection
  8120. *
  8121. * @usageNotes
  8122. *
  8123. * Marking a class with `@Injectable` ensures that the compiler
  8124. * will generate the necessary metadata to create the class's
  8125. * dependencies when the class is injected.
  8126. *
  8127. * The following example shows how a service class is properly
  8128. * marked so that a supporting service can be injected upon creation.
  8129. *
  8130. * {@example core/di/ts/metadata_spec.ts region='Injectable'}
  8131. *
  8132. */
  8133. (): TypeDecorator;
  8134. (options?: {
  8135. providedIn: Type$1<any> | 'root' | 'platform' | 'any' | null;
  8136. } & InjectableProvider): TypeDecorator;
  8137. new (): Injectable;
  8138. new (options?: {
  8139. providedIn: Type$1<any> | 'root' | 'platform' | 'any' | null;
  8140. } & InjectableProvider): Injectable;
  8141. }
  8142. /**
  8143. * Type of the Injectable metadata.
  8144. *
  8145. * @publicApi
  8146. */
  8147. interface Injectable {
  8148. /**
  8149. * Determines which injectors will provide the injectable.
  8150. *
  8151. * - `Type<any>` - associates the injectable with an `@NgModule` or other `InjectorType`. This
  8152. * option is DEPRECATED.
  8153. * - 'null' : Equivalent to `undefined`. The injectable is not provided in any scope automatically
  8154. * and must be added to a `providers` array of an [@NgModule](api/core/NgModule#providers),
  8155. * [@Component](api/core/Directive#providers) or [@Directive](api/core/Directive#providers).
  8156. *
  8157. * The following options specify that this injectable should be provided in one of the following
  8158. * injectors:
  8159. * - 'root' : The application-level injector in most apps.
  8160. * - 'platform' : A special singleton platform injector shared by all
  8161. * applications on the page.
  8162. * - 'any' : Provides a unique instance in each lazy loaded module while all eagerly loaded
  8163. * modules share one instance. This option is DEPRECATED.
  8164. *
  8165. */
  8166. providedIn?: Type$1<any> | 'root' | 'platform' | 'any' | null;
  8167. }
  8168. /**
  8169. * Injectable decorator and metadata.
  8170. *
  8171. * @Annotation
  8172. * @publicApi
  8173. */
  8174. declare const Injectable: InjectableDecorator;
  8175. /**
  8176. * A multi-provider token for initialization functions that will run upon construction of an
  8177. * environment injector.
  8178. *
  8179. * @deprecated from v19.0.0, use provideEnvironmentInitializer instead
  8180. *
  8181. * @see {@link provideEnvironmentInitializer}
  8182. *
  8183. * Note: As opposed to the `APP_INITIALIZER` token, the `ENVIRONMENT_INITIALIZER` functions are not awaited,
  8184. * hence they should not be `async`.
  8185. *
  8186. * @publicApi
  8187. */
  8188. declare const ENVIRONMENT_INITIALIZER: InjectionToken<readonly (() => void)[]>;
  8189. /*!
  8190. * @license
  8191. * Copyright Google LLC All Rights Reserved.
  8192. *
  8193. * Use of this source code is governed by an MIT-style license that can be
  8194. * found in the LICENSE file at https://angular.dev/license
  8195. */
  8196. /**
  8197. * Creates a token that can be used to inject static attributes of the host node.
  8198. *
  8199. * @usageNotes
  8200. * ### Injecting an attribute that is known to exist
  8201. * ```ts
  8202. * @Directive()
  8203. * class MyDir {
  8204. * attr: string = inject(new HostAttributeToken('some-attr'));
  8205. * }
  8206. * ```
  8207. *
  8208. * ### Optionally injecting an attribute
  8209. * ```ts
  8210. * @Directive()
  8211. * class MyDir {
  8212. * attr: string | null = inject(new HostAttributeToken('some-attr'), {optional: true});
  8213. * }
  8214. * ```
  8215. * @publicApi
  8216. */
  8217. declare class HostAttributeToken {
  8218. private attributeName;
  8219. constructor(attributeName: string);
  8220. toString(): string;
  8221. }
  8222. /**
  8223. * Generated instruction: injects a token from the currently active injector.
  8224. *
  8225. * (Additional documentation moved to `inject`, as it is the public API, and an alias for this
  8226. * instruction)
  8227. *
  8228. * @see inject
  8229. * @codeGenApi
  8230. * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to npm.
  8231. */
  8232. declare function ɵɵinject<T>(token: ProviderToken<T>): T;
  8233. declare function ɵɵinject<T>(token: ProviderToken<T>, flags?: InjectFlags): T | null;
  8234. declare function ɵɵinject(token: HostAttributeToken): string;
  8235. declare function ɵɵinject(token: HostAttributeToken, flags?: InjectFlags): string | null;
  8236. declare function ɵɵinject<T>(token: ProviderToken<T> | HostAttributeToken, flags?: InjectFlags): string | null;
  8237. /**
  8238. * Throws an error indicating that a factory function could not be generated by the compiler for a
  8239. * particular class.
  8240. *
  8241. * The name of the class is not mentioned here, but will be in the generated factory function name
  8242. * and thus in the stack trace.
  8243. *
  8244. * @codeGenApi
  8245. */
  8246. declare function ɵɵinvalidFactoryDep(index: number): never;
  8247. /**
  8248. * @param token A token that represents a dependency that should be injected.
  8249. * @returns the injected value if operation is successful, `null` otherwise.
  8250. * @throws if called outside of a supported context.
  8251. *
  8252. * @publicApi
  8253. */
  8254. declare function inject<T>(token: ProviderToken<T>): T;
  8255. /**
  8256. * @param token A token that represents a dependency that should be injected.
  8257. * @param flags Control how injection is executed. The flags correspond to injection strategies that
  8258. * can be specified with parameter decorators `@Host`, `@Self`, `@SkipSelf`, and `@Optional`.
  8259. * @returns the injected value if operation is successful, `null` otherwise.
  8260. * @throws if called outside of a supported context.
  8261. *
  8262. * @publicApi
  8263. * @deprecated prefer an options object instead of `InjectFlags`
  8264. */
  8265. declare function inject<T>(token: ProviderToken<T>, flags?: InjectFlags): T | null;
  8266. /**
  8267. * @param token A token that represents a dependency that should be injected.
  8268. * @param options Control how injection is executed. Options correspond to injection strategies
  8269. * that can be specified with parameter decorators `@Host`, `@Self`, `@SkipSelf`, and
  8270. * `@Optional`.
  8271. * @returns the injected value if operation is successful.
  8272. * @throws if called outside of a supported context, or if the token is not found.
  8273. *
  8274. * @publicApi
  8275. */
  8276. declare function inject<T>(token: ProviderToken<T>, options: InjectOptions & {
  8277. optional?: false;
  8278. }): T;
  8279. /**
  8280. * @param token A token that represents a dependency that should be injected.
  8281. * @param options Control how injection is executed. Options correspond to injection strategies
  8282. * that can be specified with parameter decorators `@Host`, `@Self`, `@SkipSelf`, and
  8283. * `@Optional`.
  8284. * @returns the injected value if operation is successful, `null` if the token is not
  8285. * found and optional injection has been requested.
  8286. * @throws if called outside of a supported context, or if the token is not found and optional
  8287. * injection was not requested.
  8288. *
  8289. * @publicApi
  8290. */
  8291. declare function inject<T>(token: ProviderToken<T>, options: InjectOptions): T | null;
  8292. /**
  8293. * @param token A token that represents a static attribute on the host node that should be injected.
  8294. * @returns Value of the attribute if it exists.
  8295. * @throws If called outside of a supported context or the attribute does not exist.
  8296. *
  8297. * @publicApi
  8298. */
  8299. declare function inject(token: HostAttributeToken): string;
  8300. /**
  8301. * @param token A token that represents a static attribute on the host node that should be injected.
  8302. * @returns Value of the attribute if it exists, otherwise `null`.
  8303. * @throws If called outside of a supported context.
  8304. *
  8305. * @publicApi
  8306. */
  8307. declare function inject(token: HostAttributeToken, options: {
  8308. optional: true;
  8309. }): string | null;
  8310. /**
  8311. * @param token A token that represents a static attribute on the host node that should be injected.
  8312. * @returns Value of the attribute if it exists.
  8313. * @throws If called outside of a supported context or the attribute does not exist.
  8314. *
  8315. * @publicApi
  8316. */
  8317. declare function inject(token: HostAttributeToken, options: {
  8318. optional: false;
  8319. }): string;
  8320. declare function convertToBitFlags(flags: InjectOptions | InjectFlags | undefined): InjectFlags | undefined;
  8321. /**
  8322. * An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors.
  8323. *
  8324. * Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a
  8325. * project.
  8326. *
  8327. * @publicApi
  8328. */
  8329. declare const INJECTOR: InjectionToken<Injector>;
  8330. /**
  8331. * A token that can be used to inject the tag name of the host node.
  8332. *
  8333. * @usageNotes
  8334. * ### Injecting a tag name that is known to exist
  8335. * ```ts
  8336. * @Directive()
  8337. * class MyDir {
  8338. * tagName: string = inject(HOST_TAG_NAME);
  8339. * }
  8340. * ```
  8341. *
  8342. * ### Optionally injecting a tag name
  8343. * ```ts
  8344. * @Directive()
  8345. * class MyDir {
  8346. * tagName: string | null = inject(HOST_TAG_NAME, {optional: true});
  8347. * }
  8348. * ```
  8349. * @publicApi
  8350. */
  8351. declare const HOST_TAG_NAME: InjectionToken<string>;
  8352. /**
  8353. * A differ that tracks changes made to an object over time.
  8354. *
  8355. * @publicApi
  8356. */
  8357. interface KeyValueDiffer<K, V> {
  8358. /**
  8359. * Compute a difference between the previous state and the new `object` state.
  8360. *
  8361. * @param object containing the new value.
  8362. * @returns an object describing the difference. The return value is only valid until the next
  8363. * `diff()` invocation.
  8364. */
  8365. diff(object: Map<K, V>): KeyValueChanges<K, V> | null;
  8366. /**
  8367. * Compute a difference between the previous state and the new `object` state.
  8368. *
  8369. * @param object containing the new value.
  8370. * @returns an object describing the difference. The return value is only valid until the next
  8371. * `diff()` invocation.
  8372. */
  8373. diff(object: {
  8374. [key: string]: V;
  8375. }): KeyValueChanges<string, V> | null;
  8376. }
  8377. /**
  8378. * An object describing the changes in the `Map` or `{[k:string]: string}` since last time
  8379. * `KeyValueDiffer#diff()` was invoked.
  8380. *
  8381. * @publicApi
  8382. */
  8383. interface KeyValueChanges<K, V> {
  8384. /**
  8385. * Iterate over all changes. `KeyValueChangeRecord` will contain information about changes
  8386. * to each item.
  8387. */
  8388. forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  8389. /**
  8390. * Iterate over changes in the order of original Map showing where the original items
  8391. * have moved.
  8392. */
  8393. forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  8394. /**
  8395. * Iterate over all keys for which values have changed.
  8396. */
  8397. forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  8398. /**
  8399. * Iterate over all added items.
  8400. */
  8401. forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  8402. /**
  8403. * Iterate over all removed items.
  8404. */
  8405. forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  8406. }
  8407. /**
  8408. * Record representing the item change information.
  8409. *
  8410. * @publicApi
  8411. */
  8412. interface KeyValueChangeRecord<K, V> {
  8413. /**
  8414. * Current key in the Map.
  8415. */
  8416. readonly key: K;
  8417. /**
  8418. * Current value for the key or `null` if removed.
  8419. */
  8420. readonly currentValue: V | null;
  8421. /**
  8422. * Previous value for the key or `null` if added.
  8423. */
  8424. readonly previousValue: V | null;
  8425. }
  8426. /**
  8427. * Provides a factory for {@link KeyValueDiffer}.
  8428. *
  8429. * @publicApi
  8430. */
  8431. interface KeyValueDifferFactory {
  8432. /**
  8433. * Test to see if the differ knows how to diff this kind of object.
  8434. */
  8435. supports(objects: any): boolean;
  8436. /**
  8437. * Create a `KeyValueDiffer`.
  8438. */
  8439. create<K, V>(): KeyValueDiffer<K, V>;
  8440. }
  8441. /**
  8442. * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.
  8443. *
  8444. * @publicApi
  8445. */
  8446. declare class KeyValueDiffers {
  8447. /** @nocollapse */
  8448. static ɵprov: unknown;
  8449. private readonly factories;
  8450. constructor(factories: KeyValueDifferFactory[]);
  8451. static create<S>(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers;
  8452. /**
  8453. * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the
  8454. * inherited {@link KeyValueDiffers} instance with the provided factories and return a new
  8455. * {@link KeyValueDiffers} instance.
  8456. *
  8457. * @usageNotes
  8458. * ### Example
  8459. *
  8460. * The following example shows how to extend an existing list of factories,
  8461. * which will only be applied to the injector for this component and its children.
  8462. * This step is all that's required to make a new {@link KeyValueDiffer} available.
  8463. *
  8464. * ```ts
  8465. * @Component({
  8466. * viewProviders: [
  8467. * KeyValueDiffers.extend([new ImmutableMapDiffer()])
  8468. * ]
  8469. * })
  8470. * ```
  8471. */
  8472. static extend<S>(factories: KeyValueDifferFactory[]): StaticProvider;
  8473. find(kv: any): KeyValueDifferFactory;
  8474. }
  8475. declare function devModeEqual(a: any, b: any): boolean;
  8476. /**
  8477. * Base class that provides change detection functionality.
  8478. * A change-detection tree collects all views that are to be checked for changes.
  8479. * Use the methods to add and remove views from the tree, initiate change-detection,
  8480. * and explicitly mark views as _dirty_, meaning that they have changed and need to be re-rendered.
  8481. *
  8482. * @see [Using change detection hooks](guide/components/lifecycle#using-change-detection-hooks)
  8483. * @see [Defining custom change detection](guide/components/lifecycle#defining-custom-change-detection)
  8484. *
  8485. * @usageNotes
  8486. *
  8487. * The following examples demonstrate how to modify default change-detection behavior
  8488. * to perform explicit detection when needed.
  8489. *
  8490. * ### Use `markForCheck()` with `CheckOnce` strategy
  8491. *
  8492. * The following example sets the `OnPush` change-detection strategy for a component
  8493. * (`CheckOnce`, rather than the default `CheckAlways`), then forces a second check
  8494. * after an interval.
  8495. *
  8496. * {@example core/ts/change_detect/change-detection.ts region='mark-for-check'}
  8497. *
  8498. * ### Detach change detector to limit how often check occurs
  8499. *
  8500. * The following example defines a component with a large list of read-only data
  8501. * that is expected to change constantly, many times per second.
  8502. * To improve performance, we want to check and update the list
  8503. * less often than the changes actually occur. To do that, we detach
  8504. * the component's change detector and perform an explicit local check every five seconds.
  8505. *
  8506. * {@example core/ts/change_detect/change-detection.ts region='detach'}
  8507. *
  8508. *
  8509. * ### Reattaching a detached component
  8510. *
  8511. * The following example creates a component displaying live data.
  8512. * The component detaches its change detector from the main change detector tree
  8513. * when the `live` property is set to false, and reattaches it when the property
  8514. * becomes true.
  8515. *
  8516. * {@example core/ts/change_detect/change-detection.ts region='reattach'}
  8517. *
  8518. * @publicApi
  8519. */
  8520. declare abstract class ChangeDetectorRef {
  8521. /**
  8522. * When a view uses the {@link ChangeDetectionStrategy#OnPush} (checkOnce)
  8523. * change detection strategy, explicitly marks the view as changed so that
  8524. * it can be checked again.
  8525. *
  8526. * Components are normally marked as dirty (in need of rerendering) when inputs
  8527. * have changed or events have fired in the view. Call this method to ensure that
  8528. * a component is checked even if these triggers have not occurred.
  8529. *
  8530. * <!-- TODO: Add a link to a chapter on OnPush components -->
  8531. *
  8532. */
  8533. abstract markForCheck(): void;
  8534. /**
  8535. * Detaches this view from the change-detection tree.
  8536. * A detached view is not checked until it is reattached.
  8537. * Use in combination with `detectChanges()` to implement local change detection checks.
  8538. *
  8539. * Detached views are not checked during change detection runs until they are
  8540. * re-attached, even if they are marked as dirty.
  8541. *
  8542. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  8543. * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
  8544. *
  8545. */
  8546. abstract detach(): void;
  8547. /**
  8548. * Checks this view and its children. Use in combination with {@link ChangeDetectorRef#detach}
  8549. * to implement local change detection checks.
  8550. *
  8551. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  8552. * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
  8553. *
  8554. */
  8555. abstract detectChanges(): void;
  8556. /**
  8557. * Checks the change detector and its children, and throws if any changes are detected.
  8558. *
  8559. * Use in development mode to verify that running change detection doesn't introduce
  8560. * other changes. Calling it in production mode is a noop.
  8561. *
  8562. * @deprecated This is a test-only API that does not have a place in production interface.
  8563. * `checkNoChanges` is already part of an `ApplicationRef` tick when the app is running in dev
  8564. * mode. For more granular `checkNoChanges` validation, use `ComponentFixture`.
  8565. */
  8566. abstract checkNoChanges(): void;
  8567. /**
  8568. * Re-attaches the previously detached view to the change detection tree.
  8569. * Views are attached to the tree by default.
  8570. *
  8571. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  8572. *
  8573. */
  8574. abstract reattach(): void;
  8575. }
  8576. /** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */
  8577. declare function injectChangeDetectorRef(flags: InjectFlags): ChangeDetectorRef;
  8578. /**
  8579. * @deprecated v4.0.0 - Should not be part of public API.
  8580. * @publicApi
  8581. */
  8582. declare class DefaultIterableDiffer<V> implements IterableDiffer<V>, IterableChanges<V> {
  8583. readonly length: number;
  8584. readonly collection: V[] | Iterable<V> | null;
  8585. private _linkedRecords;
  8586. private _unlinkedRecords;
  8587. private _previousItHead;
  8588. private _itHead;
  8589. private _itTail;
  8590. private _additionsHead;
  8591. private _additionsTail;
  8592. private _movesHead;
  8593. private _movesTail;
  8594. private _removalsHead;
  8595. private _removalsTail;
  8596. private _identityChangesHead;
  8597. private _identityChangesTail;
  8598. private _trackByFn;
  8599. constructor(trackByFn?: TrackByFunction<V>);
  8600. forEachItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  8601. forEachOperation(fn: (item: IterableChangeRecord<V>, previousIndex: number | null, currentIndex: number | null) => void): void;
  8602. forEachPreviousItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  8603. forEachAddedItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  8604. forEachMovedItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  8605. forEachRemovedItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  8606. forEachIdentityChange(fn: (record: IterableChangeRecord_<V>) => void): void;
  8607. diff(collection: NgIterable<V> | null | undefined): DefaultIterableDiffer<V> | null;
  8608. onDestroy(): void;
  8609. check(collection: NgIterable<V>): boolean;
  8610. get isDirty(): boolean;
  8611. private _addToRemovals;
  8612. }
  8613. declare class IterableChangeRecord_<V> implements IterableChangeRecord<V> {
  8614. item: V;
  8615. trackById: any;
  8616. currentIndex: number | null;
  8617. previousIndex: number | null;
  8618. constructor(item: V, trackById: any);
  8619. }
  8620. /**
  8621. * An interface that is implemented by pipes in order to perform a transformation.
  8622. * Angular invokes the `transform` method with the value of a binding
  8623. * as the first argument, and any parameters as the second argument in list form.
  8624. *
  8625. * @usageNotes
  8626. *
  8627. * In the following example, `TruncatePipe` returns the shortened value with an added ellipses.
  8628. *
  8629. * <code-example path="core/ts/pipes/simple_truncate.ts" header="simple_truncate.ts"></code-example>
  8630. *
  8631. * Invoking `{{ 'It was the best of times' | truncate }}` in a template will produce `It was...`.
  8632. *
  8633. * In the following example, `TruncatePipe` takes parameters that sets the truncated length and the
  8634. * string to append with.
  8635. *
  8636. * <code-example path="core/ts/pipes/truncate.ts" header="truncate.ts"></code-example>
  8637. *
  8638. * Invoking `{{ 'It was the best of times' | truncate:4:'....' }}` in a template will produce `It
  8639. * was the best....`.
  8640. *
  8641. * @publicApi
  8642. */
  8643. interface PipeTransform {
  8644. transform(value: any, ...args: any[]): any;
  8645. }
  8646. declare const defaultIterableDiffers: IterableDiffers;
  8647. declare const defaultKeyValueDiffers: KeyValueDiffers;
  8648. /**
  8649. * A wrapper around a native element inside of a View.
  8650. *
  8651. * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM
  8652. * element.
  8653. *
  8654. * @security Permitting direct access to the DOM can make your application more vulnerable to
  8655. * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the
  8656. * [Security Guide](https://g.co/ng/security).
  8657. *
  8658. * @publicApi
  8659. */
  8660. declare class ElementRef<T = any> {
  8661. /**
  8662. * <div class="callout is-critical">
  8663. * <header>Use with caution</header>
  8664. * <p>
  8665. * Use this API as the last resort when direct access to DOM is needed. Use templating and
  8666. * data-binding provided by Angular instead. Alternatively you can take a look at
  8667. * {@link Renderer2} which provides an API that can be safely used.
  8668. * </p>
  8669. * </div>
  8670. */
  8671. nativeElement: T;
  8672. constructor(nativeElement: T);
  8673. }
  8674. /**
  8675. * A simple registry that maps `Components` to generated `ComponentFactory` classes
  8676. * that can be used to create instances of components.
  8677. * Use to obtain the factory for a given component type,
  8678. * then use the factory's `create()` method to create a component of that type.
  8679. *
  8680. * Note: since v13, dynamic component creation via
  8681. * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)
  8682. * does **not** require resolving component factory: component class can be used directly.
  8683. *
  8684. * @publicApi
  8685. *
  8686. * @deprecated Angular no longer requires Component factories. Please use other APIs where
  8687. * Component class can be used directly.
  8688. */
  8689. declare abstract class ComponentFactoryResolver$1 {
  8690. static NULL: ComponentFactoryResolver$1;
  8691. /**
  8692. * Retrieves the factory object that creates a component of the given type.
  8693. * @param component The component type.
  8694. */
  8695. abstract resolveComponentFactory<T>(component: Type$1<T>): ComponentFactory$1<T>;
  8696. }
  8697. /**
  8698. * Represents an instance of an `NgModule` created by an `NgModuleFactory`.
  8699. * Provides access to the `NgModule` instance and related objects.
  8700. *
  8701. * @publicApi
  8702. */
  8703. declare abstract class NgModuleRef$1<T> {
  8704. /**
  8705. * The injector that contains all of the providers of the `NgModule`.
  8706. */
  8707. abstract get injector(): EnvironmentInjector;
  8708. /**
  8709. * The resolver that can retrieve component factories in a context of this module.
  8710. *
  8711. * Note: since v13, dynamic component creation via
  8712. * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)
  8713. * does **not** require resolving component factory: component class can be used directly.
  8714. *
  8715. * @deprecated Angular no longer requires Component factories. Please use other APIs where
  8716. * Component class can be used directly.
  8717. */
  8718. abstract get componentFactoryResolver(): ComponentFactoryResolver$1;
  8719. /**
  8720. * The `NgModule` instance.
  8721. */
  8722. abstract get instance(): T;
  8723. /**
  8724. * Destroys the module instance and all of the data structures associated with it.
  8725. */
  8726. abstract destroy(): void;
  8727. /**
  8728. * Registers a callback to be executed when the module is destroyed.
  8729. */
  8730. abstract onDestroy(callback: () => void): void;
  8731. }
  8732. interface InternalNgModuleRef<T> extends NgModuleRef$1<T> {
  8733. _bootstrapComponents: Type$1<any>[];
  8734. resolveInjectorInitializers(): void;
  8735. }
  8736. /**
  8737. * @publicApi
  8738. *
  8739. * @deprecated
  8740. * This class was mostly used as a part of ViewEngine-based JIT API and is no longer needed in Ivy
  8741. * JIT mode. Angular provides APIs that accept NgModule classes directly (such as
  8742. * [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and
  8743. * [createNgModule](api/core/createNgModule)), consider switching to those APIs instead of
  8744. * using factory-based ones.
  8745. */
  8746. declare abstract class NgModuleFactory$1<T> {
  8747. abstract get moduleType(): Type$1<T>;
  8748. abstract create(parentInjector: Injector | null): NgModuleRef$1<T>;
  8749. }
  8750. /**
  8751. * Represents an Angular view.
  8752. *
  8753. * @see {@link /api/core/ChangeDetectorRef?tab=usage-notes Change detection usage}
  8754. *
  8755. * @publicApi
  8756. */
  8757. declare abstract class ViewRef$1 extends ChangeDetectorRef {
  8758. /**
  8759. * Destroys this view and all of the data structures associated with it.
  8760. */
  8761. abstract destroy(): void;
  8762. /**
  8763. * Reports whether this view has been destroyed.
  8764. * @returns True after the `destroy()` method has been called, false otherwise.
  8765. */
  8766. abstract get destroyed(): boolean;
  8767. /**
  8768. * A lifecycle hook that provides additional developer-defined cleanup
  8769. * functionality for views.
  8770. * @param callback A handler function that cleans up developer-defined data
  8771. * associated with a view. Called when the `destroy()` method is invoked.
  8772. */
  8773. abstract onDestroy(callback: Function): void;
  8774. }
  8775. /**
  8776. * Represents an Angular view in a view container.
  8777. * An embedded view can be referenced from a component
  8778. * other than the hosting component whose template defines it, or it can be defined
  8779. * independently by a `TemplateRef`.
  8780. *
  8781. * Properties of elements in a view can change, but the structure (number and order) of elements in
  8782. * a view cannot. Change the structure of elements by inserting, moving, or
  8783. * removing nested views in a view container.
  8784. *
  8785. * @see {@link ViewContainerRef}
  8786. *
  8787. * @usageNotes
  8788. *
  8789. * The following template breaks down into two separate `TemplateRef` instances,
  8790. * an outer one and an inner one.
  8791. *
  8792. * ```html
  8793. * Count: {{items.length}}
  8794. * <ul>
  8795. * <li *ngFor="let item of items">{{item}}</li>
  8796. * </ul>
  8797. * ```
  8798. *
  8799. * This is the outer `TemplateRef`:
  8800. *
  8801. * ```html
  8802. * Count: {{items.length}}
  8803. * <ul>
  8804. * <ng-template ngFor let-item [ngForOf]="items"></ng-template>
  8805. * </ul>
  8806. * ```
  8807. *
  8808. * This is the inner `TemplateRef`:
  8809. *
  8810. * ```html
  8811. * <li>{{item}}</li>
  8812. * ```
  8813. *
  8814. * The outer and inner `TemplateRef` instances are assembled into views as follows:
  8815. *
  8816. * ```html
  8817. * <!-- ViewRef: outer-0 -->
  8818. * Count: 2
  8819. * <ul>
  8820. * <ng-template view-container-ref></ng-template>
  8821. * <!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 -->
  8822. * <!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 -->
  8823. * </ul>
  8824. * <!-- /ViewRef: outer-0 -->
  8825. * ```
  8826. * @publicApi
  8827. */
  8828. declare abstract class EmbeddedViewRef<C> extends ViewRef$1 {
  8829. /**
  8830. * The context for this view, inherited from the anchor element.
  8831. */
  8832. abstract context: C;
  8833. /**
  8834. * The root nodes for this embedded view.
  8835. */
  8836. abstract get rootNodes(): any[];
  8837. }
  8838. /**
  8839. * Represents a component created by a `ComponentFactory`.
  8840. * Provides access to the component instance and related objects,
  8841. * and provides the means of destroying the instance.
  8842. *
  8843. * @publicApi
  8844. */
  8845. declare abstract class ComponentRef$1<C> {
  8846. /**
  8847. * Updates a specified input name to a new value. Using this method will properly mark for check
  8848. * component using the `OnPush` change detection strategy. It will also assure that the
  8849. * `OnChanges` lifecycle hook runs when a dynamically created component is change-detected.
  8850. *
  8851. * @param name The name of an input.
  8852. * @param value The new value of an input.
  8853. */
  8854. abstract setInput(name: string, value: unknown): void;
  8855. /**
  8856. * The host or anchor element for this component instance.
  8857. */
  8858. abstract get location(): ElementRef;
  8859. /**
  8860. * The dependency injector for this component instance.
  8861. */
  8862. abstract get injector(): Injector;
  8863. /**
  8864. * This component instance.
  8865. */
  8866. abstract get instance(): C;
  8867. /**
  8868. * The host view defined by the template
  8869. * for this component instance.
  8870. */
  8871. abstract get hostView(): ViewRef$1;
  8872. /**
  8873. * The change detector for this component instance.
  8874. */
  8875. abstract get changeDetectorRef(): ChangeDetectorRef;
  8876. /**
  8877. * The type of this component (as created by a `ComponentFactory` class).
  8878. */
  8879. abstract get componentType(): Type$1<any>;
  8880. /**
  8881. * Destroys the component instance and all of the data structures associated with it.
  8882. */
  8883. abstract destroy(): void;
  8884. /**
  8885. * A lifecycle hook that provides additional developer-defined cleanup
  8886. * functionality for the component.
  8887. * @param callback A handler function that cleans up developer-defined data
  8888. * associated with this component. Called when the `destroy()` method is invoked.
  8889. */
  8890. abstract onDestroy(callback: Function): void;
  8891. }
  8892. /**
  8893. * Base class for a factory that can create a component dynamically.
  8894. * Instantiate a factory for a given type of component with `resolveComponentFactory()`.
  8895. * Use the resulting `ComponentFactory.create()` method to create a component of that type.
  8896. *
  8897. * @publicApi
  8898. *
  8899. * @deprecated Angular no longer requires Component factories. Please use other APIs where
  8900. * Component class can be used directly.
  8901. */
  8902. declare abstract class ComponentFactory$1<C> {
  8903. /**
  8904. * The component's HTML selector.
  8905. */
  8906. abstract get selector(): string;
  8907. /**
  8908. * The type of component the factory will create.
  8909. */
  8910. abstract get componentType(): Type$1<any>;
  8911. /**
  8912. * Selector for all <ng-content> elements in the component.
  8913. */
  8914. abstract get ngContentSelectors(): string[];
  8915. /**
  8916. * The inputs of the component.
  8917. */
  8918. abstract get inputs(): {
  8919. propName: string;
  8920. templateName: string;
  8921. transform?: (value: any) => any;
  8922. isSignal: boolean;
  8923. }[];
  8924. /**
  8925. * The outputs of the component.
  8926. */
  8927. abstract get outputs(): {
  8928. propName: string;
  8929. templateName: string;
  8930. }[];
  8931. /**
  8932. * Creates a new component.
  8933. */
  8934. abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any, environmentInjector?: EnvironmentInjector | NgModuleRef$1<any>): ComponentRef$1<C>;
  8935. }
  8936. /**
  8937. * Use in components with the `@Output` directive to emit custom events
  8938. * synchronously or asynchronously, and register handlers for those events
  8939. * by subscribing to an instance.
  8940. *
  8941. * @usageNotes
  8942. *
  8943. * Extends
  8944. * [RxJS `Subject`](https://rxjs.dev/api/index/class/Subject)
  8945. * for Angular by adding the `emit()` method.
  8946. *
  8947. * In the following example, a component defines two output properties
  8948. * that create event emitters. When the title is clicked, the emitter
  8949. * emits an open or close event to toggle the current visibility state.
  8950. *
  8951. * ```angular-ts
  8952. * @Component({
  8953. * selector: 'zippy',
  8954. * template: `
  8955. * <div class="zippy">
  8956. * <div (click)="toggle()">Toggle</div>
  8957. * <div [hidden]="!visible">
  8958. * <ng-content></ng-content>
  8959. * </div>
  8960. * </div>`})
  8961. * export class Zippy {
  8962. * visible: boolean = true;
  8963. * @Output() open: EventEmitter<any> = new EventEmitter();
  8964. * @Output() close: EventEmitter<any> = new EventEmitter();
  8965. *
  8966. * toggle() {
  8967. * this.visible = !this.visible;
  8968. * if (this.visible) {
  8969. * this.open.emit(null);
  8970. * } else {
  8971. * this.close.emit(null);
  8972. * }
  8973. * }
  8974. * }
  8975. * ```
  8976. *
  8977. * Access the event object with the `$event` argument passed to the output event
  8978. * handler:
  8979. *
  8980. * ```html
  8981. * <zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>
  8982. * ```
  8983. *
  8984. * @publicApi
  8985. */
  8986. interface EventEmitter<T> extends Subject<T>, OutputRef<T> {
  8987. /**
  8988. * Creates an instance of this class that can
  8989. * deliver events synchronously or asynchronously.
  8990. *
  8991. * @param [isAsync=false] When true, deliver events asynchronously.
  8992. *
  8993. */
  8994. new (isAsync?: boolean): EventEmitter<T>;
  8995. /**
  8996. * Emits an event containing a given value.
  8997. * @param value The value to emit.
  8998. */
  8999. emit(value?: T): void;
  9000. /**
  9001. * Registers handlers for events emitted by this instance.
  9002. * @param next When supplied, a custom handler for emitted events.
  9003. * @param error When supplied, a custom handler for an error notification from this emitter.
  9004. * @param complete When supplied, a custom handler for a completion notification from this
  9005. * emitter.
  9006. */
  9007. subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Subscription;
  9008. /**
  9009. * Registers handlers for events emitted by this instance.
  9010. * @param observerOrNext When supplied, a custom handler for emitted events, or an observer
  9011. * object.
  9012. * @param error When supplied, a custom handler for an error notification from this emitter.
  9013. * @param complete When supplied, a custom handler for a completion notification from this
  9014. * emitter.
  9015. */
  9016. subscribe(observerOrNext?: any, error?: any, complete?: any): Subscription;
  9017. }
  9018. /**
  9019. * @publicApi
  9020. */
  9021. declare const EventEmitter: {
  9022. new (isAsync?: boolean): EventEmitter<any>;
  9023. new <T>(isAsync?: boolean): EventEmitter<T>;
  9024. readonly prototype: EventEmitter<any>;
  9025. };
  9026. /**
  9027. * An injectable service for executing work inside or outside of the Angular zone.
  9028. *
  9029. * The most common use of this service is to optimize performance when starting a work consisting of
  9030. * one or more asynchronous tasks that don't require UI updates or error handling to be handled by
  9031. * Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks
  9032. * can reenter the Angular zone via {@link #run}.
  9033. *
  9034. * <!-- TODO: add/fix links to:
  9035. * - docs explaining zones and the use of zones in Angular and change-detection
  9036. * - link to runOutsideAngular/run (throughout this file!)
  9037. * -->
  9038. *
  9039. * @usageNotes
  9040. * ### Example
  9041. *
  9042. * ```ts
  9043. * import {Component, NgZone} from '@angular/core';
  9044. * import {NgIf} from '@angular/common';
  9045. *
  9046. * @Component({
  9047. * selector: 'ng-zone-demo',
  9048. * template: `
  9049. * <h2>Demo: NgZone</h2>
  9050. *
  9051. * <p>Progress: {{progress}}%</p>
  9052. * <p *ngIf="progress >= 100">Done processing {{label}} of Angular zone!</p>
  9053. *
  9054. * <button (click)="processWithinAngularZone()">Process within Angular zone</button>
  9055. * <button (click)="processOutsideOfAngularZone()">Process outside of Angular zone</button>
  9056. * `,
  9057. * })
  9058. * export class NgZoneDemo {
  9059. * progress: number = 0;
  9060. * label: string;
  9061. *
  9062. * constructor(private _ngZone: NgZone) {}
  9063. *
  9064. * // Loop inside the Angular zone
  9065. * // so the UI DOES refresh after each setTimeout cycle
  9066. * processWithinAngularZone() {
  9067. * this.label = 'inside';
  9068. * this.progress = 0;
  9069. * this._increaseProgress(() => console.log('Inside Done!'));
  9070. * }
  9071. *
  9072. * // Loop outside of the Angular zone
  9073. * // so the UI DOES NOT refresh after each setTimeout cycle
  9074. * processOutsideOfAngularZone() {
  9075. * this.label = 'outside';
  9076. * this.progress = 0;
  9077. * this._ngZone.runOutsideAngular(() => {
  9078. * this._increaseProgress(() => {
  9079. * // reenter the Angular zone and display done
  9080. * this._ngZone.run(() => { console.log('Outside Done!'); });
  9081. * });
  9082. * });
  9083. * }
  9084. *
  9085. * _increaseProgress(doneCallback: () => void) {
  9086. * this.progress += 1;
  9087. * console.log(`Current progress: ${this.progress}%`);
  9088. *
  9089. * if (this.progress < 100) {
  9090. * window.setTimeout(() => this._increaseProgress(doneCallback), 10);
  9091. * } else {
  9092. * doneCallback();
  9093. * }
  9094. * }
  9095. * }
  9096. * ```
  9097. *
  9098. * @publicApi
  9099. */
  9100. declare class NgZone {
  9101. readonly hasPendingMacrotasks: boolean;
  9102. readonly hasPendingMicrotasks: boolean;
  9103. /**
  9104. * Whether there are no outstanding microtasks or macrotasks.
  9105. */
  9106. readonly isStable: boolean;
  9107. /**
  9108. * Notifies when code enters Angular Zone. This gets fired first on VM Turn.
  9109. */
  9110. readonly onUnstable: EventEmitter<any>;
  9111. /**
  9112. * Notifies when there is no more microtasks enqueued in the current VM Turn.
  9113. * This is a hint for Angular to do change detection, which may enqueue more microtasks.
  9114. * For this reason this event can fire multiple times per VM Turn.
  9115. */
  9116. readonly onMicrotaskEmpty: EventEmitter<any>;
  9117. /**
  9118. * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which
  9119. * implies we are about to relinquish VM turn.
  9120. * This event gets called just once.
  9121. */
  9122. readonly onStable: EventEmitter<any>;
  9123. /**
  9124. * Notifies that an error has been delivered.
  9125. */
  9126. readonly onError: EventEmitter<any>;
  9127. constructor(options: {
  9128. enableLongStackTrace?: boolean;
  9129. shouldCoalesceEventChangeDetection?: boolean;
  9130. shouldCoalesceRunChangeDetection?: boolean;
  9131. });
  9132. /**
  9133. This method checks whether the method call happens within an Angular Zone instance.
  9134. */
  9135. static isInAngularZone(): boolean;
  9136. /**
  9137. Assures that the method is called within the Angular Zone, otherwise throws an error.
  9138. */
  9139. static assertInAngularZone(): void;
  9140. /**
  9141. Assures that the method is called outside of the Angular Zone, otherwise throws an error.
  9142. */
  9143. static assertNotInAngularZone(): void;
  9144. /**
  9145. * Executes the `fn` function synchronously within the Angular zone and returns value returned by
  9146. * the function.
  9147. *
  9148. * Running functions via `run` allows you to reenter Angular zone from a task that was executed
  9149. * outside of the Angular zone (typically started via {@link #runOutsideAngular}).
  9150. *
  9151. * Any future tasks or microtasks scheduled from within this function will continue executing from
  9152. * within the Angular zone.
  9153. *
  9154. * If a synchronous error happens it will be rethrown and not reported via `onError`.
  9155. */
  9156. run<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T;
  9157. /**
  9158. * Executes the `fn` function synchronously within the Angular zone as a task and returns value
  9159. * returned by the function.
  9160. *
  9161. * Running functions via `runTask` allows you to reenter Angular zone from a task that was executed
  9162. * outside of the Angular zone (typically started via {@link #runOutsideAngular}).
  9163. *
  9164. * Any future tasks or microtasks scheduled from within this function will continue executing from
  9165. * within the Angular zone.
  9166. *
  9167. * If a synchronous error happens it will be rethrown and not reported via `onError`.
  9168. */
  9169. runTask<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[], name?: string): T;
  9170. /**
  9171. * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not
  9172. * rethrown.
  9173. */
  9174. runGuarded<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T;
  9175. /**
  9176. * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by
  9177. * the function.
  9178. *
  9179. * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do
  9180. * work that
  9181. * doesn't trigger Angular change-detection or is subject to Angular's error handling.
  9182. *
  9183. * Any future tasks or microtasks scheduled from within this function will continue executing from
  9184. * outside of the Angular zone.
  9185. *
  9186. * Use {@link #run} to reenter the Angular zone and do work that updates the application model.
  9187. */
  9188. runOutsideAngular<T>(fn: (...args: any[]) => T): T;
  9189. }
  9190. /**
  9191. * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls
  9192. * to framework to perform rendering.
  9193. */
  9194. declare class NoopNgZone implements NgZone {
  9195. readonly hasPendingMicrotasks = false;
  9196. readonly hasPendingMacrotasks = false;
  9197. readonly isStable = true;
  9198. readonly onUnstable: EventEmitter<any>;
  9199. readonly onMicrotaskEmpty: EventEmitter<any>;
  9200. readonly onStable: EventEmitter<any>;
  9201. readonly onError: EventEmitter<any>;
  9202. run<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any): T;
  9203. runGuarded<T>(fn: (...args: any[]) => any, applyThis?: any, applyArgs?: any): T;
  9204. runOutsideAngular<T>(fn: (...args: any[]) => T): T;
  9205. runTask<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any, name?: string): T;
  9206. }
  9207. interface NgModuleType<T = any> extends Type$1<T> {
  9208. ɵmod: NgModuleDef<T>;
  9209. }
  9210. /**
  9211. * Represents the expansion of an `NgModule` into its scopes.
  9212. *
  9213. * A scope is a set of directives and pipes that are visible in a particular context. Each
  9214. * `NgModule` has two scopes. The `compilation` scope is the set of directives and pipes that will
  9215. * be recognized in the templates of components declared by the module. The `exported` scope is the
  9216. * set of directives and pipes exported by a module (that is, module B's exported scope gets added
  9217. * to module A's compilation scope when module A imports B).
  9218. */
  9219. interface NgModuleTransitiveScopes {
  9220. compilation: {
  9221. directives: Set<any>;
  9222. pipes: Set<any>;
  9223. };
  9224. exported: {
  9225. directives: Set<any>;
  9226. pipes: Set<any>;
  9227. };
  9228. schemas: SchemaMetadata[] | null;
  9229. }
  9230. /**
  9231. * Runtime link information for NgModules.
  9232. *
  9233. * This is the internal data structure used by the runtime to assemble components, directives,
  9234. * pipes, and injectors.
  9235. *
  9236. * NOTE: Always use `ɵɵdefineNgModule` function to create this object,
  9237. * never create the object directly since the shape of this object
  9238. * can change between versions.
  9239. */
  9240. interface NgModuleDef<T> {
  9241. /** Token representing the module. Used by DI. */
  9242. type: T;
  9243. /**
  9244. * List of components to bootstrap.
  9245. *
  9246. * @see {NgModuleScopeInfoFromDecorator} This field is only used in global compilation mode. In local compilation mode the bootstrap info is computed and added in runtime.
  9247. */
  9248. bootstrap: Type$1<any>[] | (() => Type$1<any>[]);
  9249. /** List of components, directives, and pipes declared by this module. */
  9250. declarations: Type$1<any>[] | (() => Type$1<any>[]);
  9251. /** List of modules or `ModuleWithProviders` imported by this module. */
  9252. imports: Type$1<any>[] | (() => Type$1<any>[]);
  9253. /**
  9254. * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this
  9255. * module.
  9256. */
  9257. exports: Type$1<any>[] | (() => Type$1<any>[]);
  9258. /**
  9259. * Cached value of computed `transitiveCompileScopes` for this module.
  9260. *
  9261. * This should never be read directly, but accessed via `transitiveScopesFor`.
  9262. */
  9263. transitiveCompileScopes: NgModuleTransitiveScopes | null;
  9264. /** The set of schemas that declare elements to be allowed in the NgModule. */
  9265. schemas: SchemaMetadata[] | null;
  9266. /** Unique ID for the module with which it should be registered. */
  9267. id: string | null;
  9268. }
  9269. /**
  9270. * Map of inputs for a given directive/component.
  9271. *
  9272. * Given:
  9273. * ```ts
  9274. * class MyComponent {
  9275. * @Input()
  9276. * publicInput1: string;
  9277. *
  9278. * @Input('publicInput2')
  9279. * declaredInput2: string;
  9280. *
  9281. * @Input({transform: (value: boolean) => value ? 1 : 0})
  9282. * transformedInput3: number;
  9283. *
  9284. * signalInput = input(3);
  9285. * }
  9286. * ```
  9287. *
  9288. * is described as:
  9289. * ```ts
  9290. * {
  9291. * publicInput1: 'publicInput1',
  9292. * declaredInput2: [InputFlags.None, 'declaredInput2', 'publicInput2'],
  9293. * transformedInput3: [
  9294. * InputFlags.None,
  9295. * 'transformedInput3',
  9296. * 'transformedInput3',
  9297. * (value: boolean) => value ? 1 : 0
  9298. * ],
  9299. * signalInput: [InputFlags.SignalBased, "signalInput"],
  9300. * }
  9301. * ```
  9302. *
  9303. * Which the minifier may translate to:
  9304. * ```ts
  9305. * {
  9306. * minifiedPublicInput1: 'publicInput1',
  9307. * minifiedDeclaredInput2: [InputFlags.None, 'publicInput2', 'declaredInput2'],
  9308. * minifiedTransformedInput3: [
  9309. * InputFlags.None,
  9310. * 'transformedInput3',
  9311. * 'transformedInput3',
  9312. * (value: boolean) => value ? 1 : 0
  9313. * ],
  9314. * minifiedSignalInput: [InputFlags.SignalBased, "signalInput"],
  9315. * }
  9316. * ```
  9317. *
  9318. * This allows the render to re-construct the minified, public, and declared names
  9319. * of properties.
  9320. *
  9321. * NOTE:
  9322. * - Because declared and public name are usually same we only generate the array
  9323. * `['declared', 'public']` format when they differ, or there is a transform.
  9324. * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has
  9325. * inconsistent behavior in that it uses declared names rather than minified or public.
  9326. */
  9327. type DirectiveInputs<T> = {
  9328. [P in keyof T]?: string | [
  9329. flags: InputFlags,
  9330. publicName: string,
  9331. declaredName?: string,
  9332. transform?: InputTransformFunction
  9333. ];
  9334. };
  9335. interface DirectiveDefinition<T> {
  9336. /**
  9337. * Directive type, needed to configure the injector.
  9338. */
  9339. type: Type$1<T>;
  9340. /** The selectors that will be used to match nodes to this directive. */
  9341. selectors?: CssSelectorList;
  9342. /**
  9343. * A map of input names.
  9344. */
  9345. inputs?: DirectiveInputs<T>;
  9346. /**
  9347. * A map of output names.
  9348. *
  9349. * The format is in: `{[actualPropertyName: string]:string}`.
  9350. *
  9351. * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.
  9352. *
  9353. * This allows the render to re-construct the minified and non-minified names
  9354. * of properties.
  9355. */
  9356. outputs?: {
  9357. [P in keyof T]?: string;
  9358. };
  9359. /**
  9360. * A list of optional features to apply.
  9361. *
  9362. * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}, {@link InheritDefinitionFeature}
  9363. */
  9364. features?: DirectiveDefFeature[];
  9365. /**
  9366. * Function executed by the parent template to allow child directive to apply host bindings.
  9367. */
  9368. hostBindings?: HostBindingsFunction<T>;
  9369. /**
  9370. * The number of bindings in this directive `hostBindings` (including pure fn bindings).
  9371. *
  9372. * Used to calculate the length of the component's LView array, so we
  9373. * can pre-fill the array and set the host binding start index.
  9374. */
  9375. hostVars?: number;
  9376. /**
  9377. * Assign static attribute values to a host element.
  9378. *
  9379. * This property will assign static attribute values as well as class and style
  9380. * values to a host element. Since attribute values can consist of different types of values,
  9381. * the `hostAttrs` array must include the values in the following format:
  9382. *
  9383. * attrs = [
  9384. * // static attributes (like `title`, `name`, `id`...)
  9385. * attr1, value1, attr2, value,
  9386. *
  9387. * // a single namespace value (like `x:id`)
  9388. * NAMESPACE_MARKER, namespaceUri1, name1, value1,
  9389. *
  9390. * // another single namespace value (like `x:name`)
  9391. * NAMESPACE_MARKER, namespaceUri2, name2, value2,
  9392. *
  9393. * // a series of CSS classes that will be applied to the element (no spaces)
  9394. * CLASSES_MARKER, class1, class2, class3,
  9395. *
  9396. * // a series of CSS styles (property + value) that will be applied to the element
  9397. * STYLES_MARKER, prop1, value1, prop2, value2
  9398. * ]
  9399. *
  9400. * All non-class and non-style attributes must be defined at the start of the list
  9401. * first before all class and style values are set. When there is a change in value
  9402. * type (like when classes and styles are introduced) a marker must be used to separate
  9403. * the entries. The marker values themselves are set via entries found in the
  9404. * [AttributeMarker] enum.
  9405. */
  9406. hostAttrs?: TAttributes;
  9407. /**
  9408. * Function to create instances of content queries associated with a given directive.
  9409. */
  9410. contentQueries?: ContentQueriesFunction<T>;
  9411. /**
  9412. * Additional set of instructions specific to view query processing. This could be seen as a
  9413. * set of instructions to be inserted into the template function.
  9414. */
  9415. viewQuery?: ViewQueriesFunction<T> | null;
  9416. /**
  9417. * Defines the name that can be used in the template to assign this directive to a variable.
  9418. *
  9419. * See: {@link Directive.exportAs}
  9420. */
  9421. exportAs?: string[];
  9422. /**
  9423. * Whether this directive/component is standalone.
  9424. */
  9425. standalone?: boolean;
  9426. /**
  9427. * Whether this directive/component is signal-based.
  9428. */
  9429. signals?: boolean;
  9430. }
  9431. interface ComponentDefinition<T> extends Omit<DirectiveDefinition<T>, 'features'> {
  9432. /**
  9433. * The number of nodes, local refs, and pipes in this component template.
  9434. *
  9435. * Used to calculate the length of this component's LView array, so we
  9436. * can pre-fill the array and set the binding start index.
  9437. */
  9438. decls: number;
  9439. /**
  9440. * The number of bindings in this component template (including pure fn bindings).
  9441. *
  9442. * Used to calculate the length of this component's LView array, so we
  9443. * can pre-fill the array and set the host binding start index.
  9444. */
  9445. vars: number;
  9446. /**
  9447. * Template function use for rendering DOM.
  9448. *
  9449. * This function has following structure.
  9450. *
  9451. * ```ts
  9452. * function Template<T>(ctx:T, creationMode: boolean) {
  9453. * if (creationMode) {
  9454. * // Contains creation mode instructions.
  9455. * }
  9456. * // Contains binding update instructions
  9457. * }
  9458. * ```
  9459. *
  9460. * Common instructions are:
  9461. * Creation mode instructions:
  9462. * - `elementStart`, `elementEnd`
  9463. * - `text`
  9464. * - `container`
  9465. * - `listener`
  9466. *
  9467. * Binding update instructions:
  9468. * - `bind`
  9469. * - `elementAttribute`
  9470. * - `elementProperty`
  9471. * - `elementClass`
  9472. * - `elementStyle`
  9473. *
  9474. */
  9475. template: ComponentTemplate<T>;
  9476. /**
  9477. * Constants for the nodes in the component's view.
  9478. * Includes attribute arrays, local definition arrays etc.
  9479. */
  9480. consts?: TConstantsOrFactory;
  9481. /**
  9482. * An array of `ngContent[selector]` values that were found in the template.
  9483. */
  9484. ngContentSelectors?: string[];
  9485. /**
  9486. * A list of optional features to apply.
  9487. *
  9488. * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}
  9489. */
  9490. features?: ComponentDefFeature[];
  9491. /**
  9492. * Defines template and style encapsulation options available for Component's {@link /api/core/Component Component}.
  9493. */
  9494. encapsulation?: ViewEncapsulation$1;
  9495. /**
  9496. * Defines arbitrary developer-defined data to be stored on a renderer instance.
  9497. * This is useful for renderers that delegate to other renderers.
  9498. *
  9499. * see: animation
  9500. */
  9501. data?: {
  9502. [kind: string]: any;
  9503. };
  9504. /**
  9505. * A set of styles that the component needs to be present for component to render correctly.
  9506. */
  9507. styles?: string[];
  9508. /**
  9509. * The strategy that the default change detector uses to detect changes.
  9510. * When set, takes effect the next time change detection is triggered.
  9511. */
  9512. changeDetection?: ChangeDetectionStrategy$1;
  9513. /**
  9514. * Registry of directives, components, and pipes that may be found in this component's view.
  9515. *
  9516. * This property is either an array of types or a function that returns the array of types. This
  9517. * function may be necessary to support forward declarations.
  9518. */
  9519. dependencies?: TypeOrFactory<DependencyTypeList>;
  9520. /**
  9521. * The set of schemas that declare elements to be allowed in the component's template.
  9522. */
  9523. schemas?: SchemaMetadata[] | null;
  9524. }
  9525. /**
  9526. * Create a component definition object.
  9527. *
  9528. *
  9529. * # Example
  9530. * ```ts
  9531. * class MyComponent {
  9532. * // Generated by Angular Template Compiler
  9533. * // [Symbol] syntax will not be supported by TypeScript until v2.7
  9534. * static ɵcmp = defineComponent({
  9535. * ...
  9536. * });
  9537. * }
  9538. * ```
  9539. * @codeGenApi
  9540. */
  9541. declare function ɵɵdefineComponent<T>(componentDefinition: ComponentDefinition<T>): ComponentDef<any>;
  9542. /**
  9543. * @codeGenApi
  9544. */
  9545. declare function ɵɵdefineNgModule<T>(def: {
  9546. /** Token representing the module. Used by DI. */
  9547. type: T;
  9548. /** List of components to bootstrap. */
  9549. bootstrap?: Type$1<any>[] | (() => Type$1<any>[]);
  9550. /** List of components, directives, and pipes declared by this module. */
  9551. declarations?: Type$1<any>[] | (() => Type$1<any>[]);
  9552. /** List of modules or `ModuleWithProviders` imported by this module. */
  9553. imports?: Type$1<any>[] | (() => Type$1<any>[]);
  9554. /**
  9555. * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this
  9556. * module.
  9557. */
  9558. exports?: Type$1<any>[] | (() => Type$1<any>[]);
  9559. /** The set of schemas that declare elements to be allowed in the NgModule. */
  9560. schemas?: SchemaMetadata[] | null;
  9561. /** Unique ID for the module that is used with `getModuleFactory`. */
  9562. id?: string | null;
  9563. }): unknown;
  9564. /**
  9565. * Create a directive definition object.
  9566. *
  9567. * # Example
  9568. * ```ts
  9569. * class MyDirective {
  9570. * // Generated by Angular Template Compiler
  9571. * // [Symbol] syntax will not be supported by TypeScript until v2.7
  9572. * static ɵdir = ɵɵdefineDirective({
  9573. * ...
  9574. * });
  9575. * }
  9576. * ```
  9577. *
  9578. * @codeGenApi
  9579. */
  9580. declare function ɵɵdefineDirective<T>(directiveDefinition: DirectiveDefinition<T>): DirectiveDef<any>;
  9581. /**
  9582. * Create a pipe definition object.
  9583. *
  9584. * # Example
  9585. * ```ts
  9586. * class MyPipe implements PipeTransform {
  9587. * // Generated by Angular Template Compiler
  9588. * static ɵpipe = definePipe({
  9589. * ...
  9590. * });
  9591. * }
  9592. * ```
  9593. * @param pipeDef Pipe definition generated by the compiler
  9594. *
  9595. * @codeGenApi
  9596. */
  9597. declare function ɵɵdefinePipe<T>(pipeDef: {
  9598. /** Name of the pipe. Used for matching pipes in template to pipe defs. */
  9599. name: string;
  9600. /** Pipe class reference. Needed to extract pipe lifecycle hooks. */
  9601. type: Type$1<T>;
  9602. /** Whether the pipe is pure. */
  9603. pure?: boolean;
  9604. /**
  9605. * Whether the pipe is standalone.
  9606. */
  9607. standalone?: boolean;
  9608. }): unknown;
  9609. /**
  9610. * @publicApi
  9611. */
  9612. type ɵɵDirectiveDeclaration<T, Selector extends string, ExportAs extends string[], InputMap extends {
  9613. [key: string]: string | {
  9614. alias: string | null;
  9615. required: boolean;
  9616. isSignal?: boolean;
  9617. };
  9618. }, OutputMap extends {
  9619. [key: string]: string;
  9620. }, QueryFields extends string[], NgContentSelectors extends never = never, IsStandalone extends boolean = false, HostDirectives = never, IsSignal extends boolean = false> = unknown;
  9621. /**
  9622. * @publicApi
  9623. */
  9624. type ɵɵComponentDeclaration<T, Selector extends String, ExportAs extends string[], InputMap extends {
  9625. [key: string]: string | {
  9626. alias: string | null;
  9627. required: boolean;
  9628. };
  9629. }, OutputMap extends {
  9630. [key: string]: string;
  9631. }, QueryFields extends string[], NgContentSelectors extends string[], IsStandalone extends boolean = false, HostDirectives = never, IsSignal extends boolean = false> = unknown;
  9632. /**
  9633. * @publicApi
  9634. */
  9635. type ɵɵNgModuleDeclaration<T, Declarations, Imports, Exports> = unknown;
  9636. /**
  9637. * @publicApi
  9638. */
  9639. type ɵɵPipeDeclaration<T, Name extends string, IsStandalone extends boolean = false> = unknown;
  9640. /**
  9641. * @publicApi
  9642. */
  9643. type ɵɵInjectorDeclaration<T> = unknown;
  9644. /**
  9645. * @publicApi
  9646. */
  9647. type ɵɵFactoryDeclaration<T, CtorDependencies extends CtorDependency[]> = unknown;
  9648. /**
  9649. * An object literal of this type is used to represent the metadata of a constructor dependency.
  9650. * The type itself is never referred to from generated code.
  9651. *
  9652. * @publicApi
  9653. */
  9654. type CtorDependency = {
  9655. /**
  9656. * If an `@Attribute` decorator is used, this represents the injected attribute's name. If the
  9657. * attribute name is a dynamic expression instead of a string literal, this will be the unknown
  9658. * type.
  9659. */
  9660. attribute?: string | unknown;
  9661. /**
  9662. * If `@Optional()` is used, this key is set to true.
  9663. */
  9664. optional?: true;
  9665. /**
  9666. * If `@Host` is used, this key is set to true.
  9667. */
  9668. host?: true;
  9669. /**
  9670. * If `@Self` is used, this key is set to true.
  9671. */
  9672. self?: true;
  9673. /**
  9674. * If `@SkipSelf` is used, this key is set to true.
  9675. */
  9676. skipSelf?: true;
  9677. } | null;
  9678. /**
  9679. * If a given component has unresolved async metadata - returns a reference
  9680. * to a function that applies component metadata after resolving defer-loadable
  9681. * dependencies. Otherwise - this function returns `null`.
  9682. */
  9683. declare function getAsyncClassMetadataFn(type: Type$1<unknown>): (() => Promise<Array<Type$1<unknown>>>) | null;
  9684. /**
  9685. * Handles the process of applying metadata info to a component class in case
  9686. * component template has defer blocks (thus some dependencies became deferrable).
  9687. *
  9688. * @param type Component class where metadata should be added
  9689. * @param dependencyLoaderFn Function that loads dependencies
  9690. * @param metadataSetterFn Function that forms a scope in which the `setClassMetadata` is invoked
  9691. */
  9692. declare function setClassMetadataAsync(type: Type$1<any>, dependencyLoaderFn: () => Array<Promise<Type$1<unknown>>>, metadataSetterFn: (...types: Type$1<unknown>[]) => void): () => Promise<Array<Type$1<unknown>>>;
  9693. /**
  9694. * Adds decorator, constructor, and property metadata to a given type via static metadata fields
  9695. * on the type.
  9696. *
  9697. * These metadata fields can later be read with Angular's `ReflectionCapabilities` API.
  9698. *
  9699. * Calls to `setClassMetadata` can be guarded by ngDevMode, resulting in the metadata assignments
  9700. * being tree-shaken away during production builds.
  9701. */
  9702. declare function setClassMetadata(type: Type$1<any>, decorators: any[] | null, ctorParameters: (() => any[]) | null, propDecorators: {
  9703. [field: string]: any;
  9704. } | null): void;
  9705. interface ChangeDetectorRefInterface extends ChangeDetectorRef {
  9706. }
  9707. declare class ViewRef<T> implements EmbeddedViewRef<T>, ChangeDetectorRefInterface {
  9708. /**
  9709. * This represents the `LView` associated with the point where `ChangeDetectorRef` was
  9710. * requested.
  9711. *
  9712. * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.
  9713. */
  9714. private _cdRefInjectingView?;
  9715. readonly notifyErrorHandler: boolean;
  9716. private _appRef;
  9717. private _attachedToViewContainer;
  9718. get rootNodes(): any[];
  9719. constructor(
  9720. /**
  9721. * This represents `LView` associated with the component when ViewRef is a ChangeDetectorRef.
  9722. *
  9723. * When ViewRef is created for a dynamic component, this also represents the `LView` for the
  9724. * component.
  9725. *
  9726. * For a "regular" ViewRef created for an embedded view, this is the `LView` for the embedded
  9727. * view.
  9728. *
  9729. * @internal
  9730. */
  9731. _lView: LView,
  9732. /**
  9733. * This represents the `LView` associated with the point where `ChangeDetectorRef` was
  9734. * requested.
  9735. *
  9736. * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.
  9737. */
  9738. _cdRefInjectingView?: LView | undefined, notifyErrorHandler?: boolean);
  9739. get context(): T;
  9740. /**
  9741. * @deprecated Replacing the full context object is not supported. Modify the context
  9742. * directly, or consider using a `Proxy` if you need to replace the full object.
  9743. * // TODO(devversion): Remove this.
  9744. */
  9745. set context(value: T);
  9746. get destroyed(): boolean;
  9747. destroy(): void;
  9748. onDestroy(callback: Function): void;
  9749. /**
  9750. * Marks a view and all of its ancestors dirty.
  9751. *
  9752. * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush} component is
  9753. * checked when it needs to be re-rendered but the two normal triggers haven't marked it
  9754. * dirty (i.e. inputs haven't changed and events haven't fired in the view).
  9755. *
  9756. * <!-- TODO: Add a link to a chapter on OnPush components -->
  9757. *
  9758. * @usageNotes
  9759. * ### Example
  9760. *
  9761. * ```ts
  9762. * @Component({
  9763. * selector: 'app-root',
  9764. * template: `Number of ticks: {{numberOfTicks}}`
  9765. * changeDetection: ChangeDetectionStrategy.OnPush,
  9766. * })
  9767. * class AppComponent {
  9768. * numberOfTicks = 0;
  9769. *
  9770. * constructor(private ref: ChangeDetectorRef) {
  9771. * setInterval(() => {
  9772. * this.numberOfTicks++;
  9773. * // the following is required, otherwise the view will not be updated
  9774. * this.ref.markForCheck();
  9775. * }, 1000);
  9776. * }
  9777. * }
  9778. * ```
  9779. */
  9780. markForCheck(): void;
  9781. /**
  9782. * Detaches the view from the change detection tree.
  9783. *
  9784. * Detached views will not be checked during change detection runs until they are
  9785. * re-attached, even if they are dirty. `detach` can be used in combination with
  9786. * {@link ChangeDetectorRef#detectChanges} to implement local change
  9787. * detection checks.
  9788. *
  9789. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  9790. * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
  9791. *
  9792. * @usageNotes
  9793. * ### Example
  9794. *
  9795. * The following example defines a component with a large list of readonly data.
  9796. * Imagine the data changes constantly, many times per second. For performance reasons,
  9797. * we want to check and update the list every five seconds. We can do that by detaching
  9798. * the component's change detector and doing a local check every five seconds.
  9799. *
  9800. * ```ts
  9801. * class DataProvider {
  9802. * // in a real application the returned data will be different every time
  9803. * get data() {
  9804. * return [1,2,3,4,5];
  9805. * }
  9806. * }
  9807. *
  9808. * @Component({
  9809. * selector: 'giant-list',
  9810. * template: `
  9811. * <li *ngFor="let d of dataProvider.data">Data {{d}}</li>
  9812. * `,
  9813. * })
  9814. * class GiantList {
  9815. * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {
  9816. * ref.detach();
  9817. * setInterval(() => {
  9818. * this.ref.detectChanges();
  9819. * }, 5000);
  9820. * }
  9821. * }
  9822. *
  9823. * @Component({
  9824. * selector: 'app',
  9825. * providers: [DataProvider],
  9826. * template: `
  9827. * <giant-list><giant-list>
  9828. * `,
  9829. * })
  9830. * class App {
  9831. * }
  9832. * ```
  9833. */
  9834. detach(): void;
  9835. /**
  9836. * Re-attaches a view to the change detection tree.
  9837. *
  9838. * This can be used to re-attach views that were previously detached from the tree
  9839. * using {@link ChangeDetectorRef#detach}. Views are attached to the tree by default.
  9840. *
  9841. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  9842. *
  9843. * @usageNotes
  9844. * ### Example
  9845. *
  9846. * The following example creates a component displaying `live` data. The component will detach
  9847. * its change detector from the main change detector tree when the component's live property
  9848. * is set to false.
  9849. *
  9850. * ```ts
  9851. * class DataProvider {
  9852. * data = 1;
  9853. *
  9854. * constructor() {
  9855. * setInterval(() => {
  9856. * this.data = this.data * 2;
  9857. * }, 500);
  9858. * }
  9859. * }
  9860. *
  9861. * @Component({
  9862. * selector: 'live-data',
  9863. * inputs: ['live'],
  9864. * template: 'Data: {{dataProvider.data}}'
  9865. * })
  9866. * class LiveData {
  9867. * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}
  9868. *
  9869. * set live(value) {
  9870. * if (value) {
  9871. * this.ref.reattach();
  9872. * } else {
  9873. * this.ref.detach();
  9874. * }
  9875. * }
  9876. * }
  9877. *
  9878. * @Component({
  9879. * selector: 'app-root',
  9880. * providers: [DataProvider],
  9881. * template: `
  9882. * Live Update: <input type="checkbox" [(ngModel)]="live">
  9883. * <live-data [live]="live"><live-data>
  9884. * `,
  9885. * })
  9886. * class AppComponent {
  9887. * live = true;
  9888. * }
  9889. * ```
  9890. */
  9891. reattach(): void;
  9892. /**
  9893. * Checks the view and its children.
  9894. *
  9895. * This can also be used in combination with {@link ChangeDetectorRef#detach} to implement
  9896. * local change detection checks.
  9897. *
  9898. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  9899. * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
  9900. *
  9901. * @usageNotes
  9902. * ### Example
  9903. *
  9904. * The following example defines a component with a large list of readonly data.
  9905. * Imagine, the data changes constantly, many times per second. For performance reasons,
  9906. * we want to check and update the list every five seconds.
  9907. *
  9908. * We can do that by detaching the component's change detector and doing a local change detection
  9909. * check every five seconds.
  9910. *
  9911. * See {@link ChangeDetectorRef#detach} for more information.
  9912. */
  9913. detectChanges(): void;
  9914. /**
  9915. * Checks the change detector and its children, and throws if any changes are detected.
  9916. *
  9917. * This is used in development mode to verify that running change detection doesn't
  9918. * introduce other changes.
  9919. */
  9920. checkNoChanges(): void;
  9921. attachToViewContainerRef(): void;
  9922. detachFromAppRef(): void;
  9923. attachToAppRef(appRef: ApplicationRef): void;
  9924. }
  9925. /**
  9926. * Reports whether the given view is considered dirty according to the different marking mechanisms.
  9927. */
  9928. declare function isViewDirty(view: ViewRef<unknown>): boolean;
  9929. declare function markForRefresh(view: ViewRef<unknown>): void;
  9930. declare class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
  9931. private ngModule?;
  9932. /**
  9933. * @param ngModule The NgModuleRef to which all resolved factories are bound.
  9934. */
  9935. constructor(ngModule?: NgModuleRef$1<any> | undefined);
  9936. resolveComponentFactory<T>(component: Type$1<T>): ComponentFactory$1<T>;
  9937. }
  9938. /**
  9939. * ComponentFactory interface implementation.
  9940. */
  9941. declare class ComponentFactory<T> extends ComponentFactory$1<T> {
  9942. private componentDef;
  9943. private ngModule?;
  9944. selector: string;
  9945. componentType: Type$1<any>;
  9946. ngContentSelectors: string[];
  9947. isBoundToModule: boolean;
  9948. private cachedInputs;
  9949. private cachedOutputs;
  9950. get inputs(): {
  9951. propName: string;
  9952. templateName: string;
  9953. isSignal: boolean;
  9954. transform?: (value: any) => any;
  9955. }[];
  9956. get outputs(): {
  9957. propName: string;
  9958. templateName: string;
  9959. }[];
  9960. /**
  9961. * @param componentDef The component definition.
  9962. * @param ngModule The NgModuleRef to which the factory is bound.
  9963. */
  9964. constructor(componentDef: ComponentDef<any>, ngModule?: NgModuleRef$1<any> | undefined);
  9965. create(injector: Injector, projectableNodes?: any[][] | undefined, rootSelectorOrNode?: any, environmentInjector?: NgModuleRef$1<any> | EnvironmentInjector | undefined): ComponentRef$1<T>;
  9966. }
  9967. /**
  9968. * Represents an instance of a Component created via a {@link ComponentFactory}.
  9969. *
  9970. * `ComponentRef` provides access to the Component Instance as well other objects related to this
  9971. * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
  9972. * method.
  9973. *
  9974. */
  9975. declare class ComponentRef<T> extends ComponentRef$1<T> {
  9976. private _rootLView;
  9977. instance: T;
  9978. hostView: ViewRef<T>;
  9979. changeDetectorRef: ChangeDetectorRef;
  9980. componentType: Type$1<T>;
  9981. location: ElementRef;
  9982. private previousInputValues;
  9983. private _tNode;
  9984. constructor(componentType: Type$1<T>, _rootLView: LView);
  9985. setInput(name: string, value: unknown): void;
  9986. get injector(): Injector;
  9987. destroy(): void;
  9988. onDestroy(callback: () => void): void;
  9989. }
  9990. /**
  9991. * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
  9992. *
  9993. * @param ngModule NgModule class.
  9994. * @param parentInjector Optional injector instance to use as a parent for the module injector. If
  9995. * not provided, `NullInjector` will be used instead.
  9996. * @returns NgModuleRef that represents an NgModule instance.
  9997. *
  9998. * @publicApi
  9999. */
  10000. declare function createNgModule<T>(ngModule: Type$1<T>, parentInjector?: Injector): NgModuleRef$1<T>;
  10001. /**
  10002. * The `createNgModule` function alias for backwards-compatibility.
  10003. * Please avoid using it directly and use `createNgModule` instead.
  10004. *
  10005. * @deprecated Use `createNgModule` instead.
  10006. */
  10007. declare const createNgModuleRef: typeof createNgModule;
  10008. declare class NgModuleRef<T> extends NgModuleRef$1<T> implements InternalNgModuleRef<T> {
  10009. private readonly ngModuleType;
  10010. _parent: Injector | null;
  10011. _bootstrapComponents: Type$1<any>[];
  10012. private readonly _r3Injector;
  10013. instance: T;
  10014. destroyCbs: (() => void)[] | null;
  10015. readonly componentFactoryResolver: ComponentFactoryResolver;
  10016. constructor(ngModuleType: Type$1<T>, _parent: Injector | null, additionalProviders: StaticProvider[], runInjectorInitializers?: boolean);
  10017. resolveInjectorInitializers(): void;
  10018. get injector(): EnvironmentInjector;
  10019. destroy(): void;
  10020. onDestroy(callback: () => void): void;
  10021. }
  10022. declare class NgModuleFactory<T> extends NgModuleFactory$1<T> {
  10023. moduleType: Type$1<T>;
  10024. constructor(moduleType: Type$1<T>);
  10025. create(parentInjector: Injector | null): NgModuleRef$1<T>;
  10026. }
  10027. /**
  10028. * Create a new environment injector.
  10029. *
  10030. * @param providers An array of providers.
  10031. * @param parent A parent environment injector.
  10032. * @param debugName An optional name for this injector instance, which will be used in error
  10033. * messages.
  10034. *
  10035. * @publicApi
  10036. */
  10037. declare function createEnvironmentInjector(providers: Array<Provider | EnvironmentProviders>, parent: EnvironmentInjector, debugName?: string | null): EnvironmentInjector;
  10038. /**
  10039. * Convince closure compiler that the wrapped function has no side-effects.
  10040. *
  10041. * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to
  10042. * allow us to execute a function but have closure compiler mark the call as no-side-effects.
  10043. * It is important that the return value for the `noSideEffects` function be assigned
  10044. * to something which is retained otherwise the call to `noSideEffects` will be removed by closure
  10045. * compiler.
  10046. */
  10047. declare function noSideEffects<T>(fn: () => T): T;
  10048. /**
  10049. * A DI token that provides a set of callbacks to
  10050. * be called for every component that is bootstrapped.
  10051. *
  10052. * Each callback must take a `ComponentRef` instance and return nothing.
  10053. *
  10054. * `(componentRef: ComponentRef) => void`
  10055. *
  10056. * @publicApi
  10057. */
  10058. declare const APP_BOOTSTRAP_LISTENER: InjectionToken<readonly ((compRef: ComponentRef$1<any>) => void)[]>;
  10059. declare function isBoundToModule<C>(cf: ComponentFactory$1<C>): boolean;
  10060. /**
  10061. * A token for third-party components that can register themselves with NgProbe.
  10062. *
  10063. * @deprecated
  10064. * @publicApi
  10065. */
  10066. declare class NgProbeToken {
  10067. name: string;
  10068. token: any;
  10069. constructor(name: string, token: any);
  10070. }
  10071. /**
  10072. * Provides additional options to the bootstrapping process.
  10073. *
  10074. * @publicApi
  10075. */
  10076. interface BootstrapOptions {
  10077. /**
  10078. * Optionally specify which `NgZone` should be used when not configured in the providers.
  10079. *
  10080. * - Provide your own `NgZone` instance.
  10081. * - `zone.js` - Use default `NgZone` which requires `Zone.js`.
  10082. * - `noop` - Use `NoopNgZone` which does nothing.
  10083. */
  10084. ngZone?: NgZone | 'zone.js' | 'noop';
  10085. /**
  10086. * Optionally specify coalescing event change detections or not.
  10087. * Consider the following case.
  10088. *
  10089. * ```html
  10090. * <div (click)="doSomething()">
  10091. * <button (click)="doSomethingElse()"></button>
  10092. * </div>
  10093. * ```
  10094. *
  10095. * When button is clicked, because of the event bubbling, both
  10096. * event handlers will be called and 2 change detections will be
  10097. * triggered. We can coalesce such kind of events to only trigger
  10098. * change detection only once.
  10099. *
  10100. * By default, this option will be false. So the events will not be
  10101. * coalesced and the change detection will be triggered multiple times.
  10102. * And if this option be set to true, the change detection will be
  10103. * triggered async by scheduling a animation frame. So in the case above,
  10104. * the change detection will only be triggered once.
  10105. */
  10106. ngZoneEventCoalescing?: boolean;
  10107. /**
  10108. * Optionally specify if `NgZone#run()` method invocations should be coalesced
  10109. * into a single change detection.
  10110. *
  10111. * Consider the following case.
  10112. * ```ts
  10113. * for (let i = 0; i < 10; i ++) {
  10114. * ngZone.run(() => {
  10115. * // do something
  10116. * });
  10117. * }
  10118. * ```
  10119. *
  10120. * This case triggers the change detection multiple times.
  10121. * With ngZoneRunCoalescing options, all change detections in an event loop trigger only once.
  10122. * In addition, the change detection executes in requestAnimation.
  10123. *
  10124. */
  10125. ngZoneRunCoalescing?: boolean;
  10126. /**
  10127. * When false, change detection is scheduled when Angular receives
  10128. * a clear indication that templates need to be refreshed. This includes:
  10129. *
  10130. * - calling `ChangeDetectorRef.markForCheck`
  10131. * - calling `ComponentRef.setInput`
  10132. * - updating a signal that is read in a template
  10133. * - attaching a view that is marked dirty
  10134. * - removing a view
  10135. * - registering a render hook (templates are only refreshed if render hooks do one of the above)
  10136. *
  10137. * @deprecated This option was introduced out of caution as a way for developers to opt out of the
  10138. * new behavior in v18 which schedule change detection for the above events when they occur
  10139. * outside the Zone. After monitoring the results post-release, we have determined that this
  10140. * feature is working as desired and do not believe it should ever be disabled by setting
  10141. * this option to `true`.
  10142. */
  10143. ignoreChangesOutsideZone?: boolean;
  10144. }
  10145. /**
  10146. * A reference to an Angular application running on a page.
  10147. *
  10148. * @usageNotes
  10149. * ### isStable examples and caveats
  10150. *
  10151. * Note two important points about `isStable`, demonstrated in the examples below:
  10152. * - the application will never be stable if you start any kind
  10153. * of recurrent asynchronous task when the application starts
  10154. * (for example for a polling process, started with a `setInterval`, a `setTimeout`
  10155. * or using RxJS operators like `interval`);
  10156. * - the `isStable` Observable runs outside of the Angular zone.
  10157. *
  10158. * Let's imagine that you start a recurrent task
  10159. * (here incrementing a counter, using RxJS `interval`),
  10160. * and at the same time subscribe to `isStable`.
  10161. *
  10162. * ```ts
  10163. * constructor(appRef: ApplicationRef) {
  10164. * appRef.isStable.pipe(
  10165. * filter(stable => stable)
  10166. * ).subscribe(() => console.log('App is stable now');
  10167. * interval(1000).subscribe(counter => console.log(counter));
  10168. * }
  10169. * ```
  10170. * In this example, `isStable` will never emit `true`,
  10171. * and the trace "App is stable now" will never get logged.
  10172. *
  10173. * If you want to execute something when the app is stable,
  10174. * you have to wait for the application to be stable
  10175. * before starting your polling process.
  10176. *
  10177. * ```ts
  10178. * constructor(appRef: ApplicationRef) {
  10179. * appRef.isStable.pipe(
  10180. * first(stable => stable),
  10181. * tap(stable => console.log('App is stable now')),
  10182. * switchMap(() => interval(1000))
  10183. * ).subscribe(counter => console.log(counter));
  10184. * }
  10185. * ```
  10186. * In this example, the trace "App is stable now" will be logged
  10187. * and then the counter starts incrementing every second.
  10188. *
  10189. * Note also that this Observable runs outside of the Angular zone,
  10190. * which means that the code in the subscription
  10191. * to this Observable will not trigger the change detection.
  10192. *
  10193. * Let's imagine that instead of logging the counter value,
  10194. * you update a field of your component
  10195. * and display it in its template.
  10196. *
  10197. * ```ts
  10198. * constructor(appRef: ApplicationRef) {
  10199. * appRef.isStable.pipe(
  10200. * first(stable => stable),
  10201. * switchMap(() => interval(1000))
  10202. * ).subscribe(counter => this.value = counter);
  10203. * }
  10204. * ```
  10205. * As the `isStable` Observable runs outside the zone,
  10206. * the `value` field will be updated properly,
  10207. * but the template will not be refreshed!
  10208. *
  10209. * You'll have to manually trigger the change detection to update the template.
  10210. *
  10211. * ```ts
  10212. * constructor(appRef: ApplicationRef, cd: ChangeDetectorRef) {
  10213. * appRef.isStable.pipe(
  10214. * first(stable => stable),
  10215. * switchMap(() => interval(1000))
  10216. * ).subscribe(counter => {
  10217. * this.value = counter;
  10218. * cd.detectChanges();
  10219. * });
  10220. * }
  10221. * ```
  10222. *
  10223. * Or make the subscription callback run inside the zone.
  10224. *
  10225. * ```ts
  10226. * constructor(appRef: ApplicationRef, zone: NgZone) {
  10227. * appRef.isStable.pipe(
  10228. * first(stable => stable),
  10229. * switchMap(() => interval(1000))
  10230. * ).subscribe(counter => zone.run(() => this.value = counter));
  10231. * }
  10232. * ```
  10233. *
  10234. * @publicApi
  10235. */
  10236. declare class ApplicationRef {
  10237. private _destroyed;
  10238. private _destroyListeners;
  10239. private readonly internalErrorHandler;
  10240. private readonly afterRenderManager;
  10241. private readonly zonelessEnabled;
  10242. private readonly rootEffectScheduler;
  10243. private externalTestViews;
  10244. /**
  10245. * Indicates whether this instance was destroyed.
  10246. */
  10247. get destroyed(): boolean;
  10248. /**
  10249. * Get a list of component types registered to this application.
  10250. * This list is populated even before the component is created.
  10251. */
  10252. readonly componentTypes: Type$1<any>[];
  10253. /**
  10254. * Get a list of components registered to this application.
  10255. */
  10256. readonly components: ComponentRef$1<any>[];
  10257. /**
  10258. * Returns an Observable that indicates when the application is stable or unstable.
  10259. */
  10260. readonly isStable: Observable<boolean>;
  10261. constructor();
  10262. /**
  10263. * @returns A promise that resolves when the application becomes stable
  10264. */
  10265. whenStable(): Promise<void>;
  10266. private readonly _injector;
  10267. private _rendererFactory;
  10268. /**
  10269. * The `EnvironmentInjector` used to create this application.
  10270. */
  10271. get injector(): EnvironmentInjector;
  10272. /**
  10273. * Bootstrap a component onto the element identified by its selector or, optionally, to a
  10274. * specified element.
  10275. *
  10276. * @usageNotes
  10277. * ### Bootstrap process
  10278. *
  10279. * When bootstrapping a component, Angular mounts it onto a target DOM element
  10280. * and kicks off automatic change detection. The target DOM element can be
  10281. * provided using the `rootSelectorOrNode` argument.
  10282. *
  10283. * If the target DOM element is not provided, Angular tries to find one on a page
  10284. * using the `selector` of the component that is being bootstrapped
  10285. * (first matched element is used).
  10286. *
  10287. * ### Example
  10288. *
  10289. * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,
  10290. * but it requires us to know the component while writing the application code.
  10291. *
  10292. * Imagine a situation where we have to wait for an API call to decide about the component to
  10293. * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to
  10294. * dynamically bootstrap a component.
  10295. *
  10296. * {@example core/ts/platform/platform.ts region='componentSelector'}
  10297. *
  10298. * Optionally, a component can be mounted onto a DOM element that does not match the
  10299. * selector of the bootstrapped component.
  10300. *
  10301. * In the following example, we are providing a CSS selector to match the target element.
  10302. *
  10303. * {@example core/ts/platform/platform.ts region='cssSelector'}
  10304. *
  10305. * While in this example, we are providing reference to a DOM node.
  10306. *
  10307. * {@example core/ts/platform/platform.ts region='domNode'}
  10308. */
  10309. bootstrap<C>(component: Type$1<C>, rootSelectorOrNode?: string | any): ComponentRef$1<C>;
  10310. /**
  10311. * Bootstrap a component onto the element identified by its selector or, optionally, to a
  10312. * specified element.
  10313. *
  10314. * @usageNotes
  10315. * ### Bootstrap process
  10316. *
  10317. * When bootstrapping a component, Angular mounts it onto a target DOM element
  10318. * and kicks off automatic change detection. The target DOM element can be
  10319. * provided using the `rootSelectorOrNode` argument.
  10320. *
  10321. * If the target DOM element is not provided, Angular tries to find one on a page
  10322. * using the `selector` of the component that is being bootstrapped
  10323. * (first matched element is used).
  10324. *
  10325. * ### Example
  10326. *
  10327. * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,
  10328. * but it requires us to know the component while writing the application code.
  10329. *
  10330. * Imagine a situation where we have to wait for an API call to decide about the component to
  10331. * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to
  10332. * dynamically bootstrap a component.
  10333. *
  10334. * {@example core/ts/platform/platform.ts region='componentSelector'}
  10335. *
  10336. * Optionally, a component can be mounted onto a DOM element that does not match the
  10337. * selector of the bootstrapped component.
  10338. *
  10339. * In the following example, we are providing a CSS selector to match the target element.
  10340. *
  10341. * {@example core/ts/platform/platform.ts region='cssSelector'}
  10342. *
  10343. * While in this example, we are providing reference to a DOM node.
  10344. *
  10345. * {@example core/ts/platform/platform.ts region='domNode'}
  10346. *
  10347. * @deprecated Passing Component factories as the `Application.bootstrap` function argument is
  10348. * deprecated. Pass Component Types instead.
  10349. */
  10350. bootstrap<C>(componentFactory: ComponentFactory$1<C>, rootSelectorOrNode?: string | any): ComponentRef$1<C>;
  10351. /**
  10352. * Invoke this method to explicitly process change detection and its side-effects.
  10353. *
  10354. * In development mode, `tick()` also performs a second change detection cycle to ensure that no
  10355. * further changes are detected. If additional changes are picked up during this second cycle,
  10356. * bindings in the app have side-effects that cannot be resolved in a single change detection
  10357. * pass.
  10358. * In this case, Angular throws an error, since an Angular application can only have one change
  10359. * detection pass during which all change detection must complete.
  10360. */
  10361. tick(): void;
  10362. private tickImpl;
  10363. /**
  10364. * Performs the core work of synchronizing the application state with the UI, resolving any
  10365. * pending dirtiness (potentially in a loop).
  10366. */
  10367. private synchronize;
  10368. /**
  10369. * Perform a single synchronization pass.
  10370. */
  10371. private synchronizeOnce;
  10372. /**
  10373. * Checks `allViews` for views which require refresh/traversal, and updates `dirtyFlags`
  10374. * accordingly, with two potential behaviors:
  10375. *
  10376. * 1. If any of our views require updating, then this adds the `ViewTreeTraversal` dirty flag.
  10377. * This _should_ be a no-op, since the scheduler should've added the flag at the same time the
  10378. * view was marked as needing updating.
  10379. *
  10380. * TODO(alxhub): figure out if this behavior is still needed for edge cases.
  10381. *
  10382. * 2. If none of our views require updating, then clear the view-related `dirtyFlag`s. This
  10383. * happens when the scheduler is notified of a view becoming dirty, but the view itself isn't
  10384. * reachable through traversal from our roots (e.g. it's detached from the CD tree).
  10385. */
  10386. private syncDirtyFlagsWithViews;
  10387. /**
  10388. * Attaches a view so that it will be dirty checked.
  10389. * The view will be automatically detached when it is destroyed.
  10390. * This will throw if the view is already attached to a ViewContainer.
  10391. */
  10392. attachView(viewRef: ViewRef$1): void;
  10393. /**
  10394. * Detaches a view from dirty checking again.
  10395. */
  10396. detachView(viewRef: ViewRef$1): void;
  10397. private _loadComponent;
  10398. /**
  10399. * Registers a listener to be called when an instance is destroyed.
  10400. *
  10401. * @param callback A callback function to add as a listener.
  10402. * @returns A function which unregisters a listener.
  10403. */
  10404. onDestroy(callback: () => void): VoidFunction;
  10405. /**
  10406. * Destroys an Angular application represented by this `ApplicationRef`. Calling this function
  10407. * will destroy the associated environment injectors as well as all the bootstrapped components
  10408. * with their views.
  10409. */
  10410. destroy(): void;
  10411. /**
  10412. * Returns the number of attached views.
  10413. */
  10414. get viewCount(): number;
  10415. static ɵfac: ɵɵFactoryDeclaration<ApplicationRef, never>;
  10416. static ɵprov: ɵɵInjectableDeclaration<ApplicationRef>;
  10417. }
  10418. declare function detectChangesInViewIfRequired(lView: LView, notifyErrorHandler: boolean, isFirstPass: boolean, zonelessEnabled: boolean): void;
  10419. /**
  10420. * @description
  10421. * Hook for manual bootstrapping of the application instead of using `bootstrap` array in @NgModule
  10422. * annotation. This hook is invoked only when the `bootstrap` array is empty or not provided.
  10423. *
  10424. * Reference to the current application is provided as a parameter.
  10425. *
  10426. * See ["Bootstrapping"](guide/ngmodules/bootstrapping).
  10427. *
  10428. * @usageNotes
  10429. * The example below uses `ApplicationRef.bootstrap()` to render the
  10430. * `AppComponent` on the page.
  10431. *
  10432. * ```ts
  10433. * class AppModule implements DoBootstrap {
  10434. * ngDoBootstrap(appRef: ApplicationRef) {
  10435. * appRef.bootstrap(AppComponent); // Or some other component
  10436. * }
  10437. * }
  10438. * ```
  10439. *
  10440. * @publicApi
  10441. */
  10442. interface DoBootstrap {
  10443. ngDoBootstrap(appRef: ApplicationRef): void;
  10444. }
  10445. /**
  10446. * Type of the NgModule decorator / constructor function.
  10447. *
  10448. * @publicApi
  10449. */
  10450. interface NgModuleDecorator {
  10451. /**
  10452. * Decorator that marks a class as an NgModule and supplies configuration metadata.
  10453. */
  10454. (obj?: NgModule): TypeDecorator;
  10455. new (obj?: NgModule): NgModule;
  10456. }
  10457. /**
  10458. * Type of the NgModule metadata.
  10459. *
  10460. * @publicApi
  10461. */
  10462. interface NgModule {
  10463. /**
  10464. * The set of injectable objects that are available in the injector
  10465. * of this module.
  10466. *
  10467. * @see [Dependency Injection guide](guide/di/dependency-injection
  10468. * @see [NgModule guide](guide/ngmodules/providers)
  10469. *
  10470. * @usageNotes
  10471. *
  10472. * Dependencies whose providers are listed here become available for injection
  10473. * into any component, directive, pipe or service that is a child of this injector.
  10474. * The NgModule used for bootstrapping uses the root injector, and can provide dependencies
  10475. * to any part of the app.
  10476. *
  10477. * A lazy-loaded module has its own injector, typically a child of the app root injector.
  10478. * Lazy-loaded services are scoped to the lazy-loaded module's injector.
  10479. * If a lazy-loaded module also provides the `UserService`, any component created
  10480. * within that module's context (such as by router navigation) gets the local instance
  10481. * of the service, not the instance in the root injector.
  10482. * Components in external modules continue to receive the instance provided by their injectors.
  10483. *
  10484. * ### Example
  10485. *
  10486. * The following example defines a class that is injected in
  10487. * the HelloWorld NgModule:
  10488. *
  10489. * ```ts
  10490. * class Greeter {
  10491. * greet(name:string) {
  10492. * return 'Hello ' + name + '!';
  10493. * }
  10494. * }
  10495. *
  10496. * @NgModule({
  10497. * providers: [
  10498. * Greeter
  10499. * ]
  10500. * })
  10501. * class HelloWorld {
  10502. * greeter:Greeter;
  10503. *
  10504. * constructor(greeter:Greeter) {
  10505. * this.greeter = greeter;
  10506. * }
  10507. * }
  10508. * ```
  10509. */
  10510. providers?: Array<Provider | EnvironmentProviders>;
  10511. /**
  10512. * The set of components, directives, and pipes (declarables
  10513. * that belong to this module.
  10514. *
  10515. * @usageNotes
  10516. *
  10517. * The set of selectors that are available to a template include those declared here, and
  10518. * those that are exported from imported NgModules.
  10519. *
  10520. * Declarables must belong to exactly one module.
  10521. * The compiler emits an error if you try to declare the same class in more than one module.
  10522. * Be careful not to declare a class that is imported from another module.
  10523. *
  10524. * ### Example
  10525. *
  10526. * The following example allows the CommonModule to use the `NgFor`
  10527. * directive.
  10528. *
  10529. * ```javascript
  10530. * @NgModule({
  10531. * declarations: [NgFor]
  10532. * })
  10533. * class CommonModule {
  10534. * }
  10535. * ```
  10536. */
  10537. declarations?: Array<Type$1<any> | any[]>;
  10538. /**
  10539. * The set of NgModules whose exported declarables
  10540. * are available to templates in this module.
  10541. *
  10542. * @usageNotes
  10543. *
  10544. * A template can use exported declarables from any
  10545. * imported module, including those from modules that are imported indirectly
  10546. * and re-exported.
  10547. * For example, `ModuleA` imports `ModuleB`, and also exports
  10548. * it, which makes the declarables from `ModuleB` available
  10549. * wherever `ModuleA` is imported.
  10550. *
  10551. * ### Example
  10552. *
  10553. * The following example allows MainModule to use anything exported by
  10554. * `CommonModule`:
  10555. *
  10556. * ```javascript
  10557. * @NgModule({
  10558. * imports: [CommonModule]
  10559. * })
  10560. * class MainModule {
  10561. * }
  10562. * ```
  10563. *
  10564. */
  10565. imports?: Array<Type$1<any> | ModuleWithProviders<{}> | any[]>;
  10566. /**
  10567. * The set of components, directives, and pipes declared in this
  10568. * NgModule that can be used in the template of any component that is part of an
  10569. * NgModule that imports this NgModule. Exported declarations are the module's public API.
  10570. *
  10571. * A declarable belongs to one and only one NgModule.
  10572. * A module can list another module among its exports, in which case all of that module's
  10573. * public declaration are exported.
  10574. *
  10575. * @usageNotes
  10576. *
  10577. * Declarations are private by default.
  10578. * If this ModuleA does not export UserComponent, then only the components within this
  10579. * ModuleA can use UserComponent.
  10580. *
  10581. * ModuleA can import ModuleB and also export it, making exports from ModuleB
  10582. * available to an NgModule that imports ModuleA.
  10583. *
  10584. * ### Example
  10585. *
  10586. * The following example exports the `NgFor` directive from CommonModule.
  10587. *
  10588. * ```javascript
  10589. * @NgModule({
  10590. * exports: [NgFor]
  10591. * })
  10592. * class CommonModule {
  10593. * }
  10594. * ```
  10595. */
  10596. exports?: Array<Type$1<any> | any[]>;
  10597. /**
  10598. * The set of components that are bootstrapped when this module is bootstrapped.
  10599. */
  10600. bootstrap?: Array<Type$1<any> | any[]>;
  10601. /**
  10602. * The set of schemas that declare elements to be allowed in the NgModule.
  10603. * Elements and properties that are neither Angular components nor directives
  10604. * must be declared in a schema.
  10605. *
  10606. * Allowed value are `NO_ERRORS_SCHEMA` and `CUSTOM_ELEMENTS_SCHEMA`.
  10607. *
  10608. * @security When using one of `NO_ERRORS_SCHEMA` or `CUSTOM_ELEMENTS_SCHEMA`
  10609. * you must ensure that allowed elements and properties securely escape inputs.
  10610. */
  10611. schemas?: Array<SchemaMetadata | any[]>;
  10612. /**
  10613. * A name or path that uniquely identifies this NgModule in `getNgModuleById`.
  10614. * If left `undefined`, the NgModule is not registered with `getNgModuleById`.
  10615. */
  10616. id?: string;
  10617. /**
  10618. * When present, this module is ignored by the AOT compiler.
  10619. * It remains in distributed code, and the JIT compiler attempts to compile it
  10620. * at run time, in the browser.
  10621. * To ensure the correct behavior, the app must import `@angular/compiler`.
  10622. */
  10623. jit?: true;
  10624. }
  10625. /**
  10626. * @Annotation
  10627. */
  10628. declare const NgModule: NgModuleDecorator;
  10629. /**
  10630. * @description Represents the version of Angular
  10631. *
  10632. * @publicApi
  10633. */
  10634. declare class Version {
  10635. full: string;
  10636. readonly major: string;
  10637. readonly minor: string;
  10638. readonly patch: string;
  10639. constructor(full: string);
  10640. }
  10641. /**
  10642. * @publicApi
  10643. */
  10644. declare const VERSION: Version;
  10645. /**
  10646. * Combination of NgModuleFactory and ComponentFactories.
  10647. *
  10648. * @publicApi
  10649. *
  10650. * @deprecated
  10651. * Ivy JIT mode doesn't require accessing this symbol.
  10652. */
  10653. declare class ModuleWithComponentFactories<T> {
  10654. ngModuleFactory: NgModuleFactory$1<T>;
  10655. componentFactories: ComponentFactory$1<any>[];
  10656. constructor(ngModuleFactory: NgModuleFactory$1<T>, componentFactories: ComponentFactory$1<any>[]);
  10657. }
  10658. /**
  10659. * Low-level service for running the angular compiler during runtime
  10660. * to create {@link ComponentFactory}s, which
  10661. * can later be used to create and render a Component instance.
  10662. *
  10663. * Each `@NgModule` provides an own `Compiler` to its injector,
  10664. * that will use the directives/pipes of the ng module for compilation
  10665. * of components.
  10666. *
  10667. * @publicApi
  10668. *
  10669. * @deprecated
  10670. * Ivy JIT mode doesn't require accessing this symbol.
  10671. */
  10672. declare class Compiler {
  10673. /**
  10674. * Compiles the given NgModule and all of its components. All templates of the components
  10675. * have to be inlined.
  10676. */
  10677. compileModuleSync<T>(moduleType: Type$1<T>): NgModuleFactory$1<T>;
  10678. /**
  10679. * Compiles the given NgModule and all of its components
  10680. */
  10681. compileModuleAsync<T>(moduleType: Type$1<T>): Promise<NgModuleFactory$1<T>>;
  10682. /**
  10683. * Same as {@link Compiler#compileModuleSync compileModuleSync} but also creates ComponentFactories for all components.
  10684. */
  10685. compileModuleAndAllComponentsSync<T>(moduleType: Type$1<T>): ModuleWithComponentFactories<T>;
  10686. /**
  10687. * Same as {@link Compiler#compileModuleAsync compileModuleAsync} but also creates ComponentFactories for all components.
  10688. */
  10689. compileModuleAndAllComponentsAsync<T>(moduleType: Type$1<T>): Promise<ModuleWithComponentFactories<T>>;
  10690. /**
  10691. * Clears all caches.
  10692. */
  10693. clearCache(): void;
  10694. /**
  10695. * Clears the cache for the given component/ngModule.
  10696. */
  10697. clearCacheFor(type: Type$1<any>): void;
  10698. /**
  10699. * Returns the id for a given NgModule, if one is defined and known to the compiler.
  10700. */
  10701. getModuleId(moduleType: Type$1<any>): string | undefined;
  10702. static ɵfac: ɵɵFactoryDeclaration<Compiler, never>;
  10703. static ɵprov: ɵɵInjectableDeclaration<Compiler>;
  10704. }
  10705. /**
  10706. * Options for creating a compiler.
  10707. *
  10708. * @publicApi
  10709. */
  10710. type CompilerOptions = {
  10711. defaultEncapsulation?: ViewEncapsulation$1;
  10712. providers?: StaticProvider[];
  10713. preserveWhitespaces?: boolean;
  10714. };
  10715. /**
  10716. * Token to provide CompilerOptions in the platform injector.
  10717. *
  10718. * @publicApi
  10719. */
  10720. declare const COMPILER_OPTIONS: InjectionToken<CompilerOptions[]>;
  10721. /**
  10722. * A factory for creating a Compiler
  10723. *
  10724. * @publicApi
  10725. *
  10726. * @deprecated
  10727. * Ivy JIT mode doesn't require accessing this symbol.
  10728. */
  10729. declare abstract class CompilerFactory {
  10730. abstract createCompiler(options?: CompilerOptions[]): Compiler;
  10731. }
  10732. /**
  10733. * Returns the NgModuleFactory with the given id (specified using [@NgModule.id
  10734. * field](api/core/NgModule#id)), if it exists and has been loaded. Factories for NgModules that do
  10735. * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found.
  10736. * @publicApi
  10737. * @deprecated Use `getNgModuleById` instead.
  10738. */
  10739. declare function getModuleFactory(id: string): NgModuleFactory$1<any>;
  10740. /**
  10741. * Returns the NgModule class with the given id (specified using [@NgModule.id
  10742. * field](api/core/NgModule#id)), if it exists and has been loaded. Classes for NgModules that do
  10743. * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found.
  10744. * @publicApi
  10745. */
  10746. declare function getNgModuleById<T>(id: string): Type$1<T>;
  10747. /**
  10748. * Represents an embedded template that can be used to instantiate embedded views.
  10749. * To instantiate embedded views based on a template, use the `ViewContainerRef`
  10750. * method `createEmbeddedView()`.
  10751. *
  10752. * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`
  10753. * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view
  10754. * is injected into the constructor of the directive,
  10755. * using the `TemplateRef` token.
  10756. *
  10757. * You can also use a `Query` to find a `TemplateRef` associated with
  10758. * a component or a directive.
  10759. *
  10760. * @see {@link ViewContainerRef}
  10761. *
  10762. * @publicApi
  10763. */
  10764. declare abstract class TemplateRef<C> {
  10765. /**
  10766. * The anchor element in the parent view for this embedded view.
  10767. *
  10768. * The data-binding and [injection contexts](guide/di/dependency-injection-context) of embedded
  10769. * views created from this `TemplateRef` inherit from the contexts of this location.
  10770. *
  10771. * Typically new embedded views are attached to the view container of this location, but in
  10772. * advanced use-cases, the view can be attached to a different container while keeping the
  10773. * data-binding and injection context from the original location.
  10774. *
  10775. */
  10776. abstract readonly elementRef: ElementRef;
  10777. /**
  10778. * Instantiates an unattached embedded view based on this template.
  10779. * @param context The data-binding context of the embedded view, as declared
  10780. * in the `<ng-template>` usage.
  10781. * @param injector Injector to be used within the embedded view.
  10782. * @returns The new embedded view object.
  10783. */
  10784. abstract createEmbeddedView(context: C, injector?: Injector): EmbeddedViewRef<C>;
  10785. }
  10786. /**
  10787. * Represents a container where one or more views can be attached to a component.
  10788. *
  10789. * Can contain *host views* (created by instantiating a
  10790. * component with the `createComponent()` method), and *embedded views*
  10791. * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).
  10792. *
  10793. * A view container instance can contain other view containers,
  10794. * creating a view hierarchy.
  10795. *
  10796. * @usageNotes
  10797. *
  10798. * The example below demonstrates how the `createComponent` function can be used
  10799. * to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,
  10800. * so that it gets included into change detection cycles.
  10801. *
  10802. * Note: the example uses standalone components, but the function can also be used for
  10803. * non-standalone components (declared in an NgModule) as well.
  10804. *
  10805. * ```angular-ts
  10806. * @Component({
  10807. * standalone: true,
  10808. * selector: 'dynamic',
  10809. * template: `<span>This is a content of a dynamic component.</span>`,
  10810. * })
  10811. * class DynamicComponent {
  10812. * vcr = inject(ViewContainerRef);
  10813. * }
  10814. *
  10815. * @Component({
  10816. * standalone: true,
  10817. * selector: 'app',
  10818. * template: `<main>Hi! This is the main content.</main>`,
  10819. * })
  10820. * class AppComponent {
  10821. * vcr = inject(ViewContainerRef);
  10822. *
  10823. * ngAfterViewInit() {
  10824. * const compRef = this.vcr.createComponent(DynamicComponent);
  10825. * compRef.changeDetectorRef.detectChanges();
  10826. * }
  10827. * }
  10828. * ```
  10829. *
  10830. * @see {@link ComponentRef}
  10831. * @see {@link EmbeddedViewRef}
  10832. *
  10833. * @publicApi
  10834. */
  10835. declare abstract class ViewContainerRef {
  10836. /**
  10837. * Anchor element that specifies the location of this container in the containing view.
  10838. * Each view container can have only one anchor element, and each anchor element
  10839. * can have only a single view container.
  10840. *
  10841. * Root elements of views attached to this container become siblings of the anchor element in
  10842. * the rendered view.
  10843. *
  10844. * Access the `ViewContainerRef` of an element by placing a `Directive` injected
  10845. * with `ViewContainerRef` on the element, or use a `ViewChild` query.
  10846. *
  10847. * <!-- TODO: rename to anchorElement -->
  10848. */
  10849. abstract get element(): ElementRef;
  10850. /**
  10851. * The dependency injector for this view container.
  10852. */
  10853. abstract get injector(): Injector;
  10854. /** @deprecated No replacement */
  10855. abstract get parentInjector(): Injector;
  10856. /**
  10857. * Destroys all views in this container.
  10858. */
  10859. abstract clear(): void;
  10860. /**
  10861. * Retrieves a view from this container.
  10862. * @param index The 0-based index of the view to retrieve.
  10863. * @returns The `ViewRef` instance, or null if the index is out of range.
  10864. */
  10865. abstract get(index: number): ViewRef$1 | null;
  10866. /**
  10867. * Reports how many views are currently attached to this container.
  10868. * @returns The number of views.
  10869. */
  10870. abstract get length(): number;
  10871. /**
  10872. * Instantiates an embedded view and inserts it
  10873. * into this container.
  10874. * @param templateRef The HTML template that defines the view.
  10875. * @param context The data-binding context of the embedded view, as declared
  10876. * in the `<ng-template>` usage.
  10877. * @param options Extra configuration for the created view. Includes:
  10878. * * index: The 0-based index at which to insert the new view into this container.
  10879. * If not specified, appends the new view as the last entry.
  10880. * * injector: Injector to be used within the embedded view.
  10881. *
  10882. * @returns The `ViewRef` instance for the newly created view.
  10883. */
  10884. abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, options?: {
  10885. index?: number;
  10886. injector?: Injector;
  10887. }): EmbeddedViewRef<C>;
  10888. /**
  10889. * Instantiates an embedded view and inserts it
  10890. * into this container.
  10891. * @param templateRef The HTML template that defines the view.
  10892. * @param context The data-binding context of the embedded view, as declared
  10893. * in the `<ng-template>` usage.
  10894. * @param index The 0-based index at which to insert the new view into this container.
  10895. * If not specified, appends the new view as the last entry.
  10896. *
  10897. * @returns The `ViewRef` instance for the newly created view.
  10898. */
  10899. abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number): EmbeddedViewRef<C>;
  10900. /**
  10901. * Instantiates a single component and inserts its host view into this container.
  10902. *
  10903. * @param componentType Component Type to use.
  10904. * @param options An object that contains extra parameters:
  10905. * * index: the index at which to insert the new component's host view into this container.
  10906. * If not specified, appends the new view as the last entry.
  10907. * * injector: the injector to use as the parent for the new component.
  10908. * * ngModuleRef: an NgModuleRef of the component's NgModule, you should almost always provide
  10909. * this to ensure that all expected providers are available for the component
  10910. * instantiation.
  10911. * * environmentInjector: an EnvironmentInjector which will provide the component's environment.
  10912. * you should almost always provide this to ensure that all expected providers
  10913. * are available for the component instantiation. This option is intended to
  10914. * replace the `ngModuleRef` parameter.
  10915. * * projectableNodes: list of DOM nodes that should be projected through
  10916. * [`<ng-content>`](api/core/ng-content) of the new component instance.
  10917. *
  10918. * @returns The new `ComponentRef` which contains the component instance and the host view.
  10919. */
  10920. abstract createComponent<C>(componentType: Type$1<C>, options?: {
  10921. index?: number;
  10922. injector?: Injector;
  10923. ngModuleRef?: NgModuleRef$1<unknown>;
  10924. environmentInjector?: EnvironmentInjector | NgModuleRef$1<unknown>;
  10925. projectableNodes?: Node[][];
  10926. }): ComponentRef$1<C>;
  10927. /**
  10928. * Instantiates a single component and inserts its host view into this container.
  10929. *
  10930. * @param componentFactory Component factory to use.
  10931. * @param index The index at which to insert the new component's host view into this container.
  10932. * If not specified, appends the new view as the last entry.
  10933. * @param injector The injector to use as the parent for the new component.
  10934. * @param projectableNodes List of DOM nodes that should be projected through
  10935. * [`<ng-content>`](api/core/ng-content) of the new component instance.
  10936. * @param ngModuleRef An instance of the NgModuleRef that represent an NgModule.
  10937. * This information is used to retrieve corresponding NgModule injector.
  10938. *
  10939. * @returns The new `ComponentRef` which contains the component instance and the host view.
  10940. *
  10941. * @deprecated Angular no longer requires component factories to dynamically create components.
  10942. * Use different signature of the `createComponent` method, which allows passing
  10943. * Component class directly.
  10944. */
  10945. abstract createComponent<C>(componentFactory: ComponentFactory$1<C>, index?: number, injector?: Injector, projectableNodes?: any[][], environmentInjector?: EnvironmentInjector | NgModuleRef$1<any>): ComponentRef$1<C>;
  10946. /**
  10947. * Inserts a view into this container.
  10948. * @param viewRef The view to insert.
  10949. * @param index The 0-based index at which to insert the view.
  10950. * If not specified, appends the new view as the last entry.
  10951. * @returns The inserted `ViewRef` instance.
  10952. *
  10953. */
  10954. abstract insert(viewRef: ViewRef$1, index?: number): ViewRef$1;
  10955. /**
  10956. * Moves a view to a new location in this container.
  10957. * @param viewRef The view to move.
  10958. * @param index The 0-based index of the new location.
  10959. * @returns The moved `ViewRef` instance.
  10960. */
  10961. abstract move(viewRef: ViewRef$1, currentIndex: number): ViewRef$1;
  10962. /**
  10963. * Returns the index of a view within the current container.
  10964. * @param viewRef The view to query.
  10965. * @returns The 0-based index of the view's position in this container,
  10966. * or `-1` if this container doesn't contain the view.
  10967. */
  10968. abstract indexOf(viewRef: ViewRef$1): number;
  10969. /**
  10970. * Destroys a view attached to this container
  10971. * @param index The 0-based index of the view to destroy.
  10972. * If not specified, the last view in the container is removed.
  10973. */
  10974. abstract remove(index?: number): void;
  10975. /**
  10976. * Detaches a view from this container without destroying it.
  10977. * Use along with `insert()` to move a view within the current container.
  10978. * @param index The 0-based index of the view to detach.
  10979. * If not specified, the last view in the container is detached.
  10980. */
  10981. abstract detach(index?: number): ViewRef$1 | null;
  10982. }
  10983. /**
  10984. * The Angular platform is the entry point for Angular on a web page.
  10985. * Each page has exactly one platform. Services (such as reflection) which are common
  10986. * to every Angular application running on the page are bound in its scope.
  10987. * A page's platform is initialized implicitly when a platform is created using a platform
  10988. * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.
  10989. *
  10990. * @publicApi
  10991. */
  10992. declare class PlatformRef {
  10993. private _injector;
  10994. private _modules;
  10995. private _destroyListeners;
  10996. private _destroyed;
  10997. /**
  10998. * Creates an instance of an `@NgModule` for the given platform.
  10999. *
  11000. * @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function
  11001. * argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.
  11002. */
  11003. bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory$1<M>, options?: BootstrapOptions): Promise<NgModuleRef$1<M>>;
  11004. /**
  11005. * Creates an instance of an `@NgModule` for a given platform.
  11006. *
  11007. * @usageNotes
  11008. * ### Simple Example
  11009. *
  11010. * ```ts
  11011. * @NgModule({
  11012. * imports: [BrowserModule]
  11013. * })
  11014. * class MyModule {}
  11015. *
  11016. * let moduleRef = platformBrowser().bootstrapModule(MyModule);
  11017. * ```
  11018. *
  11019. */
  11020. bootstrapModule<M>(moduleType: Type$1<M>, compilerOptions?: (CompilerOptions & BootstrapOptions) | Array<CompilerOptions & BootstrapOptions>): Promise<NgModuleRef$1<M>>;
  11021. /**
  11022. * Registers a listener to be called when the platform is destroyed.
  11023. */
  11024. onDestroy(callback: () => void): void;
  11025. /**
  11026. * Retrieves the platform {@link Injector}, which is the parent injector for
  11027. * every Angular application on the page and provides singleton providers.
  11028. */
  11029. get injector(): Injector;
  11030. /**
  11031. * Destroys the current Angular platform and all Angular applications on the page.
  11032. * Destroys all modules and listeners registered with the platform.
  11033. */
  11034. destroy(): void;
  11035. /**
  11036. * Indicates whether this instance was destroyed.
  11037. */
  11038. get destroyed(): boolean;
  11039. static ɵfac: ɵɵFactoryDeclaration<PlatformRef, never>;
  11040. static ɵprov: ɵɵInjectableDeclaration<PlatformRef>;
  11041. }
  11042. /**
  11043. * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
  11044. * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.
  11045. */
  11046. declare const ALLOW_MULTIPLE_PLATFORMS: InjectionToken<boolean>;
  11047. /**
  11048. * Creates a platform.
  11049. * Platforms must be created on launch using this function.
  11050. *
  11051. * @publicApi
  11052. */
  11053. declare function createPlatform(injector: Injector): PlatformRef;
  11054. /**
  11055. * Creates a factory for a platform. Can be used to provide or override `Providers` specific to
  11056. * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.
  11057. * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories
  11058. * to build up configurations that might be required by different libraries or parts of the
  11059. * application.
  11060. * @param name Identifies the new platform factory.
  11061. * @param providers A set of dependency providers for platforms created with the new factory.
  11062. *
  11063. * @publicApi
  11064. */
  11065. declare function createPlatformFactory(parentPlatformFactory: ((extraProviders?: StaticProvider[]) => PlatformRef) | null, name: string, providers?: StaticProvider[]): (extraProviders?: StaticProvider[]) => PlatformRef;
  11066. /**
  11067. * Checks that there is currently a platform that contains the given token as a provider.
  11068. *
  11069. * @publicApi
  11070. */
  11071. declare function assertPlatform(requiredToken: any): PlatformRef;
  11072. /**
  11073. * Returns the current platform.
  11074. *
  11075. * @publicApi
  11076. */
  11077. declare function getPlatform(): PlatformRef | null;
  11078. /**
  11079. * Destroys the current Angular platform and all Angular applications on the page.
  11080. * Destroys all modules and listeners registered with the platform.
  11081. *
  11082. * @publicApi
  11083. */
  11084. declare function destroyPlatform(): void;
  11085. /**
  11086. * @description
  11087. * This function is used to provide initialization functions that will be executed upon
  11088. * initialization of the platform injector.
  11089. *
  11090. * Note that the provided initializer is run in the injection context.
  11091. *
  11092. * Previously, this was achieved using the `PLATFORM_INITIALIZER` token which is now deprecated.
  11093. *
  11094. * @see {@link PLATFORM_INITIALIZER}
  11095. *
  11096. * @publicApi
  11097. */
  11098. declare function providePlatformInitializer(initializerFn: () => void): EnvironmentProviders;
  11099. /**
  11100. * Internal token used to verify that `provideZoneChangeDetection` is not used
  11101. * with the bootstrapModule API.
  11102. */
  11103. declare const PROVIDED_NG_ZONE: InjectionToken<boolean>;
  11104. declare function internalProvideZoneChangeDetection({ ngZoneFactory, ignoreChangesOutsideZone, scheduleInRootZone, }: {
  11105. ngZoneFactory?: () => NgZone;
  11106. ignoreChangesOutsideZone?: boolean;
  11107. scheduleInRootZone?: boolean;
  11108. }): StaticProvider[];
  11109. /**
  11110. * Provides `NgZone`-based change detection for the application bootstrapped using
  11111. * `bootstrapApplication`.
  11112. *
  11113. * `NgZone` is already provided in applications by default. This provider allows you to configure
  11114. * options like `eventCoalescing` in the `NgZone`.
  11115. * This provider is not available for `platformBrowser().bootstrapModule`, which uses
  11116. * `BootstrapOptions` instead.
  11117. *
  11118. * @usageNotes
  11119. * ```ts
  11120. * bootstrapApplication(MyApp, {providers: [
  11121. * provideZoneChangeDetection({eventCoalescing: true}),
  11122. * ]});
  11123. * ```
  11124. *
  11125. * @publicApi
  11126. * @see {@link /api/platform-browser/bootstrapApplication bootstrapApplication}
  11127. * @see {@link NgZoneOptions}
  11128. */
  11129. declare function provideZoneChangeDetection(options?: NgZoneOptions): EnvironmentProviders;
  11130. /**
  11131. * Used to configure event and run coalescing with `provideZoneChangeDetection`.
  11132. *
  11133. * @publicApi
  11134. *
  11135. * @see {@link provideZoneChangeDetection}
  11136. */
  11137. interface NgZoneOptions {
  11138. /**
  11139. * Optionally specify coalescing event change detections or not.
  11140. * Consider the following case.
  11141. *
  11142. * ```html
  11143. * <div (click)="doSomething()">
  11144. * <button (click)="doSomethingElse()"></button>
  11145. * </div>
  11146. * ```
  11147. *
  11148. * When button is clicked, because of the event bubbling, both
  11149. * event handlers will be called and 2 change detections will be
  11150. * triggered. We can coalesce such kind of events to trigger
  11151. * change detection only once.
  11152. *
  11153. * By default, this option is set to false, meaning events will
  11154. * not be coalesced, and change detection will be triggered multiple times.
  11155. * If this option is set to true, change detection will be triggered
  11156. * once in the scenario described above.
  11157. */
  11158. eventCoalescing?: boolean;
  11159. /**
  11160. * Optionally specify if `NgZone#run()` method invocations should be coalesced
  11161. * into a single change detection.
  11162. *
  11163. * Consider the following case.
  11164. * ```ts
  11165. * for (let i = 0; i < 10; i ++) {
  11166. * ngZone.run(() => {
  11167. * // do something
  11168. * });
  11169. * }
  11170. * ```
  11171. *
  11172. * This case triggers the change detection multiple times.
  11173. * With ngZoneRunCoalescing options, all change detections in an event loop trigger only once.
  11174. * In addition, the change detection executes in requestAnimation.
  11175. *
  11176. */
  11177. runCoalescing?: boolean;
  11178. /**
  11179. * When false, change detection is scheduled when Angular receives
  11180. * a clear indication that templates need to be refreshed. This includes:
  11181. *
  11182. * - calling `ChangeDetectorRef.markForCheck`
  11183. * - calling `ComponentRef.setInput`
  11184. * - updating a signal that is read in a template
  11185. * - attaching a view that is marked dirty
  11186. * - removing a view
  11187. * - registering a render hook (templates are only refreshed if render hooks do one of the above)
  11188. *
  11189. * @deprecated This option was introduced out of caution as a way for developers to opt out of the
  11190. * new behavior in v18 which schedule change detection for the above events when they occur
  11191. * outside the Zone. After monitoring the results post-release, we have determined that this
  11192. * feature is working as desired and do not believe it should ever be disabled by setting
  11193. * this option to `true`.
  11194. */
  11195. ignoreChangesOutsideZone?: boolean;
  11196. }
  11197. declare class ChangeDetectionSchedulerImpl implements ChangeDetectionScheduler {
  11198. private readonly appRef;
  11199. private readonly taskService;
  11200. private readonly ngZone;
  11201. private readonly zonelessEnabled;
  11202. private readonly tracing;
  11203. private readonly disableScheduling;
  11204. private readonly zoneIsDefined;
  11205. private readonly schedulerTickApplyArgs;
  11206. private readonly subscriptions;
  11207. private readonly angularZoneId;
  11208. private readonly scheduleInRootZone;
  11209. private cancelScheduledCallback;
  11210. private useMicrotaskScheduler;
  11211. runningTick: boolean;
  11212. pendingRenderTaskId: number | null;
  11213. constructor();
  11214. notify(source: NotificationSource): void;
  11215. private shouldScheduleTick;
  11216. /**
  11217. * Calls ApplicationRef._tick inside the `NgZone`.
  11218. *
  11219. * Calling `tick` directly runs change detection and cancels any change detection that had been
  11220. * scheduled previously.
  11221. *
  11222. * @param shouldRefreshViews Passed directly to `ApplicationRef._tick` and skips straight to
  11223. * render hooks when `false`.
  11224. */
  11225. private tick;
  11226. ngOnDestroy(): void;
  11227. private cleanup;
  11228. static ɵfac: ɵɵFactoryDeclaration<ChangeDetectionSchedulerImpl, never>;
  11229. static ɵprov: ɵɵInjectableDeclaration<ChangeDetectionSchedulerImpl>;
  11230. }
  11231. /**
  11232. * Provides change detection without ZoneJS for the application bootstrapped using
  11233. * `bootstrapApplication`.
  11234. *
  11235. * This function allows you to configure the application to not use the state/state changes of
  11236. * ZoneJS to schedule change detection in the application. This will work when ZoneJS is not present
  11237. * on the page at all or if it exists because something else is using it (either another Angular
  11238. * application which uses ZoneJS for scheduling or some other library that relies on ZoneJS).
  11239. *
  11240. * This can also be added to the `TestBed` providers to configure the test environment to more
  11241. * closely match production behavior. This will help give higher confidence that components are
  11242. * compatible with zoneless change detection.
  11243. *
  11244. * ZoneJS uses browser events to trigger change detection. When using this provider, Angular will
  11245. * instead use Angular APIs to schedule change detection. These APIs include:
  11246. *
  11247. * - `ChangeDetectorRef.markForCheck`
  11248. * - `ComponentRef.setInput`
  11249. * - updating a signal that is read in a template
  11250. * - when bound host or template listeners are triggered
  11251. * - attaching a view that was marked dirty by one of the above
  11252. * - removing a view
  11253. * - registering a render hook (templates are only refreshed if render hooks do one of the above)
  11254. *
  11255. * @usageNotes
  11256. * ```ts
  11257. * bootstrapApplication(MyApp, {providers: [
  11258. * provideExperimentalZonelessChangeDetection(),
  11259. * ]});
  11260. * ```
  11261. *
  11262. * This API is experimental. Neither the shape, nor the underlying behavior is stable and can change
  11263. * in patch versions. There are known feature gaps and API ergonomic considerations. We will iterate
  11264. * on the exact API based on the feedback and our understanding of the problem and solution space.
  11265. *
  11266. * @publicApi
  11267. * @experimental
  11268. * @see {@link /api/platform-browser/bootstrapApplication bootstrapApplication}
  11269. */
  11270. declare function provideExperimentalZonelessChangeDetection(): EnvironmentProviders;
  11271. /**
  11272. * Internal implementation of the pending tasks service.
  11273. */
  11274. declare class PendingTasksInternal implements OnDestroy {
  11275. private taskId;
  11276. private pendingTasks;
  11277. private get _hasPendingTasks();
  11278. hasPendingTasks: BehaviorSubject<boolean>;
  11279. add(): number;
  11280. has(taskId: number): boolean;
  11281. remove(taskId: number): void;
  11282. ngOnDestroy(): void;
  11283. /** @nocollapse */
  11284. static ɵprov: unknown;
  11285. }
  11286. /**
  11287. * Service that keeps track of pending tasks contributing to the stableness of Angular
  11288. * application. While several existing Angular services (ex.: `HttpClient`) will internally manage
  11289. * tasks influencing stability, this API gives control over stability to library and application
  11290. * developers for specific cases not covered by Angular internals.
  11291. *
  11292. * The concept of stability comes into play in several important scenarios:
  11293. * - SSR process needs to wait for the application stability before serializing and sending rendered
  11294. * HTML;
  11295. * - tests might want to delay assertions until the application becomes stable;
  11296. *
  11297. * @usageNotes
  11298. * ```ts
  11299. * const pendingTasks = inject(PendingTasks);
  11300. * const taskCleanup = pendingTasks.add();
  11301. * // do work that should block application's stability and then:
  11302. * taskCleanup();
  11303. * ```
  11304. *
  11305. * @publicApi
  11306. * @developerPreview
  11307. */
  11308. declare class PendingTasks {
  11309. private internalPendingTasks;
  11310. private scheduler;
  11311. /**
  11312. * Adds a new task that should block application's stability.
  11313. * @returns A cleanup function that removes a task when called.
  11314. */
  11315. add(): () => void;
  11316. /**
  11317. * Runs an asynchronous function and blocks the application's stability until the function completes.
  11318. *
  11319. * ```ts
  11320. * pendingTasks.run(async () => {
  11321. * const userData = await fetch('/api/user');
  11322. * this.userData.set(userData);
  11323. * });
  11324. * ```
  11325. *
  11326. * Application stability is at least delayed until the next tick after the `run` method resolves
  11327. * so it is safe to make additional updates to application state that would require UI synchronization:
  11328. *
  11329. * ```ts
  11330. * const userData = await pendingTasks.run(() => fetch('/api/user'));
  11331. * this.userData.set(userData);
  11332. * ```
  11333. *
  11334. * @param fn The asynchronous function to execute
  11335. */
  11336. run<T>(fn: () => Promise<T>): Promise<T>;
  11337. /** @nocollapse */
  11338. static ɵprov: unknown;
  11339. }
  11340. /**
  11341. * Enables directive matching on elements.
  11342. *
  11343. * * Example:
  11344. * ```html
  11345. * <my-comp my-directive>
  11346. * Should match component / directive.
  11347. * </my-comp>
  11348. * <div ngNonBindable>
  11349. * <!-- ɵɵdisableBindings() -->
  11350. * <my-comp my-directive>
  11351. * Should not match component / directive because we are in ngNonBindable.
  11352. * </my-comp>
  11353. * <!-- ɵɵenableBindings() -->
  11354. * </div>
  11355. * ```
  11356. *
  11357. * @codeGenApi
  11358. */
  11359. declare function ɵɵenableBindings(): void;
  11360. /**
  11361. * Disables directive matching on element.
  11362. *
  11363. * * Example:
  11364. * ```html
  11365. * <my-comp my-directive>
  11366. * Should match component / directive.
  11367. * </my-comp>
  11368. * <div ngNonBindable>
  11369. * <!-- ɵɵdisableBindings() -->
  11370. * <my-comp my-directive>
  11371. * Should not match component / directive because we are in ngNonBindable.
  11372. * </my-comp>
  11373. * <!-- ɵɵenableBindings() -->
  11374. * </div>
  11375. * ```
  11376. *
  11377. * @codeGenApi
  11378. */
  11379. declare function ɵɵdisableBindings(): void;
  11380. /**
  11381. * Restores `contextViewData` to the given OpaqueViewState instance.
  11382. *
  11383. * Used in conjunction with the getCurrentView() instruction to save a snapshot
  11384. * of the current view and restore it when listeners are invoked. This allows
  11385. * walking the declaration view tree in listeners to get vars from parent views.
  11386. *
  11387. * @param viewToRestore The OpaqueViewState instance to restore.
  11388. * @returns Context of the restored OpaqueViewState instance.
  11389. *
  11390. * @codeGenApi
  11391. */
  11392. declare function ɵɵrestoreView<T = any>(viewToRestore: OpaqueViewState): T;
  11393. /**
  11394. * Clears the view set in `ɵɵrestoreView` from memory. Returns the passed in
  11395. * value so that it can be used as a return value of an instruction.
  11396. *
  11397. * @codeGenApi
  11398. */
  11399. declare function ɵɵresetView<T>(value?: T): T | undefined;
  11400. /**
  11401. * Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.
  11402. *
  11403. * @codeGenApi
  11404. */
  11405. declare function ɵɵnamespaceSVG(): void;
  11406. /**
  11407. * Sets the namespace used to create elements to `'http://www.w3.org/1998/MathML/'` in global state.
  11408. *
  11409. * @codeGenApi
  11410. */
  11411. declare function ɵɵnamespaceMathML(): void;
  11412. /**
  11413. * Sets the namespace used to create elements to `null`, which forces element creation to use
  11414. * `createElement` rather than `createElementNS`.
  11415. *
  11416. * @codeGenApi
  11417. */
  11418. declare function ɵɵnamespaceHTML(): void;
  11419. /**
  11420. * Used to periodically verify no expressions have changed after they were checked.
  11421. *
  11422. * @param options Used to configure when the check will execute.
  11423. * - `interval` will periodically run exhaustive `checkNoChanges` on application views
  11424. * - `useNgZoneOnStable` will use ZoneJS to determine when change detection might have run
  11425. * in an application using ZoneJS to drive change detection. When the `NgZone.onStable` would
  11426. * have emitted, all views attached to the `ApplicationRef` are checked for changes.
  11427. * - 'exhaustive' means that all views attached to `ApplicationRef` and all the descendants of those views will be
  11428. * checked for changes (excluding those subtrees which are detached via `ChangeDetectorRef.detach()`).
  11429. * This is useful because the check that runs after regular change detection does not work for components using `ChangeDetectionStrategy.OnPush`.
  11430. * This check is will surface any existing errors hidden by `OnPush` components. By default, this check is exhaustive
  11431. * and will always check all views, regardless of their "dirty" state and `ChangeDetectionStrategy`.
  11432. *
  11433. * When the `useNgZoneOnStable` option is `true`, this function will provide its own `NgZone` implementation and needs
  11434. * to come after any other `NgZone` provider, including `provideZoneChangeDetection()` and `provideExperimentalZonelessChangeDetection()`.
  11435. *
  11436. * @experimental
  11437. * @publicApi
  11438. */
  11439. declare function provideExperimentalCheckNoChangesForDebug(options: {
  11440. interval?: number;
  11441. useNgZoneOnStable?: boolean;
  11442. exhaustive?: boolean;
  11443. }): _angular_core.EnvironmentProviders;
  11444. /**
  11445. * Returns whether Angular is in development mode.
  11446. *
  11447. * By default, this is true, unless `enableProdMode` is invoked prior to calling this method or the
  11448. * application is built using the Angular CLI with the `optimization` option.
  11449. * @see {@link /cli/build ng build}
  11450. *
  11451. * @publicApi
  11452. */
  11453. declare function isDevMode(): boolean;
  11454. /**
  11455. * Disable Angular's development mode, which turns off assertions and other
  11456. * checks within the framework.
  11457. *
  11458. * One important assertion this disables verifies that a change detection pass
  11459. * does not result in additional changes to any bindings (also known as
  11460. * unidirectional data flow).
  11461. *
  11462. * Using this method is discouraged as the Angular CLI will set production mode when using the
  11463. * `optimization` option.
  11464. * @see {@link /cli/build ng build}
  11465. *
  11466. * @publicApi
  11467. */
  11468. declare function enableProdMode(): void;
  11469. /**
  11470. * A DI token representing a string ID, used
  11471. * primarily for prefixing application attributes and CSS styles when
  11472. * {@link ViewEncapsulation#Emulated} is being used.
  11473. *
  11474. * The token is needed in cases when multiple applications are bootstrapped on a page
  11475. * (for example, using `bootstrapApplication` calls). In this case, ensure that those applications
  11476. * have different `APP_ID` value setup. For example:
  11477. *
  11478. * ```ts
  11479. * bootstrapApplication(ComponentA, {
  11480. * providers: [
  11481. * { provide: APP_ID, useValue: 'app-a' },
  11482. * // ... other providers ...
  11483. * ]
  11484. * });
  11485. *
  11486. * bootstrapApplication(ComponentB, {
  11487. * providers: [
  11488. * { provide: APP_ID, useValue: 'app-b' },
  11489. * // ... other providers ...
  11490. * ]
  11491. * });
  11492. * ```
  11493. *
  11494. * By default, when there is only one application bootstrapped, you don't need to provide the
  11495. * `APP_ID` token (the `ng` will be used as an app ID).
  11496. *
  11497. * @publicApi
  11498. */
  11499. declare const APP_ID: InjectionToken<string>;
  11500. /**
  11501. * A function that is executed when a platform is initialized.
  11502. *
  11503. * @deprecated from v19.0.0, use providePlatformInitializer instead
  11504. *
  11505. * @see {@link providePlatformInitializer}
  11506. *
  11507. * @publicApi
  11508. */
  11509. declare const PLATFORM_INITIALIZER: InjectionToken<readonly (() => void)[]>;
  11510. /**
  11511. * A token that indicates an opaque platform ID.
  11512. * @publicApi
  11513. */
  11514. declare const PLATFORM_ID: InjectionToken<Object>;
  11515. /**
  11516. * A DI token that indicates the root directory of
  11517. * the application
  11518. * @publicApi
  11519. * @deprecated
  11520. */
  11521. declare const PACKAGE_ROOT_URL: InjectionToken<string>;
  11522. /**
  11523. * A [DI token](api/core/InjectionToken) that indicates which animations
  11524. * module has been loaded.
  11525. * @publicApi
  11526. */
  11527. declare const ANIMATION_MODULE_TYPE: InjectionToken<"NoopAnimations" | "BrowserAnimations">;
  11528. /**
  11529. * Token used to configure the [Content Security Policy](https://web.dev/strict-csp/) nonce that
  11530. * Angular will apply when inserting inline styles. If not provided, Angular will look up its value
  11531. * from the `ngCspNonce` attribute of the application root node.
  11532. *
  11533. * @publicApi
  11534. */
  11535. declare const CSP_NONCE: InjectionToken<string | null>;
  11536. /**
  11537. * A configuration object for the image-related options. Contains:
  11538. * - breakpoints: An array of integer breakpoints used to generate
  11539. * srcsets for responsive images.
  11540. * - disableImageSizeWarning: A boolean value. Setting this to true will
  11541. * disable console warnings about oversized images.
  11542. * - disableImageLazyLoadWarning: A boolean value. Setting this to true will
  11543. * disable console warnings about LCP images configured with `loading="lazy"`.
  11544. * Learn more about the responsive image configuration in [the NgOptimizedImage
  11545. * guide](guide/image-optimization).
  11546. * Learn more about image warning options in [the related error page](errors/NG0913).
  11547. * @publicApi
  11548. */
  11549. type ImageConfig = {
  11550. breakpoints?: number[];
  11551. placeholderResolution?: number;
  11552. disableImageSizeWarning?: boolean;
  11553. disableImageLazyLoadWarning?: boolean;
  11554. };
  11555. declare const IMAGE_CONFIG_DEFAULTS: ImageConfig;
  11556. /**
  11557. * Injection token that configures the image optimized image functionality.
  11558. * See {@link ImageConfig} for additional information about parameters that
  11559. * can be used.
  11560. *
  11561. * @see {@link NgOptimizedImage}
  11562. * @see {@link ImageConfig}
  11563. * @publicApi
  11564. */
  11565. declare const IMAGE_CONFIG: InjectionToken<ImageConfig>;
  11566. /**
  11567. * A DI token that you can use to provide
  11568. * one or more initialization functions.
  11569. *
  11570. * The provided functions are injected at application startup and executed during
  11571. * app initialization. If any of these functions returns a Promise or an Observable, initialization
  11572. * does not complete until the Promise is resolved or the Observable is completed.
  11573. *
  11574. * You can, for example, create a factory function that loads language data
  11575. * or an external configuration, and provide that function to the `APP_INITIALIZER` token.
  11576. * The function is executed during the application bootstrap process,
  11577. * and the needed data is available on startup.
  11578. *
  11579. * Note that the provided initializer is run in the injection context.
  11580. *
  11581. * @deprecated from v19.0.0, use provideAppInitializer instead
  11582. *
  11583. * @see {@link ApplicationInitStatus}
  11584. * @see {@link provideAppInitializer}
  11585. *
  11586. * @usageNotes
  11587. *
  11588. * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token
  11589. * and a function returning a promise.
  11590. * ### Example with NgModule-based application
  11591. * ```ts
  11592. * function initializeApp(): Promise<any> {
  11593. * const http = inject(HttpClient);
  11594. * return firstValueFrom(
  11595. * http
  11596. * .get("https://someUrl.com/api/user")
  11597. * .pipe(tap(user => { ... }))
  11598. * );
  11599. * }
  11600. *
  11601. * @NgModule({
  11602. * imports: [BrowserModule],
  11603. * declarations: [AppComponent],
  11604. * bootstrap: [AppComponent],
  11605. * providers: [{
  11606. * provide: APP_INITIALIZER,
  11607. * useValue: initializeApp,
  11608. * multi: true,
  11609. * }]
  11610. * })
  11611. * export class AppModule {}
  11612. * ```
  11613. *
  11614. * ### Example with standalone application
  11615. * ```ts
  11616. * function initializeApp() {
  11617. * const http = inject(HttpClient);
  11618. * return firstValueFrom(
  11619. * http
  11620. * .get("https://someUrl.com/api/user")
  11621. * .pipe(tap(user => { ... }))
  11622. * );
  11623. * }
  11624. *
  11625. * bootstrapApplication(App, {
  11626. * providers: [
  11627. * provideHttpClient(),
  11628. * {
  11629. * provide: APP_INITIALIZER,
  11630. * useValue: initializeApp,
  11631. * multi: true,
  11632. * },
  11633. * ],
  11634. * });
  11635. * ```
  11636. *
  11637. *
  11638. * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function
  11639. * returning an observable, see an example below. Note: the `HttpClient` in this example is used for
  11640. * demo purposes to illustrate how the factory function can work with other providers available
  11641. * through DI.
  11642. *
  11643. * ### Example with NgModule-based application
  11644. * ```ts
  11645. * function initializeApp() {
  11646. * const http = inject(HttpClient);
  11647. * return firstValueFrom(
  11648. * http
  11649. * .get("https://someUrl.com/api/user")
  11650. * .pipe(tap(user => { ... }))
  11651. * );
  11652. * }
  11653. *
  11654. * @NgModule({
  11655. * imports: [BrowserModule, HttpClientModule],
  11656. * declarations: [AppComponent],
  11657. * bootstrap: [AppComponent],
  11658. * providers: [{
  11659. * provide: APP_INITIALIZER,
  11660. * useValue: initializeApp,
  11661. * multi: true,
  11662. * }]
  11663. * })
  11664. * export class AppModule {}
  11665. * ```
  11666. *
  11667. * ### Example with standalone application
  11668. * ```ts
  11669. * function initializeApp() {
  11670. * const http = inject(HttpClient);
  11671. * return firstValueFrom(
  11672. * http
  11673. * .get("https://someUrl.com/api/user")
  11674. * .pipe(tap(user => { ... }))
  11675. * );
  11676. * }
  11677. *
  11678. * bootstrapApplication(App, {
  11679. * providers: [
  11680. * provideHttpClient(),
  11681. * {
  11682. * provide: APP_INITIALIZER,
  11683. * useValue: initializeApp,
  11684. * multi: true,
  11685. * },
  11686. * ],
  11687. * });
  11688. * ```
  11689. *
  11690. * @publicApi
  11691. */
  11692. declare const APP_INITIALIZER: InjectionToken<readonly (() => Observable<unknown> | Promise<unknown> | void)[]>;
  11693. /**
  11694. * @description
  11695. * The provided function is injected at application startup and executed during
  11696. * app initialization. If the function returns a Promise or an Observable, initialization
  11697. * does not complete until the Promise is resolved or the Observable is completed.
  11698. *
  11699. * You can, for example, create a function that loads language data
  11700. * or an external configuration, and provide that function using `provideAppInitializer()`.
  11701. * The function is executed during the application bootstrap process,
  11702. * and the needed data is available on startup.
  11703. *
  11704. * Note that the provided initializer is run in the injection context.
  11705. *
  11706. * Previously, this was achieved using the `APP_INITIALIZER` token which is now deprecated.
  11707. *
  11708. * @see {@link APP_INITIALIZER}
  11709. *
  11710. * @usageNotes
  11711. * The following example illustrates how to configure an initialization function using
  11712. * `provideAppInitializer()`
  11713. * ```ts
  11714. * bootstrapApplication(App, {
  11715. * providers: [
  11716. * provideAppInitializer(() => {
  11717. * const http = inject(HttpClient);
  11718. * return firstValueFrom(
  11719. * http
  11720. * .get("https://someUrl.com/api/user")
  11721. * .pipe(tap(user => { ... }))
  11722. * );
  11723. * }),
  11724. * provideHttpClient(),
  11725. * ],
  11726. * });
  11727. * ```
  11728. *
  11729. * @publicApi
  11730. */
  11731. declare function provideAppInitializer(initializerFn: () => Observable<unknown> | Promise<unknown> | void): EnvironmentProviders;
  11732. /**
  11733. * A class that reflects the state of running {@link APP_INITIALIZER} functions.
  11734. *
  11735. * @publicApi
  11736. */
  11737. declare class ApplicationInitStatus {
  11738. private resolve;
  11739. private reject;
  11740. private initialized;
  11741. readonly done = false;
  11742. readonly donePromise: Promise<any>;
  11743. private readonly appInits;
  11744. private readonly injector;
  11745. constructor();
  11746. static ɵfac: ɵɵFactoryDeclaration<ApplicationInitStatus, never>;
  11747. static ɵprov: ɵɵInjectableDeclaration<ApplicationInitStatus>;
  11748. }
  11749. /**
  11750. * @publicApi
  11751. */
  11752. declare class DebugEventListener {
  11753. name: string;
  11754. callback: Function;
  11755. constructor(name: string, callback: Function);
  11756. }
  11757. /**
  11758. * @publicApi
  11759. */
  11760. declare function asNativeElements(debugEls: DebugElement[]): any;
  11761. /**
  11762. * @publicApi
  11763. */
  11764. declare class DebugNode {
  11765. /**
  11766. * The underlying DOM node.
  11767. */
  11768. readonly nativeNode: any;
  11769. constructor(nativeNode: Node);
  11770. /**
  11771. * The `DebugElement` parent. Will be `null` if this is the root element.
  11772. */
  11773. get parent(): DebugElement | null;
  11774. /**
  11775. * The host dependency injector. For example, the root element's component instance injector.
  11776. */
  11777. get injector(): Injector;
  11778. /**
  11779. * The element's own component instance, if it has one.
  11780. */
  11781. get componentInstance(): any;
  11782. /**
  11783. * An object that provides parent context for this element. Often an ancestor component instance
  11784. * that governs this element.
  11785. *
  11786. * When an element is repeated within *ngFor, the context is an `NgForOf` whose `$implicit`
  11787. * property is the value of the row instance value. For example, the `hero` in `*ngFor="let hero
  11788. * of heroes"`.
  11789. */
  11790. get context(): any;
  11791. /**
  11792. * The callbacks attached to the component's @Output properties and/or the element's event
  11793. * properties.
  11794. */
  11795. get listeners(): DebugEventListener[];
  11796. /**
  11797. * Dictionary of objects associated with template local variables (e.g. #foo), keyed by the local
  11798. * variable name.
  11799. */
  11800. get references(): {
  11801. [key: string]: any;
  11802. };
  11803. /**
  11804. * This component's injector lookup tokens. Includes the component itself plus the tokens that the
  11805. * component lists in its providers metadata.
  11806. */
  11807. get providerTokens(): any[];
  11808. }
  11809. /**
  11810. * @publicApi
  11811. *
  11812. * @see [Component testing scenarios](guide/testing/components-scenarios)
  11813. * @see [Basics of testing components](guide/testing/components-basics)
  11814. * @see [Testing utility APIs](guide/testing/utility-apis)
  11815. */
  11816. declare class DebugElement extends DebugNode {
  11817. constructor(nativeNode: Element);
  11818. /**
  11819. * The underlying DOM element at the root of the component.
  11820. */
  11821. get nativeElement(): any;
  11822. /**
  11823. * The element tag name, if it is an element.
  11824. */
  11825. get name(): string;
  11826. /**
  11827. * Gets a map of property names to property values for an element.
  11828. *
  11829. * This map includes:
  11830. * - Regular property bindings (e.g. `[id]="id"`)
  11831. * - Host property bindings (e.g. `host: { '[id]': "id" }`)
  11832. * - Interpolated property bindings (e.g. `id="{{ value }}")
  11833. *
  11834. * It does not include:
  11835. * - input property bindings (e.g. `[myCustomInput]="value"`)
  11836. * - attribute bindings (e.g. `[attr.role]="menu"`)
  11837. */
  11838. get properties(): {
  11839. [key: string]: any;
  11840. };
  11841. /**
  11842. * A map of attribute names to attribute values for an element.
  11843. */
  11844. get attributes(): {
  11845. [key: string]: string | null;
  11846. };
  11847. /**
  11848. * The inline styles of the DOM element.
  11849. */
  11850. get styles(): {
  11851. [key: string]: string | null;
  11852. };
  11853. /**
  11854. * A map containing the class names on the element as keys.
  11855. *
  11856. * This map is derived from the `className` property of the DOM element.
  11857. *
  11858. * Note: The values of this object will always be `true`. The class key will not appear in the KV
  11859. * object if it does not exist on the element.
  11860. *
  11861. * @see [Element.className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className)
  11862. */
  11863. get classes(): {
  11864. [key: string]: boolean;
  11865. };
  11866. /**
  11867. * The `childNodes` of the DOM element as a `DebugNode` array.
  11868. *
  11869. * @see [Node.childNodes](https://developer.mozilla.org/en-US/docs/Web/API/Node/childNodes)
  11870. */
  11871. get childNodes(): DebugNode[];
  11872. /**
  11873. * The immediate `DebugElement` children. Walk the tree by descending through `children`.
  11874. */
  11875. get children(): DebugElement[];
  11876. /**
  11877. * @returns the first `DebugElement` that matches the predicate at any depth in the subtree.
  11878. */
  11879. query(predicate: Predicate<DebugElement>): DebugElement;
  11880. /**
  11881. * @returns All `DebugElement` matches for the predicate at any depth in the subtree.
  11882. */
  11883. queryAll(predicate: Predicate<DebugElement>): DebugElement[];
  11884. /**
  11885. * @returns All `DebugNode` matches for the predicate at any depth in the subtree.
  11886. */
  11887. queryAllNodes(predicate: Predicate<DebugNode>): DebugNode[];
  11888. /**
  11889. * Triggers the event by its name if there is a corresponding listener in the element's
  11890. * `listeners` collection.
  11891. *
  11892. * If the event lacks a listener or there's some other problem, consider
  11893. * calling `nativeElement.dispatchEvent(eventObject)`.
  11894. *
  11895. * @param eventName The name of the event to trigger
  11896. * @param eventObj The _event object_ expected by the handler
  11897. *
  11898. * @see [Testing components scenarios](guide/testing/components-scenarios#trigger-event-handler)
  11899. */
  11900. triggerEventHandler(eventName: string, eventObj?: any): void;
  11901. }
  11902. /**
  11903. * @publicApi
  11904. */
  11905. declare function getDebugNode(nativeNode: any): DebugNode | null;
  11906. /**
  11907. * A boolean-valued function over a value, possibly including context information
  11908. * regarding that value's position in an array.
  11909. *
  11910. * @publicApi
  11911. */
  11912. type Predicate<T> = (value: T) => boolean;
  11913. /**
  11914. * Testability API.
  11915. * `declare` keyword causes tsickle to generate externs, so these methods are
  11916. * not renamed by Closure Compiler.
  11917. * @publicApi
  11918. */
  11919. declare interface PublicTestability {
  11920. isStable(): boolean;
  11921. whenStable(callback: Function, timeout?: number, updateCallback?: Function): void;
  11922. findProviders(using: any, provider: string, exactMatch: boolean): any[];
  11923. }
  11924. /**
  11925. * Internal injection token that can used to access an instance of a Testability class.
  11926. *
  11927. * This token acts as a bridge between the core bootstrap code and the `Testability` class. This is
  11928. * needed to ensure that there are no direct references to the `Testability` class, so it can be
  11929. * tree-shaken away (if not referenced). For the environments/setups when the `Testability` class
  11930. * should be available, this token is used to add a provider that references the `Testability`
  11931. * class. Otherwise, only this token is retained in a bundle, but the `Testability` class is not.
  11932. */
  11933. declare const TESTABILITY: InjectionToken<Testability>;
  11934. /**
  11935. * Internal injection token to retrieve Testability getter class instance.
  11936. */
  11937. declare const TESTABILITY_GETTER: InjectionToken<GetTestability>;
  11938. /**
  11939. * The Testability service provides testing hooks that can be accessed from
  11940. * the browser.
  11941. *
  11942. * Angular applications bootstrapped using an NgModule (via `@NgModule.bootstrap` field) will also
  11943. * instantiate Testability by default (in both development and production modes).
  11944. *
  11945. * For applications bootstrapped using the `bootstrapApplication` function, Testability is not
  11946. * included by default. You can include it into your applications by getting the list of necessary
  11947. * providers using the `provideProtractorTestingSupport()` function and adding them into the
  11948. * `options.providers` array. Example:
  11949. *
  11950. * ```ts
  11951. * import {provideProtractorTestingSupport} from '@angular/platform-browser';
  11952. *
  11953. * await bootstrapApplication(RootComponent, providers: [provideProtractorTestingSupport()]);
  11954. * ```
  11955. *
  11956. * @publicApi
  11957. */
  11958. declare class Testability implements PublicTestability {
  11959. private _ngZone;
  11960. private registry;
  11961. private _isZoneStable;
  11962. private _callbacks;
  11963. private taskTrackingZone;
  11964. constructor(_ngZone: NgZone, registry: TestabilityRegistry, testabilityGetter: GetTestability);
  11965. private _watchAngularEvents;
  11966. /**
  11967. * Whether an associated application is stable
  11968. */
  11969. isStable(): boolean;
  11970. private _runCallbacksIfReady;
  11971. private getPendingTasks;
  11972. private addCallback;
  11973. /**
  11974. * Wait for the application to be stable with a timeout. If the timeout is reached before that
  11975. * happens, the callback receives a list of the macro tasks that were pending, otherwise null.
  11976. *
  11977. * @param doneCb The callback to invoke when Angular is stable or the timeout expires
  11978. * whichever comes first.
  11979. * @param timeout Optional. The maximum time to wait for Angular to become stable. If not
  11980. * specified, whenStable() will wait forever.
  11981. * @param updateCb Optional. If specified, this callback will be invoked whenever the set of
  11982. * pending macrotasks changes. If this callback returns true doneCb will not be invoked
  11983. * and no further updates will be issued.
  11984. */
  11985. whenStable(doneCb: Function, timeout?: number, updateCb?: Function): void;
  11986. /**
  11987. * Find providers by name
  11988. * @param using The root element to search from
  11989. * @param provider The name of binding variable
  11990. * @param exactMatch Whether using exactMatch
  11991. */
  11992. findProviders(using: any, provider: string, exactMatch: boolean): any[];
  11993. static ɵfac: ɵɵFactoryDeclaration<Testability, never>;
  11994. static ɵprov: ɵɵInjectableDeclaration<Testability>;
  11995. }
  11996. /**
  11997. * A global registry of {@link Testability} instances for specific elements.
  11998. * @publicApi
  11999. */
  12000. declare class TestabilityRegistry {
  12001. /**
  12002. * Registers an application with a testability hook so that it can be tracked
  12003. * @param token token of application, root element
  12004. * @param testability Testability hook
  12005. */
  12006. registerApplication(token: any, testability: Testability): void;
  12007. /**
  12008. * Unregisters an application.
  12009. * @param token token of application, root element
  12010. */
  12011. unregisterApplication(token: any): void;
  12012. /**
  12013. * Unregisters all applications
  12014. */
  12015. unregisterAllApplications(): void;
  12016. /**
  12017. * Get a testability hook associated with the application
  12018. * @param elem root element
  12019. */
  12020. getTestability(elem: any): Testability | null;
  12021. /**
  12022. * Get all registered testabilities
  12023. */
  12024. getAllTestabilities(): Testability[];
  12025. /**
  12026. * Get all registered applications(root elements)
  12027. */
  12028. getAllRootElements(): any[];
  12029. /**
  12030. * Find testability of a node in the Tree
  12031. * @param elem node
  12032. * @param findInAncestors whether finding testability in ancestors if testability was not found in
  12033. * current node
  12034. */
  12035. findTestabilityInTree(elem: Node, findInAncestors?: boolean): Testability | null;
  12036. static ɵfac: ɵɵFactoryDeclaration<TestabilityRegistry, never>;
  12037. static ɵprov: ɵɵInjectableDeclaration<TestabilityRegistry>;
  12038. }
  12039. /**
  12040. * Adapter interface for retrieving the `Testability` service associated for a
  12041. * particular context.
  12042. *
  12043. * @publicApi
  12044. */
  12045. interface GetTestability {
  12046. addToWindow(registry: TestabilityRegistry): void;
  12047. findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null;
  12048. }
  12049. /**
  12050. * Set the {@link GetTestability} implementation used by the Angular testing framework.
  12051. * @publicApi
  12052. */
  12053. declare function setTestabilityGetter(getter: GetTestability): void;
  12054. /**
  12055. * This platform has to be included in any other platform
  12056. *
  12057. * @publicApi
  12058. */
  12059. declare const platformCore: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
  12060. /**
  12061. * Provide this token to set the locale of your application.
  12062. * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
  12063. * DecimalPipe and PercentPipe) and by ICU expressions.
  12064. *
  12065. * See the [i18n guide](guide/i18n/locale-id) for more information.
  12066. *
  12067. * @usageNotes
  12068. * ### Example
  12069. *
  12070. * ```ts
  12071. * import { LOCALE_ID } from '@angular/core';
  12072. * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  12073. * import { AppModule } from './app/app.module';
  12074. *
  12075. * platformBrowserDynamic().bootstrapModule(AppModule, {
  12076. * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
  12077. * });
  12078. * ```
  12079. *
  12080. * @publicApi
  12081. */
  12082. declare const LOCALE_ID: InjectionToken<string>;
  12083. /**
  12084. * Provide this token to set the default currency code your application uses for
  12085. * CurrencyPipe when there is no currency code passed into it. This is only used by
  12086. * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.
  12087. *
  12088. * See the [i18n guide](guide/i18n/locale-id) for more information.
  12089. *
  12090. * <div class="docs-alert docs-alert-helpful">
  12091. *
  12092. * The default currency code is currently always `USD`.
  12093. *
  12094. * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in
  12095. * your application `NgModule`:
  12096. *
  12097. * ```ts
  12098. * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
  12099. * ```
  12100. *
  12101. * </div>
  12102. *
  12103. * @usageNotes
  12104. * ### Example
  12105. *
  12106. * ```ts
  12107. * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  12108. * import { AppModule } from './app/app.module';
  12109. *
  12110. * platformBrowserDynamic().bootstrapModule(AppModule, {
  12111. * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]
  12112. * });
  12113. * ```
  12114. *
  12115. * @publicApi
  12116. */
  12117. declare const DEFAULT_CURRENCY_CODE: InjectionToken<string>;
  12118. /**
  12119. * Use this token at bootstrap to provide the content of your translation file (`xtb`,
  12120. * `xlf` or `xlf2`) when you want to translate your application in another language.
  12121. *
  12122. * See the [i18n guide](guide/i18n/merge) for more information.
  12123. *
  12124. * @usageNotes
  12125. * ### Example
  12126. *
  12127. * ```ts
  12128. * import { TRANSLATIONS } from '@angular/core';
  12129. * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  12130. * import { AppModule } from './app/app.module';
  12131. *
  12132. * // content of your translation file
  12133. * const translations = '....';
  12134. *
  12135. * platformBrowserDynamic().bootstrapModule(AppModule, {
  12136. * providers: [{provide: TRANSLATIONS, useValue: translations }]
  12137. * });
  12138. * ```
  12139. *
  12140. * @publicApi
  12141. */
  12142. declare const TRANSLATIONS: InjectionToken<string>;
  12143. /**
  12144. * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
  12145. * `xlf` or `xlf2`.
  12146. *
  12147. * See the [i18n guide](guide/i18n/merge) for more information.
  12148. *
  12149. * @usageNotes
  12150. * ### Example
  12151. *
  12152. * ```ts
  12153. * import { TRANSLATIONS_FORMAT } from '@angular/core';
  12154. * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  12155. * import { AppModule } from './app/app.module';
  12156. *
  12157. * platformBrowserDynamic().bootstrapModule(AppModule, {
  12158. * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
  12159. * });
  12160. * ```
  12161. *
  12162. * @publicApi
  12163. */
  12164. declare const TRANSLATIONS_FORMAT: InjectionToken<string>;
  12165. /**
  12166. * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
  12167. * that the compiler should use in case of missing translations:
  12168. * - Error: throw if you have missing translations.
  12169. * - Warning (default): show a warning in the console and/or shell.
  12170. * - Ignore: do nothing.
  12171. *
  12172. * See the [i18n guide](guide/i18n/merge#report-missing-translations) for more information.
  12173. *
  12174. * @usageNotes
  12175. * ### Example
  12176. * ```ts
  12177. * import { MissingTranslationStrategy } from '@angular/core';
  12178. * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  12179. * import { AppModule } from './app/app.module';
  12180. *
  12181. * platformBrowserDynamic().bootstrapModule(AppModule, {
  12182. * missingTranslation: MissingTranslationStrategy.Error
  12183. * });
  12184. * ```
  12185. *
  12186. * @publicApi
  12187. */
  12188. declare enum MissingTranslationStrategy {
  12189. Error = 0,
  12190. Warning = 1,
  12191. Ignore = 2
  12192. }
  12193. /**
  12194. * Re-exported by `BrowserModule`, which is included automatically in the root
  12195. * `AppModule` when you create a new app with the CLI `new` command. Eagerly injects
  12196. * `ApplicationRef` to instantiate it.
  12197. *
  12198. * @publicApi
  12199. */
  12200. declare class ApplicationModule {
  12201. constructor(appRef: ApplicationRef);
  12202. static ɵfac: ɵɵFactoryDeclaration<ApplicationModule, never>;
  12203. static ɵmod: ɵɵNgModuleDeclaration<ApplicationModule, never, never, never>;
  12204. static ɵinj: ɵɵInjectorDeclaration<ApplicationModule>;
  12205. }
  12206. /**
  12207. * Provides a hook for centralized exception handling.
  12208. *
  12209. * The default implementation of `ErrorHandler` prints error messages to the `console`. To
  12210. * intercept error handling, write a custom exception handler that replaces this default as
  12211. * appropriate for your app.
  12212. *
  12213. * @usageNotes
  12214. * ### Example
  12215. *
  12216. * ```ts
  12217. * class MyErrorHandler implements ErrorHandler {
  12218. * handleError(error) {
  12219. * // do something with the exception
  12220. * }
  12221. * }
  12222. *
  12223. * // Provide in standalone apps
  12224. * bootstrapApplication(AppComponent, {
  12225. * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
  12226. * })
  12227. *
  12228. * // Provide in module-based apps
  12229. * @NgModule({
  12230. * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
  12231. * })
  12232. * class MyModule {}
  12233. * ```
  12234. *
  12235. * @publicApi
  12236. */
  12237. declare class ErrorHandler {
  12238. handleError(error: any): void;
  12239. }
  12240. /**
  12241. * `InjectionToken` used to configure how to call the `ErrorHandler`.
  12242. *
  12243. * `NgZone` is provided by default today so the default (and only) implementation for this
  12244. * is calling `ErrorHandler.handleError` outside of the Angular zone.
  12245. */
  12246. declare const INTERNAL_APPLICATION_ERROR_HANDLER: InjectionToken<(e: any) => void>;
  12247. /**
  12248. * Internal create application API that implements the core application creation logic and optional
  12249. * bootstrap logic.
  12250. *
  12251. * Platforms (such as `platform-browser`) may require different set of application and platform
  12252. * providers for an application to function correctly. As a result, platforms may use this function
  12253. * internally and supply the necessary providers during the bootstrap, while exposing
  12254. * platform-specific APIs as a part of their public API.
  12255. *
  12256. * @returns A promise that returns an `ApplicationRef` instance once resolved.
  12257. */
  12258. declare function internalCreateApplication(config: {
  12259. rootComponent?: Type$1<unknown>;
  12260. appProviders?: Array<Provider | EnvironmentProviders>;
  12261. platformProviders?: Provider[];
  12262. }): Promise<ApplicationRef>;
  12263. declare class Console {
  12264. log(message: string): void;
  12265. warn(message: string): void;
  12266. static ɵfac: ɵɵFactoryDeclaration<Console, never>;
  12267. static ɵprov: ɵɵInjectableDeclaration<Console>;
  12268. }
  12269. /**
  12270. * Defer block instance for testing.
  12271. */
  12272. interface DeferBlockDetails extends DehydratedDeferBlock {
  12273. tDetails: TDeferBlockDetails;
  12274. }
  12275. /**
  12276. * Retrieves all defer blocks in a given LView.
  12277. *
  12278. * @param lView lView with defer blocks
  12279. * @param deferBlocks defer block aggregator array
  12280. */
  12281. declare function getDeferBlocks$1(lView: LView, deferBlocks: DeferBlockDetails[]): void;
  12282. /**
  12283. * **INTERNAL**, avoid referencing it in application code.
  12284. * *
  12285. * Injector token that allows to provide `DeferBlockDependencyInterceptor` class
  12286. * implementation.
  12287. *
  12288. * This token is only injected in devMode
  12289. */
  12290. declare const DEFER_BLOCK_DEPENDENCY_INTERCEPTOR: InjectionToken<DeferBlockDependencyInterceptor>;
  12291. /**
  12292. * **INTERNAL**, token used for configuring defer block behavior.
  12293. */
  12294. declare const DEFER_BLOCK_CONFIG: InjectionToken<DeferBlockConfig>;
  12295. /** Rendering Helpers */
  12296. /**
  12297. * Transitions a defer block to the new state. Updates the necessary
  12298. * data structures and renders corresponding block.
  12299. *
  12300. * @param newState New state that should be applied to the defer block.
  12301. * @param tNode TNode that represents a defer block.
  12302. * @param lContainer Represents an instance of a defer block.
  12303. * @param skipTimerScheduling Indicates that `@loading` and `@placeholder` block
  12304. * should be rendered immediately, even if they have `after` or `minimum` config
  12305. * options setup. This flag to needed for testing APIs to transition defer block
  12306. * between states via `DeferFixture.render` method.
  12307. */
  12308. declare function renderDeferBlockState(newState: DeferBlockState, tNode: TNode, lContainer: LContainer, skipTimerScheduling?: boolean): void;
  12309. /**
  12310. * Enables timer-related scheduling if `after` or `minimum` parameters are setup
  12311. * on the `@loading` or `@placeholder` blocks.
  12312. */
  12313. declare function ɵɵdeferEnableTimerScheduling(tView: TView, tDetails: TDeferBlockDetails, placeholderConfigIndex?: number | null, loadingConfigIndex?: number | null): void;
  12314. /**
  12315. * Trigger loading of defer block dependencies if the process hasn't started yet.
  12316. *
  12317. * @param tDetails Static information about this defer block.
  12318. * @param lView LView of a host view.
  12319. */
  12320. declare function triggerResourceLoading(tDetails: TDeferBlockDetails, lView: LView, tNode: TNode): Promise<unknown>;
  12321. /**
  12322. * URL for the XSS security documentation.
  12323. */
  12324. declare const XSS_SECURITY_URL = "https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss";
  12325. /**
  12326. * The list of error codes used in runtime code of the `core` package.
  12327. * Reserved error code range: 100-999.
  12328. *
  12329. * Note: the minus sign denotes the fact that a particular code has a detailed guide on
  12330. * angular.io. This extra annotation is needed to avoid introducing a separate set to store
  12331. * error codes which have guides, which might leak into runtime code.
  12332. *
  12333. * Full list of available error guides can be found at https://angular.dev/errors.
  12334. *
  12335. * Error code ranges per package:
  12336. * - core (this package): 100-999
  12337. * - forms: 1000-1999
  12338. * - common: 2000-2999
  12339. * - animations: 3000-3999
  12340. * - router: 4000-4999
  12341. * - platform-browser: 5000-5500
  12342. */
  12343. declare const enum RuntimeErrorCode {
  12344. EXPRESSION_CHANGED_AFTER_CHECKED = -100,
  12345. RECURSIVE_APPLICATION_REF_TICK = 101,
  12346. INFINITE_CHANGE_DETECTION = 103,
  12347. CYCLIC_DI_DEPENDENCY = -200,
  12348. PROVIDER_NOT_FOUND = -201,
  12349. INVALID_FACTORY_DEPENDENCY = 202,
  12350. MISSING_INJECTION_CONTEXT = -203,
  12351. INVALID_INJECTION_TOKEN = 204,
  12352. INJECTOR_ALREADY_DESTROYED = 205,
  12353. PROVIDER_IN_WRONG_CONTEXT = 207,
  12354. MISSING_INJECTION_TOKEN = 208,
  12355. INVALID_MULTI_PROVIDER = -209,
  12356. MISSING_DOCUMENT = 210,
  12357. MULTIPLE_COMPONENTS_MATCH = -300,
  12358. EXPORT_NOT_FOUND = -301,
  12359. PIPE_NOT_FOUND = -302,
  12360. UNKNOWN_BINDING = 303,
  12361. UNKNOWN_ELEMENT = 304,
  12362. TEMPLATE_STRUCTURE_ERROR = 305,
  12363. INVALID_EVENT_BINDING = 306,
  12364. HOST_DIRECTIVE_UNRESOLVABLE = 307,
  12365. HOST_DIRECTIVE_NOT_STANDALONE = 308,
  12366. DUPLICATE_DIRECTIVE = 309,
  12367. HOST_DIRECTIVE_COMPONENT = 310,
  12368. HOST_DIRECTIVE_UNDEFINED_BINDING = 311,
  12369. HOST_DIRECTIVE_CONFLICTING_ALIAS = 312,
  12370. MULTIPLE_MATCHING_PIPES = 313,
  12371. UNINITIALIZED_LET_ACCESS = 314,
  12372. MULTIPLE_PLATFORMS = 400,
  12373. PLATFORM_NOT_FOUND = 401,
  12374. MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP = 402,
  12375. BOOTSTRAP_COMPONENTS_NOT_FOUND = -403,
  12376. PLATFORM_ALREADY_DESTROYED = 404,
  12377. ASYNC_INITIALIZERS_STILL_RUNNING = 405,
  12378. APPLICATION_REF_ALREADY_DESTROYED = 406,
  12379. RENDERER_NOT_FOUND = 407,
  12380. PROVIDED_BOTH_ZONE_AND_ZONELESS = 408,
  12381. HYDRATION_NODE_MISMATCH = -500,
  12382. HYDRATION_MISSING_SIBLINGS = -501,
  12383. HYDRATION_MISSING_NODE = -502,
  12384. UNSUPPORTED_PROJECTION_DOM_NODES = -503,
  12385. INVALID_SKIP_HYDRATION_HOST = -504,
  12386. MISSING_HYDRATION_ANNOTATIONS = -505,
  12387. HYDRATION_STABLE_TIMEDOUT = -506,
  12388. MISSING_SSR_CONTENT_INTEGRITY_MARKER = -507,
  12389. MISCONFIGURED_INCREMENTAL_HYDRATION = 508,
  12390. SIGNAL_WRITE_FROM_ILLEGAL_CONTEXT = 600,
  12391. REQUIRE_SYNC_WITHOUT_SYNC_EMIT = 601,
  12392. ASSERTION_NOT_INSIDE_REACTIVE_CONTEXT = -602,
  12393. INVALID_I18N_STRUCTURE = 700,
  12394. MISSING_LOCALE_DATA = 701,
  12395. DEFER_LOADING_FAILED = -750,
  12396. IMPORT_PROVIDERS_FROM_STANDALONE = 800,
  12397. INVALID_DIFFER_INPUT = 900,
  12398. NO_SUPPORTING_DIFFER_FACTORY = 901,
  12399. VIEW_ALREADY_ATTACHED = 902,
  12400. INVALID_INHERITANCE = 903,
  12401. UNSAFE_VALUE_IN_RESOURCE_URL = 904,
  12402. UNSAFE_VALUE_IN_SCRIPT = 905,
  12403. MISSING_GENERATED_DEF = 906,
  12404. TYPE_IS_NOT_STANDALONE = 907,
  12405. MISSING_ZONEJS = 908,
  12406. UNEXPECTED_ZONE_STATE = 909,
  12407. UNSAFE_IFRAME_ATTRS = -910,
  12408. VIEW_ALREADY_DESTROYED = 911,
  12409. COMPONENT_ID_COLLISION = -912,
  12410. IMAGE_PERFORMANCE_WARNING = -913,
  12411. UNEXPECTED_ZONEJS_PRESENT_IN_ZONELESS_MODE = 914,
  12412. REQUIRED_INPUT_NO_VALUE = -950,
  12413. REQUIRED_QUERY_NO_VALUE = -951,
  12414. REQUIRED_MODEL_NO_VALUE = 952,
  12415. OUTPUT_REF_DESTROYED = 953,
  12416. LOOP_TRACK_DUPLICATE_KEYS = -955,
  12417. LOOP_TRACK_RECREATE = -956,
  12418. RUNTIME_DEPS_INVALID_IMPORTED_TYPE = 980,
  12419. RUNTIME_DEPS_ORPHAN_COMPONENT = 981
  12420. }
  12421. /**
  12422. * Class that represents a runtime error.
  12423. * Formats and outputs the error message in a consistent way.
  12424. *
  12425. * Example:
  12426. * ```ts
  12427. * throw new RuntimeError(
  12428. * RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED,
  12429. * ngDevMode && 'Injector has already been destroyed.');
  12430. * ```
  12431. *
  12432. * Note: the `message` argument contains a descriptive error message as a string in development
  12433. * mode (when the `ngDevMode` is defined). In production mode (after tree-shaking pass), the
  12434. * `message` argument becomes `false`, thus we account for it in the typings and the runtime
  12435. * logic.
  12436. */
  12437. declare class RuntimeError<T extends number = RuntimeErrorCode> extends Error {
  12438. code: T;
  12439. constructor(code: T, message: null | false | string);
  12440. }
  12441. /**
  12442. * Called to format a runtime error.
  12443. * See additional info on the `message` argument type in the `RuntimeError` class description.
  12444. */
  12445. declare function formatRuntimeError<T extends number = RuntimeErrorCode>(code: T, message: null | false | string): string;
  12446. /**
  12447. * A type-safe key to use with `TransferState`.
  12448. *
  12449. * Example:
  12450. *
  12451. * ```ts
  12452. * const COUNTER_KEY = makeStateKey<number>('counter');
  12453. * let value = 10;
  12454. *
  12455. * transferState.set(COUNTER_KEY, value);
  12456. * ```
  12457. *
  12458. * @publicApi
  12459. */
  12460. type StateKey<T> = string & {
  12461. __not_a_string: never;
  12462. __value_type?: T;
  12463. };
  12464. /**
  12465. * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
  12466. *
  12467. * Example:
  12468. *
  12469. * ```ts
  12470. * const COUNTER_KEY = makeStateKey<number>('counter');
  12471. * let value = 10;
  12472. *
  12473. * transferState.set(COUNTER_KEY, value);
  12474. * ```
  12475. *
  12476. * @publicApi
  12477. */
  12478. declare function makeStateKey<T = void>(key: string): StateKey<T>;
  12479. /**
  12480. * A key value store that is transferred from the application on the server side to the application
  12481. * on the client side.
  12482. *
  12483. * The `TransferState` is available as an injectable token.
  12484. * On the client, just inject this token using DI and use it, it will be lazily initialized.
  12485. * On the server it's already included if `renderApplication` function is used. Otherwise, import
  12486. * the `ServerTransferStateModule` module to make the `TransferState` available.
  12487. *
  12488. * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
  12489. * boolean, number, string, null and non-class objects will be serialized and deserialized in a
  12490. * non-lossy manner.
  12491. *
  12492. * @publicApi
  12493. */
  12494. declare class TransferState {
  12495. /** @nocollapse */
  12496. static ɵprov: unknown;
  12497. private onSerializeCallbacks;
  12498. /**
  12499. * Get the value corresponding to a key. Return `defaultValue` if key is not found.
  12500. */
  12501. get<T>(key: StateKey<T>, defaultValue: T): T;
  12502. /**
  12503. * Set the value corresponding to a key.
  12504. */
  12505. set<T>(key: StateKey<T>, value: T): void;
  12506. /**
  12507. * Remove a key from the store.
  12508. */
  12509. remove<T>(key: StateKey<T>): void;
  12510. /**
  12511. * Test whether a key exists in the store.
  12512. */
  12513. hasKey<T>(key: StateKey<T>): boolean;
  12514. /**
  12515. * Indicates whether the state is empty.
  12516. */
  12517. get isEmpty(): boolean;
  12518. /**
  12519. * Register a callback to provide the value for a key when `toJson` is called.
  12520. */
  12521. onSerialize<T>(key: StateKey<T>, callback: () => T): void;
  12522. /**
  12523. * Serialize the current state of the store to JSON.
  12524. */
  12525. toJson(): string;
  12526. }
  12527. /**
  12528. * Marker used in a comment node to ensure hydration content integrity
  12529. */
  12530. declare const SSR_CONTENT_INTEGRITY_MARKER = "nghm";
  12531. /**
  12532. * Internal type that represents a claimed node.
  12533. * Only used in dev mode.
  12534. */
  12535. declare enum HydrationStatus {
  12536. Hydrated = "hydrated",
  12537. Skipped = "skipped",
  12538. Mismatched = "mismatched"
  12539. }
  12540. type HydrationInfo = {
  12541. status: HydrationStatus.Hydrated | HydrationStatus.Skipped;
  12542. } | {
  12543. status: HydrationStatus.Mismatched;
  12544. actualNodeDetails: string | null;
  12545. expectedNodeDetails: string | null;
  12546. };
  12547. declare const HYDRATION_INFO_KEY = "__ngDebugHydrationInfo__";
  12548. type HydratedNode = {
  12549. [HYDRATION_INFO_KEY]?: HydrationInfo;
  12550. };
  12551. declare function readHydrationInfo(node: RNode): HydrationInfo | null;
  12552. /**
  12553. * Annotates all components bootstrapped in a given ApplicationRef
  12554. * with info needed for hydration.
  12555. *
  12556. * @param appRef An instance of an ApplicationRef.
  12557. * @param doc A reference to the current Document instance.
  12558. * @return event types that need to be replayed
  12559. */
  12560. declare function annotateForHydration(appRef: ApplicationRef, doc: Document): {
  12561. regular: Set<string>;
  12562. capture: Set<string>;
  12563. };
  12564. /**
  12565. * Returns a set of providers required to setup hydration support
  12566. * for an application that is server side rendered. This function is
  12567. * included into the `provideClientHydration` public API function from
  12568. * the `platform-browser` package.
  12569. *
  12570. * The function sets up an internal flag that would be recognized during
  12571. * the server side rendering time as well, so there is no need to
  12572. * configure or change anything in NgUniversal to enable the feature.
  12573. */
  12574. declare function withDomHydration(): EnvironmentProviders;
  12575. /**
  12576. * Returns a set of providers required to setup support for i18n hydration.
  12577. * Requires hydration to be enabled separately.
  12578. */
  12579. declare function withI18nSupport(): Provider[];
  12580. /**
  12581. * Returns a set of providers required to setup support for incremental hydration.
  12582. * Requires hydration to be enabled separately.
  12583. * Enabling incremental hydration also enables event replay for the entire app.
  12584. *
  12585. * @developerPreview
  12586. */
  12587. declare function withIncrementalHydration(): Provider[];
  12588. /**
  12589. * Returns a set of providers required to setup support for event replay.
  12590. * Requires hydration to be enabled separately.
  12591. */
  12592. declare function withEventReplay(): Provider[];
  12593. declare global {
  12594. interface Element {
  12595. __jsaction_fns: Map<string, Function[]> | undefined;
  12596. }
  12597. }
  12598. interface EventContractDetails {
  12599. instance?: EventContract;
  12600. }
  12601. declare const JSACTION_EVENT_CONTRACT: InjectionToken<EventContractDetails>;
  12602. /**
  12603. * Internal token that specifies whether DOM reuse logic
  12604. * during hydration is enabled.
  12605. */
  12606. declare const IS_HYDRATION_DOM_REUSE_ENABLED: InjectionToken<boolean>;
  12607. /**
  12608. * Internal token that indicates whether incremental hydration support
  12609. * is enabled.
  12610. */
  12611. declare const IS_INCREMENTAL_HYDRATION_ENABLED: InjectionToken<boolean>;
  12612. /**
  12613. * Register locale data to be used internally by Angular. See the
  12614. * ["I18n guide"](guide/i18n/format-data-locale) to know how to import additional locale
  12615. * data.
  12616. *
  12617. * The signature `registerLocaleData(data: any, extraData?: any)` is deprecated since v5.1
  12618. */
  12619. declare function registerLocaleData(data: any, localeId?: string | any, extraData?: any): void;
  12620. /**
  12621. * Finds the locale data for a given locale.
  12622. *
  12623. * @param locale The locale code.
  12624. * @returns The locale data.
  12625. * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
  12626. */
  12627. declare function findLocaleData(locale: string): any;
  12628. /**
  12629. * Retrieves the default currency code for the given locale.
  12630. *
  12631. * The default is defined as the first currency which is still in use.
  12632. *
  12633. * @param locale The code of the locale whose currency code we want.
  12634. * @returns The code of the default currency for the given locale.
  12635. *
  12636. */
  12637. declare function getLocaleCurrencyCode(locale: string): string | null;
  12638. /**
  12639. * Retrieves the plural function used by ICU expressions to determine the plural case to use
  12640. * for a given locale.
  12641. * @param locale A locale code for the locale format rules to use.
  12642. * @returns The plural function for the locale.
  12643. * @see {@link NgPlural}
  12644. * @see [Internationalization (i18n) Guide](guide/i18n)
  12645. */
  12646. declare function getLocalePluralCase(locale: string): (value: number) => number;
  12647. /**
  12648. * Helper function to remove all the locale data from `LOCALE_DATA`.
  12649. */
  12650. declare function unregisterAllLocaleData(): void;
  12651. /**
  12652. * Index of each type of locale data from the locale data array
  12653. */
  12654. declare enum LocaleDataIndex {
  12655. LocaleId = 0,
  12656. DayPeriodsFormat = 1,
  12657. DayPeriodsStandalone = 2,
  12658. DaysFormat = 3,
  12659. DaysStandalone = 4,
  12660. MonthsFormat = 5,
  12661. MonthsStandalone = 6,
  12662. Eras = 7,
  12663. FirstDayOfWeek = 8,
  12664. WeekendRange = 9,
  12665. DateFormat = 10,
  12666. TimeFormat = 11,
  12667. DateTimeFormat = 12,
  12668. NumberSymbols = 13,
  12669. NumberFormats = 14,
  12670. CurrencyCode = 15,
  12671. CurrencySymbol = 16,
  12672. CurrencyName = 17,
  12673. Currencies = 18,
  12674. Directionality = 19,
  12675. PluralCase = 20,
  12676. ExtraData = 21
  12677. }
  12678. /**
  12679. * Index of each type of locale data from the extra locale data array
  12680. */
  12681. declare const enum ExtraLocaleDataIndex {
  12682. ExtraDayPeriodFormats = 0,
  12683. ExtraDayPeriodStandalone = 1,
  12684. ExtraDayPeriodsRules = 2
  12685. }
  12686. /**
  12687. * Index of each value in currency data (used to describe CURRENCIES_EN in currencies.ts)
  12688. */
  12689. declare const enum CurrencyIndex {
  12690. Symbol = 0,
  12691. SymbolNarrow = 1,
  12692. NbOfDigits = 2
  12693. }
  12694. /**
  12695. * The locale id that the application is using by default (for translations and ICU expressions).
  12696. */
  12697. declare const DEFAULT_LOCALE_ID = "en-US";
  12698. /**
  12699. * Used to resolve resource URLs on `@Component` when used with JIT compilation.
  12700. *
  12701. * Example:
  12702. * ```ts
  12703. * @Component({
  12704. * selector: 'my-comp',
  12705. * templateUrl: 'my-comp.html', // This requires asynchronous resolution
  12706. * })
  12707. * class MyComponent{
  12708. * }
  12709. *
  12710. * // Calling `renderComponent` will fail because `renderComponent` is a synchronous process
  12711. * // and `MyComponent`'s `@Component.templateUrl` needs to be resolved asynchronously.
  12712. *
  12713. * // Calling `resolveComponentResources()` will resolve `@Component.templateUrl` into
  12714. * // `@Component.template`, which allows `renderComponent` to proceed in a synchronous manner.
  12715. *
  12716. * // Use browser's `fetch()` function as the default resource resolution strategy.
  12717. * resolveComponentResources(fetch).then(() => {
  12718. * // After resolution all URLs have been converted into `template` strings.
  12719. * renderComponent(MyComponent);
  12720. * });
  12721. *
  12722. * ```
  12723. *
  12724. * NOTE: In AOT the resolution happens during compilation, and so there should be no need
  12725. * to call this method outside JIT mode.
  12726. *
  12727. * @param resourceResolver a function which is responsible for returning a `Promise` to the
  12728. * contents of the resolved URL. Browser's `fetch()` method is a good default implementation.
  12729. */
  12730. declare function resolveComponentResources(resourceResolver: (url: string) => Promise<string | {
  12731. text(): Promise<string>;
  12732. }>): Promise<void>;
  12733. declare function isComponentDefPendingResolution(type: Type$1<any>): boolean;
  12734. declare function clearResolutionOfComponentResourcesQueue(): Map<Type$1<any>, Component>;
  12735. declare function restoreComponentResolutionQueue(queue: Map<Type$1<any>, Component>): void;
  12736. /**
  12737. * InjectionToken to control root component bootstrap behavior.
  12738. *
  12739. * This token is primarily used in Angular's server-side rendering (SSR) scenarios,
  12740. * particularly by the `@angular/ssr` package, to manage whether the root component
  12741. * should be bootstrapped during the application initialization process.
  12742. *
  12743. * ## Purpose:
  12744. * During SSR route extraction, setting this token to `false` prevents Angular from
  12745. * bootstrapping the root component. This avoids unnecessary component rendering,
  12746. * enabling route extraction without requiring additional APIs or triggering
  12747. * component logic.
  12748. *
  12749. * ## Behavior:
  12750. * - **`false`**: Prevents the root component from being bootstrapped.
  12751. * - **`true`** (default): Proceeds with the normal root component bootstrap process.
  12752. *
  12753. * This mechanism ensures SSR can efficiently separate route extraction logic
  12754. * from component rendering.
  12755. */
  12756. declare const ENABLE_ROOT_COMPONENT_BOOTSTRAP: InjectionToken<boolean>;
  12757. interface PlatformReflectionCapabilities {
  12758. factory(type: Type$1<any>): Function;
  12759. hasLifecycleHook(type: any, lcProperty: string): boolean;
  12760. /**
  12761. * Return a list of annotations/types for constructor parameters
  12762. */
  12763. parameters(type: Type$1<any>): any[][];
  12764. /**
  12765. * Return a list of annotations declared on the class
  12766. */
  12767. annotations(type: Type$1<any>): any[];
  12768. /**
  12769. * Return a object literal which describes the annotations on Class fields/properties.
  12770. */
  12771. propMetadata(typeOrFunc: Type$1<any>): {
  12772. [key: string]: any[];
  12773. };
  12774. }
  12775. declare class ReflectionCapabilities implements PlatformReflectionCapabilities {
  12776. private _reflect;
  12777. constructor(reflect?: any);
  12778. factory<T>(t: Type$1<T>): (args: any[]) => T;
  12779. private _ownParameters;
  12780. parameters(type: Type$1<any>): any[][];
  12781. private _ownAnnotations;
  12782. annotations(typeOrFunc: Type$1<any>): any[];
  12783. private _ownPropMetadata;
  12784. propMetadata(typeOrFunc: any): {
  12785. [key: string]: any[];
  12786. };
  12787. ownPropMetadata(typeOrFunc: any): {
  12788. [key: string]: any[];
  12789. };
  12790. hasLifecycleHook(type: any, lcProperty: string): boolean;
  12791. }
  12792. /**
  12793. * An object that defines an injection context for the injector profiler.
  12794. */
  12795. interface InjectorProfilerContext {
  12796. /**
  12797. * The Injector that service is being injected into.
  12798. * - Example: if ModuleA --provides--> ServiceA --injects--> ServiceB
  12799. * then inject(ServiceB) in ServiceA has ModuleA as an injector context
  12800. */
  12801. injector: Injector;
  12802. /**
  12803. * The class where the constructor that is calling `inject` is located
  12804. * - Example: if ModuleA --provides--> ServiceA --injects--> ServiceB
  12805. * then inject(ServiceB) in ServiceA has ServiceA as a construction context
  12806. */
  12807. token: Type$1<unknown> | null;
  12808. }
  12809. /**
  12810. * An object that contains information about a provider that has been configured
  12811. *
  12812. * TODO: rename to indicate that it is a debug structure eg. ProviderDebugInfo.
  12813. */
  12814. interface ProviderRecord {
  12815. /**
  12816. * DI token that this provider is configuring
  12817. */
  12818. token: Type$1<unknown> | InjectionToken<unknown>;
  12819. /**
  12820. * Determines if provider is configured as view provider.
  12821. */
  12822. isViewProvider: boolean;
  12823. /**
  12824. * The raw provider associated with this ProviderRecord.
  12825. */
  12826. provider: SingleProvider;
  12827. /**
  12828. * The path of DI containers that were followed to import this provider
  12829. */
  12830. importPath?: Type$1<unknown>[];
  12831. }
  12832. /**
  12833. * An object that contains information a service that has been injected within an
  12834. * InjectorProfilerContext
  12835. */
  12836. interface InjectedService {
  12837. /**
  12838. * DI token of the Service that is injected
  12839. */
  12840. token?: Type$1<unknown> | InjectionToken<unknown>;
  12841. /**
  12842. * Value of the injected service
  12843. */
  12844. value: unknown;
  12845. /**
  12846. * Flags that this service was injected with
  12847. */
  12848. flags?: InternalInjectFlags | InjectFlags | InjectOptions;
  12849. /**
  12850. * Injector that this service was provided in.
  12851. */
  12852. providedIn?: Injector;
  12853. /**
  12854. * In NodeInjectors, the LView and TNode that serviced this injection.
  12855. */
  12856. injectedIn?: {
  12857. lView: LView;
  12858. tNode: TNode;
  12859. };
  12860. }
  12861. declare function setInjectorProfilerContext(context: InjectorProfilerContext): InjectorProfilerContext;
  12862. declare const enum BypassType {
  12863. Url = "URL",
  12864. Html = "HTML",
  12865. ResourceUrl = "ResourceURL",
  12866. Script = "Script",
  12867. Style = "Style"
  12868. }
  12869. /**
  12870. * Marker interface for a value that's safe to use in a particular context.
  12871. *
  12872. * @publicApi
  12873. */
  12874. interface SafeValue {
  12875. }
  12876. /**
  12877. * Marker interface for a value that's safe to use as HTML.
  12878. *
  12879. * @publicApi
  12880. */
  12881. interface SafeHtml extends SafeValue {
  12882. }
  12883. /**
  12884. * Marker interface for a value that's safe to use as style (CSS).
  12885. *
  12886. * @publicApi
  12887. */
  12888. interface SafeStyle extends SafeValue {
  12889. }
  12890. /**
  12891. * Marker interface for a value that's safe to use as JavaScript.
  12892. *
  12893. * @publicApi
  12894. */
  12895. interface SafeScript extends SafeValue {
  12896. }
  12897. /**
  12898. * Marker interface for a value that's safe to use as a URL linking to a document.
  12899. *
  12900. * @publicApi
  12901. */
  12902. interface SafeUrl extends SafeValue {
  12903. }
  12904. /**
  12905. * Marker interface for a value that's safe to use as a URL to load executable code from.
  12906. *
  12907. * @publicApi
  12908. */
  12909. interface SafeResourceUrl extends SafeValue {
  12910. }
  12911. declare function unwrapSafeValue(value: SafeValue): string;
  12912. declare function unwrapSafeValue<T>(value: T): T;
  12913. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Html): value is SafeHtml;
  12914. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.ResourceUrl): value is SafeResourceUrl;
  12915. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Script): value is SafeScript;
  12916. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Style): value is SafeStyle;
  12917. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Url): value is SafeUrl;
  12918. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType): boolean;
  12919. declare function getSanitizationBypassType(value: any): BypassType | null;
  12920. /**
  12921. * Mark `html` string as trusted.
  12922. *
  12923. * This function wraps the trusted string in `String` and brands it in a way which makes it
  12924. * recognizable to {@link htmlSanitizer} to be trusted implicitly.
  12925. *
  12926. * @param trustedHtml `html` string which needs to be implicitly trusted.
  12927. * @returns a `html` which has been branded to be implicitly trusted.
  12928. */
  12929. declare function bypassSanitizationTrustHtml(trustedHtml: string): SafeHtml;
  12930. /**
  12931. * Mark `style` string as trusted.
  12932. *
  12933. * This function wraps the trusted string in `String` and brands it in a way which makes it
  12934. * recognizable to {@link styleSanitizer} to be trusted implicitly.
  12935. *
  12936. * @param trustedStyle `style` string which needs to be implicitly trusted.
  12937. * @returns a `style` hich has been branded to be implicitly trusted.
  12938. */
  12939. declare function bypassSanitizationTrustStyle(trustedStyle: string): SafeStyle;
  12940. /**
  12941. * Mark `script` string as trusted.
  12942. *
  12943. * This function wraps the trusted string in `String` and brands it in a way which makes it
  12944. * recognizable to {@link scriptSanitizer} to be trusted implicitly.
  12945. *
  12946. * @param trustedScript `script` string which needs to be implicitly trusted.
  12947. * @returns a `script` which has been branded to be implicitly trusted.
  12948. */
  12949. declare function bypassSanitizationTrustScript(trustedScript: string): SafeScript;
  12950. /**
  12951. * Mark `url` string as trusted.
  12952. *
  12953. * This function wraps the trusted string in `String` and brands it in a way which makes it
  12954. * recognizable to {@link urlSanitizer} to be trusted implicitly.
  12955. *
  12956. * @param trustedUrl `url` string which needs to be implicitly trusted.
  12957. * @returns a `url` which has been branded to be implicitly trusted.
  12958. */
  12959. declare function bypassSanitizationTrustUrl(trustedUrl: string): SafeUrl;
  12960. /**
  12961. * Mark `url` string as trusted.
  12962. *
  12963. * This function wraps the trusted string in `String` and brands it in a way which makes it
  12964. * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.
  12965. *
  12966. * @param trustedResourceUrl `url` string which needs to be implicitly trusted.
  12967. * @returns a `url` which has been branded to be implicitly trusted.
  12968. */
  12969. declare function bypassSanitizationTrustResourceUrl(trustedResourceUrl: string): SafeResourceUrl;
  12970. /**
  12971. * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to
  12972. * the DOM in a browser environment.
  12973. */
  12974. declare function _sanitizeHtml(defaultDoc: any, unsafeHtmlInput: string): TrustedHTML | string;
  12975. declare function _sanitizeUrl(url: string): string;
  12976. /**
  12977. * Transforms a value (typically a string) to a boolean.
  12978. * Intended to be used as a transform function of an input.
  12979. *
  12980. * @usageNotes
  12981. * ```ts
  12982. * @Input({ transform: booleanAttribute }) status!: boolean;
  12983. * ```
  12984. * @param value Value to be transformed.
  12985. *
  12986. * @publicApi
  12987. */
  12988. declare function booleanAttribute(value: unknown): boolean;
  12989. /**
  12990. * Transforms a value (typically a string) to a number.
  12991. * Intended to be used as a transform function of an input.
  12992. * @param value Value to be transformed.
  12993. * @param fallbackValue Value to use if the provided value can't be parsed as a number.
  12994. *
  12995. * @usageNotes
  12996. * ```ts
  12997. * @Input({ transform: numberAttribute }) id!: number;
  12998. * ```
  12999. *
  13000. * @publicApi
  13001. */
  13002. declare function numberAttribute(value: unknown, fallbackValue?: number): number;
  13003. declare const _global: any;
  13004. /**
  13005. * Determine if the argument is shaped like a Promise
  13006. */
  13007. declare function isPromise<T = any>(obj: any): obj is Promise<T>;
  13008. /**
  13009. * Determine if the argument is a Subscribable
  13010. */
  13011. declare function isSubscribable<T>(obj: any | Subscribable<T>): obj is Subscribable<T>;
  13012. /**
  13013. * A guarded `performance.mark` for feature marking.
  13014. *
  13015. * This method exists because while all supported browser and node.js version supported by Angular
  13016. * support performance.mark API. This is not the case for other environments such as JSDOM and
  13017. * Cloudflare workers.
  13018. */
  13019. declare function performanceMarkFeature(feature: string): void;
  13020. declare function stringify(token: any): string;
  13021. /**
  13022. * Ellipses the string in the middle when longer than the max length
  13023. *
  13024. * @param string
  13025. * @param maxLength of the output string
  13026. * @returns ellipsed string with ... in the middle
  13027. */
  13028. declare function truncateMiddle(str: string, maxLength?: number): string;
  13029. declare const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR: {};
  13030. declare const PERFORMANCE_MARK_PREFIX = "\uD83C\uDD70\uFE0F";
  13031. /**
  13032. * Function that will start measuring against the performance API
  13033. * Should be used in pair with stopMeasuring
  13034. */
  13035. declare function startMeasuring<T>(label: string): void;
  13036. /**
  13037. * Function that will stop measuring against the performance API
  13038. * Should be used in pair with stopMeasuring
  13039. */
  13040. declare function stopMeasuring(label: string): void;
  13041. /**
  13042. * This enables an internal performance profiler
  13043. *
  13044. * It should not be imported in application code
  13045. */
  13046. declare function enableProfiling(): void;
  13047. declare function disableProfiling(): void;
  13048. /**
  13049. * Status of a `Resource`.
  13050. *
  13051. * @experimental
  13052. */
  13053. declare enum ResourceStatus {
  13054. /**
  13055. * The resource has no valid request and will not perform any loading.
  13056. *
  13057. * `value()` will be `undefined`.
  13058. */
  13059. Idle = 0,
  13060. /**
  13061. * Loading failed with an error.
  13062. *
  13063. * `value()` will be `undefined`.
  13064. */
  13065. Error = 1,
  13066. /**
  13067. * The resource is currently loading a new value as a result of a change in its `request`.
  13068. *
  13069. * `value()` will be `undefined`.
  13070. */
  13071. Loading = 2,
  13072. /**
  13073. * The resource is currently reloading a fresh value for the same request.
  13074. *
  13075. * `value()` will continue to return the previously fetched value during the reloading operation.
  13076. */
  13077. Reloading = 3,
  13078. /**
  13079. * Loading has completed and the resource has the value returned from the loader.
  13080. */
  13081. Resolved = 4,
  13082. /**
  13083. * The resource's value was set locally via `.set()` or `.update()`.
  13084. */
  13085. Local = 5
  13086. }
  13087. /**
  13088. * A Resource is an asynchronous dependency (for example, the results of an API call) that is
  13089. * managed and delivered through signals.
  13090. *
  13091. * The usual way of creating a `Resource` is through the `resource` function, but various other APIs
  13092. * may present `Resource` instances to describe their own concepts.
  13093. *
  13094. * @experimental
  13095. */
  13096. interface Resource<T> {
  13097. /**
  13098. * The current value of the `Resource`, or `undefined` if there is no current value.
  13099. */
  13100. readonly value: Signal<T>;
  13101. /**
  13102. * The current status of the `Resource`, which describes what the resource is currently doing and
  13103. * what can be expected of its `value`.
  13104. */
  13105. readonly status: Signal<ResourceStatus>;
  13106. /**
  13107. * When in the `error` state, this returns the last known error from the `Resource`.
  13108. */
  13109. readonly error: Signal<unknown>;
  13110. /**
  13111. * Whether this resource is loading a new value (or reloading the existing one).
  13112. */
  13113. readonly isLoading: Signal<boolean>;
  13114. /**
  13115. * Whether this resource has a valid current value.
  13116. *
  13117. * This function is reactive.
  13118. */
  13119. hasValue(): this is Resource<Exclude<T, undefined>>;
  13120. /**
  13121. * Instructs the resource to re-load any asynchronous dependency it may have.
  13122. *
  13123. * Note that the resource will not enter its reloading state until the actual backend request is
  13124. * made.
  13125. *
  13126. * @returns true if a reload was initiated, false if a reload was unnecessary or unsupported
  13127. */
  13128. reload(): boolean;
  13129. }
  13130. /**
  13131. * A `Resource` with a mutable value.
  13132. *
  13133. * Overwriting the value of a resource sets it to the 'local' state.
  13134. *
  13135. * @experimental
  13136. */
  13137. interface WritableResource<T> extends Resource<T> {
  13138. readonly value: WritableSignal<T>;
  13139. hasValue(): this is WritableResource<Exclude<T, undefined>>;
  13140. /**
  13141. * Convenience wrapper for `value.set`.
  13142. */
  13143. set(value: T): void;
  13144. /**
  13145. * Convenience wrapper for `value.update`.
  13146. */
  13147. update(updater: (value: T) => T): void;
  13148. asReadonly(): Resource<T>;
  13149. }
  13150. /**
  13151. * A `WritableResource` created through the `resource` function.
  13152. *
  13153. * @experimental
  13154. */
  13155. interface ResourceRef<T> extends WritableResource<T> {
  13156. hasValue(): this is ResourceRef<Exclude<T, undefined>>;
  13157. /**
  13158. * Manually destroy the resource, which cancels pending requests and returns it to `idle` state.
  13159. */
  13160. destroy(): void;
  13161. }
  13162. /**
  13163. * Parameter to a `ResourceLoader` which gives the request and other options for the current loading
  13164. * operation.
  13165. *
  13166. * @experimental
  13167. */
  13168. interface ResourceLoaderParams<R> {
  13169. request: Exclude<NoInfer<R>, undefined>;
  13170. abortSignal: AbortSignal;
  13171. previous: {
  13172. status: ResourceStatus;
  13173. };
  13174. }
  13175. /**
  13176. * Loading function for a `Resource`.
  13177. *
  13178. * @experimental
  13179. */
  13180. type ResourceLoader<T, R> = (param: ResourceLoaderParams<R>) => PromiseLike<T>;
  13181. /**
  13182. * Streaming loader for a `Resource`.
  13183. *
  13184. * @experimental
  13185. */
  13186. type ResourceStreamingLoader<T, R> = (param: ResourceLoaderParams<R>) => PromiseLike<Signal<ResourceStreamItem<T>>>;
  13187. /**
  13188. * Options to the `resource` function, for creating a resource.
  13189. *
  13190. * @experimental
  13191. */
  13192. interface BaseResourceOptions<T, R> {
  13193. /**
  13194. * A reactive function which determines the request to be made. Whenever the request changes, the
  13195. * loader will be triggered to fetch a new value for the resource.
  13196. *
  13197. * If a request function isn't provided, the loader won't rerun unless the resource is reloaded.
  13198. */
  13199. request?: () => R;
  13200. /**
  13201. * The value which will be returned from the resource when a server value is unavailable, such as
  13202. * when the resource is still loading, or in an error state.
  13203. */
  13204. defaultValue?: NoInfer<T>;
  13205. /**
  13206. * Equality function used to compare the return value of the loader.
  13207. */
  13208. equal?: ValueEqualityFn<T>;
  13209. /**
  13210. * Overrides the `Injector` used by `resource`.
  13211. */
  13212. injector?: Injector;
  13213. }
  13214. /**
  13215. * Options to the `resource` function, for creating a resource.
  13216. *
  13217. * @experimental
  13218. */
  13219. interface PromiseResourceOptions<T, R> extends BaseResourceOptions<T, R> {
  13220. /**
  13221. * Loading function which returns a `Promise` of the resource's value for a given request.
  13222. */
  13223. loader: ResourceLoader<T, R>;
  13224. /**
  13225. * Cannot specify `stream` and `loader` at the same time.
  13226. */
  13227. stream?: never;
  13228. }
  13229. /**
  13230. * Options to the `resource` function, for creating a resource.
  13231. *
  13232. * @experimental
  13233. */
  13234. interface StreamingResourceOptions<T, R> extends BaseResourceOptions<T, R> {
  13235. /**
  13236. * Loading function which returns a `Promise` of a signal of the resource's value for a given
  13237. * request, which can change over time as new values are received from a stream.
  13238. */
  13239. stream: ResourceStreamingLoader<T, R>;
  13240. /**
  13241. * Cannot specify `stream` and `loader` at the same time.
  13242. */
  13243. loader?: never;
  13244. }
  13245. /**
  13246. * @experimental
  13247. */
  13248. type ResourceOptions<T, R> = PromiseResourceOptions<T, R> | StreamingResourceOptions<T, R>;
  13249. /**
  13250. * @experimental
  13251. */
  13252. type ResourceStreamItem<T> = {
  13253. value: T;
  13254. } | {
  13255. error: unknown;
  13256. };
  13257. /**
  13258. * Constructs a `Resource` that projects a reactive request to an asynchronous operation defined by
  13259. * a loader function, which exposes the result of the loading operation via signals.
  13260. *
  13261. * Note that `resource` is intended for _read_ operations, not operations which perform mutations.
  13262. * `resource` will cancel in-progress loads via the `AbortSignal` when destroyed or when a new
  13263. * request object becomes available, which could prematurely abort mutations.
  13264. *
  13265. * @experimental
  13266. */
  13267. declare function resource<T, R>(options: ResourceOptions<T, R> & {
  13268. defaultValue: NoInfer<T>;
  13269. }): ResourceRef<T>;
  13270. /**
  13271. * Constructs a `Resource` that projects a reactive request to an asynchronous operation defined by
  13272. * a loader function, which exposes the result of the loading operation via signals.
  13273. *
  13274. * Note that `resource` is intended for _read_ operations, not operations which perform mutations.
  13275. * `resource` will cancel in-progress loads via the `AbortSignal` when destroyed or when a new
  13276. * request object becomes available, which could prematurely abort mutations.
  13277. *
  13278. * @experimental
  13279. */
  13280. declare function resource<T, R>(options: ResourceOptions<T, R>): ResourceRef<T | undefined>;
  13281. type WrappedRequest = {
  13282. request: unknown;
  13283. reload: number;
  13284. };
  13285. /**
  13286. * Base class which implements `.value` as a `WritableSignal` by delegating `.set` and `.update`.
  13287. */
  13288. declare abstract class BaseWritableResource<T> implements WritableResource<T> {
  13289. readonly value: WritableSignal<T>;
  13290. abstract readonly status: Signal<ResourceStatus>;
  13291. abstract readonly error: Signal<unknown>;
  13292. abstract reload(): boolean;
  13293. constructor(value: Signal<T>);
  13294. abstract set(value: T): void;
  13295. update(updateFn: (value: T) => T): void;
  13296. readonly isLoading: Signal<boolean>;
  13297. hasValue(): this is ResourceRef<Exclude<T, undefined>>;
  13298. asReadonly(): Resource<T>;
  13299. }
  13300. /**
  13301. * Implementation for `resource()` which uses a `linkedSignal` to manage the resource's state.
  13302. */
  13303. declare class ResourceImpl<T, R> extends BaseWritableResource<T> implements ResourceRef<T> {
  13304. private readonly loaderFn;
  13305. private readonly defaultValue;
  13306. private readonly equal;
  13307. private readonly pendingTasks;
  13308. /**
  13309. * The current state of the resource. Status, value, and error are derived from this.
  13310. */
  13311. private readonly state;
  13312. /**
  13313. * Combines the current request with a reload counter which allows the resource to be reloaded on
  13314. * imperative command.
  13315. */
  13316. protected readonly extRequest: WritableSignal<WrappedRequest>;
  13317. private readonly effectRef;
  13318. private pendingController;
  13319. private resolvePendingTask;
  13320. private destroyed;
  13321. constructor(request: () => R, loaderFn: ResourceStreamingLoader<T, R>, defaultValue: T, equal: ValueEqualityFn$1<T> | undefined, injector: Injector);
  13322. readonly status: Signal<ResourceStatus>;
  13323. readonly error: Signal<unknown>;
  13324. /**
  13325. * Called either directly via `WritableResource.set` or via `.value.set()`.
  13326. */
  13327. set(value: T): void;
  13328. reload(): boolean;
  13329. destroy(): void;
  13330. private loadEffect;
  13331. private abortInProgressLoad;
  13332. }
  13333. /*!
  13334. * @license
  13335. * Copyright Google LLC All Rights Reserved.
  13336. *
  13337. * Use of this source code is governed by an MIT-style license that can be
  13338. * found in the LICENSE file at https://angular.dev/license
  13339. */
  13340. /**
  13341. * Gets the class name of the closest component to a node.
  13342. * Warning! this function will return minified names if the name of the component is minified. The
  13343. * consumer of the function is responsible for resolving the minified name to its original name.
  13344. * @param node Node from which to start the search.
  13345. */
  13346. declare function getClosestComponentName(node: Node): string | null;
  13347. declare function compileNgModuleFactory<M>(injector: Injector, options: CompilerOptions, moduleType: Type$1<M>): Promise<NgModuleFactory$1<M>>;
  13348. /**
  13349. * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.
  13350. */
  13351. declare function createInjector(defType: any, parent?: Injector | null, additionalProviders?: Array<Provider | StaticProvider> | null, name?: string): Injector;
  13352. /**
  13353. * Adds the given NgModule type to Angular's NgModule registry.
  13354. *
  13355. * This is generated as a side-effect of NgModule compilation. Note that the `id` is passed in
  13356. * explicitly and not read from the NgModule definition. This is for two reasons: it avoids a
  13357. * megamorphic read, and in JIT there's a chicken-and-egg problem where the NgModule may not be
  13358. * fully resolved when it's registered.
  13359. *
  13360. * @codeGenApi
  13361. */
  13362. declare function registerNgModuleType(ngModuleType: NgModuleType, id: string): void;
  13363. /**
  13364. * Control whether the NgModule registration system enforces that each NgModule type registered has
  13365. * a unique id.
  13366. *
  13367. * This is useful for testing as the NgModule registry cannot be properly reset between tests with
  13368. * Angular's current API.
  13369. */
  13370. declare function setAllowDuplicateNgModuleIdsForTest(allowDuplicates: boolean): void;
  13371. /**
  13372. * The internal view context which is specific to a given DOM element, directive or
  13373. * component instance. Each value in here (besides the LView and element node details)
  13374. * can be present, null or undefined. If undefined then it implies the value has not been
  13375. * looked up yet, otherwise, if null, then a lookup was executed and nothing was found.
  13376. *
  13377. * Each value will get filled when the respective value is examined within the getContext
  13378. * function. The component, element and each directive instance will share the same instance
  13379. * of the context.
  13380. */
  13381. declare class LContext {
  13382. /**
  13383. * ID of the component's parent view data.
  13384. */
  13385. private lViewId;
  13386. /**
  13387. * The index instance of the node.
  13388. */
  13389. nodeIndex: number;
  13390. /**
  13391. * The instance of the DOM node that is attached to the lNode.
  13392. */
  13393. native: RNode;
  13394. /**
  13395. * The instance of the Component node.
  13396. */
  13397. component: {} | null | undefined;
  13398. /**
  13399. * The list of active directives that exist on this element.
  13400. */
  13401. directives: any[] | null | undefined;
  13402. /**
  13403. * The map of local references (local reference name => element or directive instance) that
  13404. * exist on this element.
  13405. */
  13406. localRefs: {
  13407. [key: string]: any;
  13408. } | null | undefined;
  13409. /** Component's parent view data. */
  13410. get lView(): LView | null;
  13411. constructor(
  13412. /**
  13413. * ID of the component's parent view data.
  13414. */
  13415. lViewId: number,
  13416. /**
  13417. * The index instance of the node.
  13418. */
  13419. nodeIndex: number,
  13420. /**
  13421. * The instance of the DOM node that is attached to the lNode.
  13422. */
  13423. native: RNode);
  13424. }
  13425. /**
  13426. * Returns the matching `LContext` data for a given DOM node, directive or component instance.
  13427. *
  13428. * This function will examine the provided DOM element, component, or directive instance\'s
  13429. * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched
  13430. * value will be that of the newly created `LContext`.
  13431. *
  13432. * If the monkey-patched value is the `LView` instance then the context value for that
  13433. * target will be created and the monkey-patch reference will be updated. Therefore when this
  13434. * function is called it may mutate the provided element\'s, component\'s or any of the associated
  13435. * directive\'s monkey-patch values.
  13436. *
  13437. * If the monkey-patch value is not detected then the code will walk up the DOM until an element
  13438. * is found which contains a monkey-patch reference. When that occurs then the provided element
  13439. * will be updated with a new context (which is then returned). If the monkey-patch value is not
  13440. * detected for a component/directive instance then it will throw an error (all components and
  13441. * directives should be automatically monkey-patched by ivy).
  13442. *
  13443. * @param target Component, Directive or DOM Node.
  13444. */
  13445. declare function getLContext(target: any): LContext | null;
  13446. declare const NG_COMP_DEF: string;
  13447. declare const NG_DIR_DEF: string;
  13448. declare const NG_PIPE_DEF: string;
  13449. declare const NG_MOD_DEF: string;
  13450. /**
  13451. * If a directive is diPublic, bloomAdd sets a property on the type with this constant as
  13452. * the key and the directive's unique ID as the value. This allows us to map directives to their
  13453. * bloom filter bit for DI.
  13454. */
  13455. declare const NG_ELEMENT_ID: string;
  13456. /**
  13457. * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
  13458. * definition.
  13459. *
  13460. * This exists primarily to support ngcc migration of an existing View Engine pattern, where an
  13461. * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
  13462. * generates a skeleton definition on the child class, and applies this feature.
  13463. *
  13464. * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
  13465. * including things like the component template function.
  13466. *
  13467. * @param definition The definition of a child class which inherits from a parent class with its
  13468. * own definition.
  13469. *
  13470. * @codeGenApi
  13471. */
  13472. declare function ɵɵCopyDefinitionFeature(definition: DirectiveDef<any> | ComponentDef<any>): void;
  13473. /**
  13474. * This feature adds the host directives behavior to a directive definition by patching a
  13475. * function onto it. The expectation is that the runtime will invoke the function during
  13476. * directive matching.
  13477. *
  13478. * For example:
  13479. * ```ts
  13480. * class ComponentWithHostDirective {
  13481. * static ɵcmp = defineComponent({
  13482. * type: ComponentWithHostDirective,
  13483. * features: [ɵɵHostDirectivesFeature([
  13484. * SimpleHostDirective,
  13485. * {directive: AdvancedHostDirective, inputs: ['foo: alias'], outputs: ['bar']},
  13486. * ])]
  13487. * });
  13488. * }
  13489. * ```
  13490. *
  13491. * @codeGenApi
  13492. */
  13493. declare function ɵɵHostDirectivesFeature(rawHostDirectives: HostDirectiveConfig[] | (() => HostDirectiveConfig[])): DirectiveDefFeature;
  13494. /**
  13495. * Merges the definition from a super class to a sub class.
  13496. * @param definition The definition that is a SubClass of another directive of component
  13497. *
  13498. * @codeGenApi
  13499. */
  13500. declare function ɵɵInheritDefinitionFeature(definition: DirectiveDef<any> | ComponentDef<any>): void;
  13501. /**
  13502. * The NgOnChangesFeature decorates a component with support for the ngOnChanges
  13503. * lifecycle hook, so it should be included in any component that implements
  13504. * that hook.
  13505. *
  13506. * If the component or directive uses inheritance, the NgOnChangesFeature MUST
  13507. * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise
  13508. * inherited properties will not be propagated to the ngOnChanges lifecycle
  13509. * hook.
  13510. *
  13511. * Example usage:
  13512. *
  13513. * ```ts
  13514. * static ɵcmp = defineComponent({
  13515. * ...
  13516. * inputs: {name: 'publicName'},
  13517. * features: [NgOnChangesFeature]
  13518. * });
  13519. * ```
  13520. *
  13521. * @codeGenApi
  13522. */
  13523. declare const ɵɵNgOnChangesFeature: () => DirectiveDefFeature;
  13524. /**
  13525. * This feature resolves the providers of a directive (or component),
  13526. * and publish them into the DI system, making it visible to others for injection.
  13527. *
  13528. * For example:
  13529. * ```ts
  13530. * class ComponentWithProviders {
  13531. * constructor(private greeter: GreeterDE) {}
  13532. *
  13533. * static ɵcmp = defineComponent({
  13534. * type: ComponentWithProviders,
  13535. * selectors: [['component-with-providers']],
  13536. * factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)),
  13537. * decls: 1,
  13538. * vars: 1,
  13539. * template: function(fs: RenderFlags, ctx: ComponentWithProviders) {
  13540. * if (fs & RenderFlags.Create) {
  13541. * ɵɵtext(0);
  13542. * }
  13543. * if (fs & RenderFlags.Update) {
  13544. * ɵɵtextInterpolate(ctx.greeter.greet());
  13545. * }
  13546. * },
  13547. * features: [ɵɵProvidersFeature([GreeterDE])]
  13548. * });
  13549. * }
  13550. * ```
  13551. *
  13552. * @param definition
  13553. *
  13554. * @codeGenApi
  13555. */
  13556. declare function ɵɵProvidersFeature<T>(providers: Provider[], viewProviders?: Provider[]): (definition: DirectiveDef<T>) => void;
  13557. /**
  13558. * A feature that adds support for external runtime styles for a component.
  13559. * An external runtime style is a URL to a CSS stylesheet that contains the styles
  13560. * for a given component. For browsers, this URL will be used in an appended `link` element
  13561. * when the component is rendered. This feature is typically used for Hot Module Replacement
  13562. * (HMR) of component stylesheets by leveraging preexisting global stylesheet HMR available
  13563. * in most development servers.
  13564. *
  13565. * @codeGenApi
  13566. */
  13567. declare function ɵɵExternalStylesFeature(styleUrls: string[]): ComponentDefFeature;
  13568. /**
  13569. * Generated next to NgModules to monkey-patch directive and pipe references onto a component's
  13570. * definition, when generating a direct reference in the component file would otherwise create an
  13571. * import cycle.
  13572. *
  13573. * See [this explanation](https://hackmd.io/Odw80D0pR6yfsOjg_7XCJg?view) for more details.
  13574. *
  13575. * @codeGenApi
  13576. */
  13577. declare function ɵɵsetComponentScope(type: ComponentType<any>, directives: Type$1<any>[] | (() => Type$1<any>[]), pipes: Type$1<any>[] | (() => Type$1<any>[])): void;
  13578. /**
  13579. * Adds the module metadata that is necessary to compute the module's transitive scope to an
  13580. * existing module definition.
  13581. *
  13582. * Scope metadata of modules is not used in production builds, so calls to this function can be
  13583. * marked pure to tree-shake it from the bundle, allowing for all referenced declarations
  13584. * to become eligible for tree-shaking as well.
  13585. *
  13586. * @codeGenApi
  13587. */
  13588. declare function ɵɵsetNgModuleScope(type: any, scope: NgModuleScopeInfoFromDecorator): unknown;
  13589. /**
  13590. * Retrieves the component instance associated with a given DOM element.
  13591. *
  13592. * @usageNotes
  13593. * Given the following DOM structure:
  13594. *
  13595. * ```html
  13596. * <app-root>
  13597. * <div>
  13598. * <child-comp></child-comp>
  13599. * </div>
  13600. * </app-root>
  13601. * ```
  13602. *
  13603. * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
  13604. * associated with this DOM element.
  13605. *
  13606. * Calling the function on `<app-root>` will return the `MyApp` instance.
  13607. *
  13608. *
  13609. * @param element DOM element from which the component should be retrieved.
  13610. * @returns Component instance associated with the element or `null` if there
  13611. * is no component associated with it.
  13612. *
  13613. * @publicApi
  13614. */
  13615. declare function getComponent<T>(element: Element): T | null;
  13616. /**
  13617. * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
  13618. * view that the element is part of. Otherwise retrieves the instance of the component whose view
  13619. * owns the element (in this case, the result is the same as calling `getOwningComponent`).
  13620. *
  13621. * @param element Element for which to get the surrounding component instance.
  13622. * @returns Instance of the component that is around the element or null if the element isn't
  13623. * inside any component.
  13624. *
  13625. * @publicApi
  13626. */
  13627. declare function getContext<T extends {}>(element: Element): T | null;
  13628. /**
  13629. * Retrieves the component instance whose view contains the DOM element.
  13630. *
  13631. * For example, if `<child-comp>` is used in the template of `<app-comp>`
  13632. * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
  13633. * would return `<app-comp>`.
  13634. *
  13635. * @param elementOrDir DOM element, component or directive instance
  13636. * for which to retrieve the root components.
  13637. * @returns Component instance whose view owns the DOM element or null if the element is not
  13638. * part of a component view.
  13639. *
  13640. * @publicApi
  13641. */
  13642. declare function getOwningComponent<T>(elementOrDir: Element | {}): T | null;
  13643. /**
  13644. * Retrieves all root components associated with a DOM element, directive or component instance.
  13645. * Root components are those which have been bootstrapped by Angular.
  13646. *
  13647. * @param elementOrDir DOM element, component or directive instance
  13648. * for which to retrieve the root components.
  13649. * @returns Root components associated with the target object.
  13650. *
  13651. * @publicApi
  13652. */
  13653. declare function getRootComponents(elementOrDir: Element | {}): {}[];
  13654. /**
  13655. * Retrieves an `Injector` associated with an element, component or directive instance.
  13656. *
  13657. * @param elementOrDir DOM element, component or directive instance for which to
  13658. * retrieve the injector.
  13659. * @returns Injector associated with the element, component or directive instance.
  13660. *
  13661. * @publicApi
  13662. */
  13663. declare function getInjector(elementOrDir: Element | {}): Injector;
  13664. /**
  13665. * Retrieves directive instances associated with a given DOM node. Does not include
  13666. * component instances.
  13667. *
  13668. * @usageNotes
  13669. * Given the following DOM structure:
  13670. *
  13671. * ```html
  13672. * <app-root>
  13673. * <button my-button></button>
  13674. * <my-comp></my-comp>
  13675. * </app-root>
  13676. * ```
  13677. *
  13678. * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
  13679. * directive that is associated with the DOM node.
  13680. *
  13681. * Calling `getDirectives` on `<my-comp>` will return an empty array.
  13682. *
  13683. * @param node DOM node for which to get the directives.
  13684. * @returns Array of directives associated with the node.
  13685. *
  13686. * @publicApi
  13687. */
  13688. declare function getDirectives(node: Node): {}[];
  13689. /**
  13690. * Partial metadata for a given directive instance.
  13691. * This information might be useful for debugging purposes or tooling.
  13692. * Currently only `inputs` and `outputs` metadata is available.
  13693. *
  13694. * @publicApi
  13695. */
  13696. interface DirectiveDebugMetadata {
  13697. inputs: Record<string, string>;
  13698. outputs: Record<string, string>;
  13699. }
  13700. /**
  13701. * Partial metadata for a given component instance.
  13702. * This information might be useful for debugging purposes or tooling.
  13703. * Currently the following fields are available:
  13704. * - inputs
  13705. * - outputs
  13706. * - encapsulation
  13707. * - changeDetection
  13708. *
  13709. * @publicApi
  13710. */
  13711. interface ComponentDebugMetadata extends DirectiveDebugMetadata {
  13712. encapsulation: ViewEncapsulation$1;
  13713. changeDetection: ChangeDetectionStrategy$1;
  13714. }
  13715. /**
  13716. * Returns the debug (partial) metadata for a particular directive or component instance.
  13717. * The function accepts an instance of a directive or component and returns the corresponding
  13718. * metadata.
  13719. *
  13720. * @param directiveOrComponentInstance Instance of a directive or component
  13721. * @returns metadata of the passed directive or component
  13722. *
  13723. * @publicApi
  13724. */
  13725. declare function getDirectiveMetadata(directiveOrComponentInstance: any): ComponentDebugMetadata | DirectiveDebugMetadata | null;
  13726. /**
  13727. * Retrieves the host element of a component or directive instance.
  13728. * The host element is the DOM element that matched the selector of the directive.
  13729. *
  13730. * @param componentOrDirective Component or directive instance for which the host
  13731. * element should be retrieved.
  13732. * @returns Host element of the target.
  13733. *
  13734. * @publicApi
  13735. */
  13736. declare function getHostElement(componentOrDirective: {}): Element;
  13737. /**
  13738. * Event listener configuration returned from `getListeners`.
  13739. * @publicApi
  13740. */
  13741. interface Listener {
  13742. /** Name of the event listener. */
  13743. name: string;
  13744. /** Element that the listener is bound to. */
  13745. element: Element;
  13746. /** Callback that is invoked when the event is triggered. */
  13747. callback: (value: any) => any;
  13748. /** Whether the listener is using event capturing. */
  13749. useCapture: boolean;
  13750. /**
  13751. * Type of the listener (e.g. a native DOM event or a custom @Output).
  13752. */
  13753. type: 'dom' | 'output';
  13754. }
  13755. /**
  13756. * Retrieves a list of event listeners associated with a DOM element. The list does include host
  13757. * listeners, but it does not include event listeners defined outside of the Angular context
  13758. * (e.g. through `addEventListener`).
  13759. *
  13760. * @usageNotes
  13761. * Given the following DOM structure:
  13762. *
  13763. * ```html
  13764. * <app-root>
  13765. * <div (click)="doSomething()"></div>
  13766. * </app-root>
  13767. * ```
  13768. *
  13769. * Calling `getListeners` on `<div>` will return an object that looks as follows:
  13770. *
  13771. * ```ts
  13772. * {
  13773. * name: 'click',
  13774. * element: <div>,
  13775. * callback: () => doSomething(),
  13776. * useCapture: false
  13777. * }
  13778. * ```
  13779. *
  13780. * @param element Element for which the DOM listeners should be retrieved.
  13781. * @returns Array of event listeners on the DOM element.
  13782. *
  13783. * @publicApi
  13784. */
  13785. declare function getListeners(element: Element): Listener[];
  13786. /**
  13787. * @codeGenApi
  13788. */
  13789. declare function ɵɵgetInheritedFactory<T>(type: Type$1<any>): (type: Type$1<T>) => T;
  13790. /**
  13791. * Sets the locale id that will be used for translations and ICU expressions.
  13792. * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine
  13793. * but is now defined as a global value.
  13794. *
  13795. * @param localeId
  13796. */
  13797. declare function setLocaleId(localeId: string): void;
  13798. /**
  13799. * Creates runtime data structures for defer blocks.
  13800. *
  13801. * @param index Index of the `defer` instruction.
  13802. * @param primaryTmplIndex Index of the template with the primary block content.
  13803. * @param dependencyResolverFn Function that contains dependencies for this defer block.
  13804. * @param loadingTmplIndex Index of the template with the loading block content.
  13805. * @param placeholderTmplIndex Index of the template with the placeholder block content.
  13806. * @param errorTmplIndex Index of the template with the error block content.
  13807. * @param loadingConfigIndex Index in the constants array of the configuration of the loading.
  13808. * block.
  13809. * @param placeholderConfigIndex Index in the constants array of the configuration of the
  13810. * placeholder block.
  13811. * @param enableTimerScheduling Function that enables timer-related scheduling if `after`
  13812. * or `minimum` parameters are setup on the `@loading` or `@placeholder` blocks.
  13813. * @param flags A set of flags to define a particular behavior (e.g. to indicate that
  13814. * hydrate triggers are present and regular triggers should be deactivated
  13815. * in certain scenarios).
  13816. *
  13817. * @codeGenApi
  13818. */
  13819. declare function ɵɵdefer(index: number, primaryTmplIndex: number, dependencyResolverFn?: DependencyResolverFn | null, loadingTmplIndex?: number | null, placeholderTmplIndex?: number | null, errorTmplIndex?: number | null, loadingConfigIndex?: number | null, placeholderConfigIndex?: number | null, enableTimerScheduling?: typeof ɵɵdeferEnableTimerScheduling, flags?: TDeferDetailsFlags | null): void;
  13820. /**
  13821. * Loads defer block dependencies when a trigger value becomes truthy.
  13822. * @codeGenApi
  13823. */
  13824. declare function ɵɵdeferWhen(rawValue: unknown): void;
  13825. /**
  13826. * Prefetches the deferred content when a value becomes truthy.
  13827. * @codeGenApi
  13828. */
  13829. declare function ɵɵdeferPrefetchWhen(rawValue: unknown): void;
  13830. /**
  13831. * Hydrates the deferred content when a value becomes truthy.
  13832. * @codeGenApi
  13833. */
  13834. declare function ɵɵdeferHydrateWhen(rawValue: unknown): void;
  13835. /**
  13836. * Specifies that hydration never occurs.
  13837. * @codeGenApi
  13838. */
  13839. declare function ɵɵdeferHydrateNever(): void;
  13840. /**
  13841. * Sets up logic to handle the `on idle` deferred trigger.
  13842. * @codeGenApi
  13843. */
  13844. declare function ɵɵdeferOnIdle(): void;
  13845. /**
  13846. * Sets up logic to handle the `prefetch on idle` deferred trigger.
  13847. * @codeGenApi
  13848. */
  13849. declare function ɵɵdeferPrefetchOnIdle(): void;
  13850. /**
  13851. * Sets up logic to handle the `on idle` deferred trigger.
  13852. * @codeGenApi
  13853. */
  13854. declare function ɵɵdeferHydrateOnIdle(): void;
  13855. /**
  13856. * Sets up logic to handle the `on immediate` deferred trigger.
  13857. * @codeGenApi
  13858. */
  13859. declare function ɵɵdeferOnImmediate(): void;
  13860. /**
  13861. * Sets up logic to handle the `prefetch on immediate` deferred trigger.
  13862. * @codeGenApi
  13863. */
  13864. declare function ɵɵdeferPrefetchOnImmediate(): void;
  13865. /**
  13866. * Sets up logic to handle the `on immediate` hydrate trigger.
  13867. * @codeGenApi
  13868. */
  13869. declare function ɵɵdeferHydrateOnImmediate(): void;
  13870. /**
  13871. * Creates runtime data structures for the `on timer` deferred trigger.
  13872. * @param delay Amount of time to wait before loading the content.
  13873. * @codeGenApi
  13874. */
  13875. declare function ɵɵdeferOnTimer(delay: number): void;
  13876. /**
  13877. * Creates runtime data structures for the `prefetch on timer` deferred trigger.
  13878. * @param delay Amount of time to wait before prefetching the content.
  13879. * @codeGenApi
  13880. */
  13881. declare function ɵɵdeferPrefetchOnTimer(delay: number): void;
  13882. /**
  13883. * Creates runtime data structures for the `on timer` hydrate trigger.
  13884. * @param delay Amount of time to wait before loading the content.
  13885. * @codeGenApi
  13886. */
  13887. declare function ɵɵdeferHydrateOnTimer(delay: number): void;
  13888. /**
  13889. * Creates runtime data structures for the `on hover` deferred trigger.
  13890. * @param triggerIndex Index at which to find the trigger element.
  13891. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  13892. * @codeGenApi
  13893. */
  13894. declare function ɵɵdeferOnHover(triggerIndex: number, walkUpTimes?: number): void;
  13895. /**
  13896. * Creates runtime data structures for the `prefetch on hover` deferred trigger.
  13897. * @param triggerIndex Index at which to find the trigger element.
  13898. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  13899. * @codeGenApi
  13900. */
  13901. declare function ɵɵdeferPrefetchOnHover(triggerIndex: number, walkUpTimes?: number): void;
  13902. /**
  13903. * Creates runtime data structures for the `on hover` hydrate trigger.
  13904. * @codeGenApi
  13905. */
  13906. declare function ɵɵdeferHydrateOnHover(): void;
  13907. /**
  13908. * Creates runtime data structures for the `on interaction` deferred trigger.
  13909. * @param triggerIndex Index at which to find the trigger element.
  13910. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  13911. * @codeGenApi
  13912. */
  13913. declare function ɵɵdeferOnInteraction(triggerIndex: number, walkUpTimes?: number): void;
  13914. /**
  13915. * Creates runtime data structures for the `prefetch on interaction` deferred trigger.
  13916. * @param triggerIndex Index at which to find the trigger element.
  13917. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  13918. * @codeGenApi
  13919. */
  13920. declare function ɵɵdeferPrefetchOnInteraction(triggerIndex: number, walkUpTimes?: number): void;
  13921. /**
  13922. * Creates runtime data structures for the `on interaction` hydrate trigger.
  13923. * @codeGenApi
  13924. */
  13925. declare function ɵɵdeferHydrateOnInteraction(): void;
  13926. /**
  13927. * Creates runtime data structures for the `on viewport` deferred trigger.
  13928. * @param triggerIndex Index at which to find the trigger element.
  13929. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  13930. * @codeGenApi
  13931. */
  13932. declare function ɵɵdeferOnViewport(triggerIndex: number, walkUpTimes?: number): void;
  13933. /**
  13934. * Creates runtime data structures for the `prefetch on viewport` deferred trigger.
  13935. * @param triggerIndex Index at which to find the trigger element.
  13936. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  13937. * @codeGenApi
  13938. */
  13939. declare function ɵɵdeferPrefetchOnViewport(triggerIndex: number, walkUpTimes?: number): void;
  13940. /**
  13941. * Creates runtime data structures for the `on viewport` hydrate trigger.
  13942. * @codeGenApi
  13943. */
  13944. declare function ɵɵdeferHydrateOnViewport(): void;
  13945. /**
  13946. * Advances to an element for later binding instructions.
  13947. *
  13948. * Used in conjunction with instructions like {@link property} to act on elements with specified
  13949. * indices, for example those created with {@link element} or {@link elementStart}.
  13950. *
  13951. * ```ts
  13952. * (rf: RenderFlags, ctx: any) => {
  13953. * if (rf & 1) {
  13954. * text(0, 'Hello');
  13955. * text(1, 'Goodbye')
  13956. * element(2, 'div');
  13957. * }
  13958. * if (rf & 2) {
  13959. * advance(2); // Advance twice to the <div>.
  13960. * property('title', 'test');
  13961. * }
  13962. * }
  13963. * ```
  13964. * @param delta Number of elements to advance forwards by.
  13965. *
  13966. * @codeGenApi
  13967. */
  13968. declare function ɵɵadvance(delta?: number): void;
  13969. /**
  13970. * Updates the value of or removes a bound attribute on an Element.
  13971. *
  13972. * Used in the case of `[attr.title]="value"`
  13973. *
  13974. * @param name name The name of the attribute.
  13975. * @param value value The attribute is removed when value is `null` or `undefined`.
  13976. * Otherwise the attribute value is set to the stringified value.
  13977. * @param sanitizer An optional function used to sanitize the value.
  13978. * @param namespace Optional namespace to use when setting the attribute.
  13979. *
  13980. * @codeGenApi
  13981. */
  13982. declare function ɵɵattribute(name: string, value: any, sanitizer?: SanitizerFn | null, namespace?: string): typeof ɵɵattribute;
  13983. /**
  13984. *
  13985. * Update an interpolated attribute on an element with single bound value surrounded by text.
  13986. *
  13987. * Used when the value passed to a property has 1 interpolated value in it:
  13988. *
  13989. * ```html
  13990. * <div attr.title="prefix{{v0}}suffix"></div>
  13991. * ```
  13992. *
  13993. * Its compiled representation is::
  13994. *
  13995. * ```ts
  13996. * ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');
  13997. * ```
  13998. *
  13999. * @param attrName The name of the attribute to update
  14000. * @param prefix Static value used for concatenation only.
  14001. * @param v0 Value checked for change.
  14002. * @param suffix Static value used for concatenation only.
  14003. * @param sanitizer An optional sanitizer function
  14004. * @returns itself, so that it may be chained.
  14005. * @codeGenApi
  14006. */
  14007. declare function ɵɵattributeInterpolate1(attrName: string, prefix: string, v0: any, suffix: string, sanitizer?: SanitizerFn, namespace?: string): typeof ɵɵattributeInterpolate1;
  14008. /**
  14009. *
  14010. * Update an interpolated attribute on an element with 2 bound values surrounded by text.
  14011. *
  14012. * Used when the value passed to a property has 2 interpolated values in it:
  14013. *
  14014. * ```html
  14015. * <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
  14016. * ```
  14017. *
  14018. * Its compiled representation is::
  14019. *
  14020. * ```ts
  14021. * ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
  14022. * ```
  14023. *
  14024. * @param attrName The name of the attribute to update
  14025. * @param prefix Static value used for concatenation only.
  14026. * @param v0 Value checked for change.
  14027. * @param i0 Static value used for concatenation only.
  14028. * @param v1 Value checked for change.
  14029. * @param suffix Static value used for concatenation only.
  14030. * @param sanitizer An optional sanitizer function
  14031. * @returns itself, so that it may be chained.
  14032. * @codeGenApi
  14033. */
  14034. declare function ɵɵattributeInterpolate2(attrName: string, prefix: string, v0: any, i0: string, v1: any, suffix: string, sanitizer?: SanitizerFn, namespace?: string): typeof ɵɵattributeInterpolate2;
  14035. /**
  14036. *
  14037. * Update an interpolated attribute on an element with 3 bound values surrounded by text.
  14038. *
  14039. * Used when the value passed to a property has 3 interpolated values in it:
  14040. *
  14041. * ```html
  14042. * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
  14043. * ```
  14044. *
  14045. * Its compiled representation is::
  14046. *
  14047. * ```ts
  14048. * ɵɵattributeInterpolate3(
  14049. * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
  14050. * ```
  14051. *
  14052. * @param attrName The name of the attribute to update
  14053. * @param prefix Static value used for concatenation only.
  14054. * @param v0 Value checked for change.
  14055. * @param i0 Static value used for concatenation only.
  14056. * @param v1 Value checked for change.
  14057. * @param i1 Static value used for concatenation only.
  14058. * @param v2 Value checked for change.
  14059. * @param suffix Static value used for concatenation only.
  14060. * @param sanitizer An optional sanitizer function
  14061. * @returns itself, so that it may be chained.
  14062. * @codeGenApi
  14063. */
  14064. declare function ɵɵattributeInterpolate3(attrName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string, sanitizer?: SanitizerFn, namespace?: string): typeof ɵɵattributeInterpolate3;
  14065. /**
  14066. *
  14067. * Update an interpolated attribute on an element with 4 bound values surrounded by text.
  14068. *
  14069. * Used when the value passed to a property has 4 interpolated values in it:
  14070. *
  14071. * ```html
  14072. * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
  14073. * ```
  14074. *
  14075. * Its compiled representation is::
  14076. *
  14077. * ```ts
  14078. * ɵɵattributeInterpolate4(
  14079. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
  14080. * ```
  14081. *
  14082. * @param attrName The name of the attribute to update
  14083. * @param prefix Static value used for concatenation only.
  14084. * @param v0 Value checked for change.
  14085. * @param i0 Static value used for concatenation only.
  14086. * @param v1 Value checked for change.
  14087. * @param i1 Static value used for concatenation only.
  14088. * @param v2 Value checked for change.
  14089. * @param i2 Static value used for concatenation only.
  14090. * @param v3 Value checked for change.
  14091. * @param suffix Static value used for concatenation only.
  14092. * @param sanitizer An optional sanitizer function
  14093. * @returns itself, so that it may be chained.
  14094. * @codeGenApi
  14095. */
  14096. declare function ɵɵattributeInterpolate4(attrName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix: string, sanitizer?: SanitizerFn, namespace?: string): typeof ɵɵattributeInterpolate4;
  14097. /**
  14098. *
  14099. * Update an interpolated attribute on an element with 5 bound values surrounded by text.
  14100. *
  14101. * Used when the value passed to a property has 5 interpolated values in it:
  14102. *
  14103. * ```html
  14104. * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
  14105. * ```
  14106. *
  14107. * Its compiled representation is::
  14108. *
  14109. * ```ts
  14110. * ɵɵattributeInterpolate5(
  14111. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
  14112. * ```
  14113. *
  14114. * @param attrName The name of the attribute to update
  14115. * @param prefix Static value used for concatenation only.
  14116. * @param v0 Value checked for change.
  14117. * @param i0 Static value used for concatenation only.
  14118. * @param v1 Value checked for change.
  14119. * @param i1 Static value used for concatenation only.
  14120. * @param v2 Value checked for change.
  14121. * @param i2 Static value used for concatenation only.
  14122. * @param v3 Value checked for change.
  14123. * @param i3 Static value used for concatenation only.
  14124. * @param v4 Value checked for change.
  14125. * @param suffix Static value used for concatenation only.
  14126. * @param sanitizer An optional sanitizer function
  14127. * @returns itself, so that it may be chained.
  14128. * @codeGenApi
  14129. */
  14130. declare function ɵɵattributeInterpolate5(attrName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, suffix: string, sanitizer?: SanitizerFn, namespace?: string): typeof ɵɵattributeInterpolate5;
  14131. /**
  14132. *
  14133. * Update an interpolated attribute on an element with 6 bound values surrounded by text.
  14134. *
  14135. * Used when the value passed to a property has 6 interpolated values in it:
  14136. *
  14137. * ```html
  14138. * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
  14139. * ```
  14140. *
  14141. * Its compiled representation is::
  14142. *
  14143. * ```ts
  14144. * ɵɵattributeInterpolate6(
  14145. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
  14146. * ```
  14147. *
  14148. * @param attrName The name of the attribute to update
  14149. * @param prefix Static value used for concatenation only.
  14150. * @param v0 Value checked for change.
  14151. * @param i0 Static value used for concatenation only.
  14152. * @param v1 Value checked for change.
  14153. * @param i1 Static value used for concatenation only.
  14154. * @param v2 Value checked for change.
  14155. * @param i2 Static value used for concatenation only.
  14156. * @param v3 Value checked for change.
  14157. * @param i3 Static value used for concatenation only.
  14158. * @param v4 Value checked for change.
  14159. * @param i4 Static value used for concatenation only.
  14160. * @param v5 Value checked for change.
  14161. * @param suffix Static value used for concatenation only.
  14162. * @param sanitizer An optional sanitizer function
  14163. * @returns itself, so that it may be chained.
  14164. * @codeGenApi
  14165. */
  14166. declare function ɵɵattributeInterpolate6(attrName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string, sanitizer?: SanitizerFn, namespace?: string): typeof ɵɵattributeInterpolate6;
  14167. /**
  14168. *
  14169. * Update an interpolated attribute on an element with 7 bound values surrounded by text.
  14170. *
  14171. * Used when the value passed to a property has 7 interpolated values in it:
  14172. *
  14173. * ```html
  14174. * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div>
  14175. * ```
  14176. *
  14177. * Its compiled representation is::
  14178. *
  14179. * ```ts
  14180. * ɵɵattributeInterpolate7(
  14181. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
  14182. * ```
  14183. *
  14184. * @param attrName The name of the attribute to update
  14185. * @param prefix Static value used for concatenation only.
  14186. * @param v0 Value checked for change.
  14187. * @param i0 Static value used for concatenation only.
  14188. * @param v1 Value checked for change.
  14189. * @param i1 Static value used for concatenation only.
  14190. * @param v2 Value checked for change.
  14191. * @param i2 Static value used for concatenation only.
  14192. * @param v3 Value checked for change.
  14193. * @param i3 Static value used for concatenation only.
  14194. * @param v4 Value checked for change.
  14195. * @param i4 Static value used for concatenation only.
  14196. * @param v5 Value checked for change.
  14197. * @param i5 Static value used for concatenation only.
  14198. * @param v6 Value checked for change.
  14199. * @param suffix Static value used for concatenation only.
  14200. * @param sanitizer An optional sanitizer function
  14201. * @returns itself, so that it may be chained.
  14202. * @codeGenApi
  14203. */
  14204. declare function ɵɵattributeInterpolate7(attrName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string, sanitizer?: SanitizerFn, namespace?: string): typeof ɵɵattributeInterpolate7;
  14205. /**
  14206. *
  14207. * Update an interpolated attribute on an element with 8 bound values surrounded by text.
  14208. *
  14209. * Used when the value passed to a property has 8 interpolated values in it:
  14210. *
  14211. * ```html
  14212. * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div>
  14213. * ```
  14214. *
  14215. * Its compiled representation is::
  14216. *
  14217. * ```ts
  14218. * ɵɵattributeInterpolate8(
  14219. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
  14220. * ```
  14221. *
  14222. * @param attrName The name of the attribute to update
  14223. * @param prefix Static value used for concatenation only.
  14224. * @param v0 Value checked for change.
  14225. * @param i0 Static value used for concatenation only.
  14226. * @param v1 Value checked for change.
  14227. * @param i1 Static value used for concatenation only.
  14228. * @param v2 Value checked for change.
  14229. * @param i2 Static value used for concatenation only.
  14230. * @param v3 Value checked for change.
  14231. * @param i3 Static value used for concatenation only.
  14232. * @param v4 Value checked for change.
  14233. * @param i4 Static value used for concatenation only.
  14234. * @param v5 Value checked for change.
  14235. * @param i5 Static value used for concatenation only.
  14236. * @param v6 Value checked for change.
  14237. * @param i6 Static value used for concatenation only.
  14238. * @param v7 Value checked for change.
  14239. * @param suffix Static value used for concatenation only.
  14240. * @param sanitizer An optional sanitizer function
  14241. * @returns itself, so that it may be chained.
  14242. * @codeGenApi
  14243. */
  14244. declare function ɵɵattributeInterpolate8(attrName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any, suffix: string, sanitizer?: SanitizerFn, namespace?: string): typeof ɵɵattributeInterpolate8;
  14245. /**
  14246. * Update an interpolated attribute on an element with 9 or more bound values surrounded by text.
  14247. *
  14248. * Used when the number of interpolated values exceeds 8.
  14249. *
  14250. * ```html
  14251. * <div
  14252. * title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix"></div>
  14253. * ```
  14254. *
  14255. * Its compiled representation is::
  14256. *
  14257. * ```ts
  14258. * ɵɵattributeInterpolateV(
  14259. * 'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
  14260. * 'suffix']);
  14261. * ```
  14262. *
  14263. * @param attrName The name of the attribute to update.
  14264. * @param values The collection of values and the strings in-between those values, beginning with
  14265. * a string prefix and ending with a string suffix.
  14266. * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
  14267. * @param sanitizer An optional sanitizer function
  14268. * @returns itself, so that it may be chained.
  14269. * @codeGenApi
  14270. */
  14271. declare function ɵɵattributeInterpolateV(attrName: string, values: any[], sanitizer?: SanitizerFn, namespace?: string): typeof ɵɵattributeInterpolateV;
  14272. /**
  14273. *
  14274. * Update an interpolated class on an element with single bound value surrounded by text.
  14275. *
  14276. * Used when the value passed to a property has 1 interpolated value in it:
  14277. *
  14278. * ```html
  14279. * <div class="prefix{{v0}}suffix"></div>
  14280. * ```
  14281. *
  14282. * Its compiled representation is:
  14283. *
  14284. * ```ts
  14285. * ɵɵclassMapInterpolate1('prefix', v0, 'suffix');
  14286. * ```
  14287. *
  14288. * @param prefix Static value used for concatenation only.
  14289. * @param v0 Value checked for change.
  14290. * @param suffix Static value used for concatenation only.
  14291. * @codeGenApi
  14292. */
  14293. declare function ɵɵclassMapInterpolate1(prefix: string, v0: any, suffix: string): void;
  14294. /**
  14295. *
  14296. * Update an interpolated class on an element with 2 bound values surrounded by text.
  14297. *
  14298. * Used when the value passed to a property has 2 interpolated values in it:
  14299. *
  14300. * ```html
  14301. * <div class="prefix{{v0}}-{{v1}}suffix"></div>
  14302. * ```
  14303. *
  14304. * Its compiled representation is:
  14305. *
  14306. * ```ts
  14307. * ɵɵclassMapInterpolate2('prefix', v0, '-', v1, 'suffix');
  14308. * ```
  14309. *
  14310. * @param prefix Static value used for concatenation only.
  14311. * @param v0 Value checked for change.
  14312. * @param i0 Static value used for concatenation only.
  14313. * @param v1 Value checked for change.
  14314. * @param suffix Static value used for concatenation only.
  14315. * @codeGenApi
  14316. */
  14317. declare function ɵɵclassMapInterpolate2(prefix: string, v0: any, i0: string, v1: any, suffix: string): void;
  14318. /**
  14319. *
  14320. * Update an interpolated class on an element with 3 bound values surrounded by text.
  14321. *
  14322. * Used when the value passed to a property has 3 interpolated values in it:
  14323. *
  14324. * ```html
  14325. * <div class="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
  14326. * ```
  14327. *
  14328. * Its compiled representation is:
  14329. *
  14330. * ```ts
  14331. * ɵɵclassMapInterpolate3(
  14332. * 'prefix', v0, '-', v1, '-', v2, 'suffix');
  14333. * ```
  14334. *
  14335. * @param prefix Static value used for concatenation only.
  14336. * @param v0 Value checked for change.
  14337. * @param i0 Static value used for concatenation only.
  14338. * @param v1 Value checked for change.
  14339. * @param i1 Static value used for concatenation only.
  14340. * @param v2 Value checked for change.
  14341. * @param suffix Static value used for concatenation only.
  14342. * @codeGenApi
  14343. */
  14344. declare function ɵɵclassMapInterpolate3(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string): void;
  14345. /**
  14346. *
  14347. * Update an interpolated class on an element with 4 bound values surrounded by text.
  14348. *
  14349. * Used when the value passed to a property has 4 interpolated values in it:
  14350. *
  14351. * ```html
  14352. * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
  14353. * ```
  14354. *
  14355. * Its compiled representation is:
  14356. *
  14357. * ```ts
  14358. * ɵɵclassMapInterpolate4(
  14359. * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
  14360. * ```
  14361. *
  14362. * @param prefix Static value used for concatenation only.
  14363. * @param v0 Value checked for change.
  14364. * @param i0 Static value used for concatenation only.
  14365. * @param v1 Value checked for change.
  14366. * @param i1 Static value used for concatenation only.
  14367. * @param v2 Value checked for change.
  14368. * @param i2 Static value used for concatenation only.
  14369. * @param v3 Value checked for change.
  14370. * @param suffix Static value used for concatenation only.
  14371. * @codeGenApi
  14372. */
  14373. declare function ɵɵclassMapInterpolate4(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix: string): void;
  14374. /**
  14375. *
  14376. * Update an interpolated class on an element with 5 bound values surrounded by text.
  14377. *
  14378. * Used when the value passed to a property has 5 interpolated values in it:
  14379. *
  14380. * ```html
  14381. * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
  14382. * ```
  14383. *
  14384. * Its compiled representation is:
  14385. *
  14386. * ```ts
  14387. * ɵɵclassMapInterpolate5(
  14388. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
  14389. * ```
  14390. *
  14391. * @param prefix Static value used for concatenation only.
  14392. * @param v0 Value checked for change.
  14393. * @param i0 Static value used for concatenation only.
  14394. * @param v1 Value checked for change.
  14395. * @param i1 Static value used for concatenation only.
  14396. * @param v2 Value checked for change.
  14397. * @param i2 Static value used for concatenation only.
  14398. * @param v3 Value checked for change.
  14399. * @param i3 Static value used for concatenation only.
  14400. * @param v4 Value checked for change.
  14401. * @param suffix Static value used for concatenation only.
  14402. * @codeGenApi
  14403. */
  14404. declare function ɵɵclassMapInterpolate5(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, suffix: string): void;
  14405. /**
  14406. *
  14407. * Update an interpolated class on an element with 6 bound values surrounded by text.
  14408. *
  14409. * Used when the value passed to a property has 6 interpolated values in it:
  14410. *
  14411. * ```html
  14412. * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
  14413. * ```
  14414. *
  14415. * Its compiled representation is:
  14416. *
  14417. * ```ts
  14418. * ɵɵclassMapInterpolate6(
  14419. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
  14420. * ```
  14421. *
  14422. * @param prefix Static value used for concatenation only.
  14423. * @param v0 Value checked for change.
  14424. * @param i0 Static value used for concatenation only.
  14425. * @param v1 Value checked for change.
  14426. * @param i1 Static value used for concatenation only.
  14427. * @param v2 Value checked for change.
  14428. * @param i2 Static value used for concatenation only.
  14429. * @param v3 Value checked for change.
  14430. * @param i3 Static value used for concatenation only.
  14431. * @param v4 Value checked for change.
  14432. * @param i4 Static value used for concatenation only.
  14433. * @param v5 Value checked for change.
  14434. * @param suffix Static value used for concatenation only.
  14435. * @codeGenApi
  14436. */
  14437. declare function ɵɵclassMapInterpolate6(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string): void;
  14438. /**
  14439. *
  14440. * Update an interpolated class on an element with 7 bound values surrounded by text.
  14441. *
  14442. * Used when the value passed to a property has 7 interpolated values in it:
  14443. *
  14444. * ```html
  14445. * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div>
  14446. * ```
  14447. *
  14448. * Its compiled representation is:
  14449. *
  14450. * ```ts
  14451. * ɵɵclassMapInterpolate7(
  14452. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
  14453. * ```
  14454. *
  14455. * @param prefix Static value used for concatenation only.
  14456. * @param v0 Value checked for change.
  14457. * @param i0 Static value used for concatenation only.
  14458. * @param v1 Value checked for change.
  14459. * @param i1 Static value used for concatenation only.
  14460. * @param v2 Value checked for change.
  14461. * @param i2 Static value used for concatenation only.
  14462. * @param v3 Value checked for change.
  14463. * @param i3 Static value used for concatenation only.
  14464. * @param v4 Value checked for change.
  14465. * @param i4 Static value used for concatenation only.
  14466. * @param v5 Value checked for change.
  14467. * @param i5 Static value used for concatenation only.
  14468. * @param v6 Value checked for change.
  14469. * @param suffix Static value used for concatenation only.
  14470. * @codeGenApi
  14471. */
  14472. declare function ɵɵclassMapInterpolate7(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string): void;
  14473. /**
  14474. *
  14475. * Update an interpolated class on an element with 8 bound values surrounded by text.
  14476. *
  14477. * Used when the value passed to a property has 8 interpolated values in it:
  14478. *
  14479. * ```html
  14480. * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div>
  14481. * ```
  14482. *
  14483. * Its compiled representation is:
  14484. *
  14485. * ```ts
  14486. * ɵɵclassMapInterpolate8(
  14487. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
  14488. * ```
  14489. *
  14490. * @param prefix Static value used for concatenation only.
  14491. * @param v0 Value checked for change.
  14492. * @param i0 Static value used for concatenation only.
  14493. * @param v1 Value checked for change.
  14494. * @param i1 Static value used for concatenation only.
  14495. * @param v2 Value checked for change.
  14496. * @param i2 Static value used for concatenation only.
  14497. * @param v3 Value checked for change.
  14498. * @param i3 Static value used for concatenation only.
  14499. * @param v4 Value checked for change.
  14500. * @param i4 Static value used for concatenation only.
  14501. * @param v5 Value checked for change.
  14502. * @param i5 Static value used for concatenation only.
  14503. * @param v6 Value checked for change.
  14504. * @param i6 Static value used for concatenation only.
  14505. * @param v7 Value checked for change.
  14506. * @param suffix Static value used for concatenation only.
  14507. * @codeGenApi
  14508. */
  14509. declare function ɵɵclassMapInterpolate8(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any, suffix: string): void;
  14510. /**
  14511. * Update an interpolated class on an element with 9 or more bound values surrounded by text.
  14512. *
  14513. * Used when the number of interpolated values exceeds 8.
  14514. *
  14515. * ```html
  14516. * <div
  14517. * class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix"></div>
  14518. * ```
  14519. *
  14520. * Its compiled representation is:
  14521. *
  14522. * ```ts
  14523. * ɵɵclassMapInterpolateV(
  14524. * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
  14525. * 'suffix']);
  14526. * ```
  14527. *.
  14528. * @param values The collection of values and the strings in-between those values, beginning with
  14529. * a string prefix and ending with a string suffix.
  14530. * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
  14531. * @codeGenApi
  14532. */
  14533. declare function ɵɵclassMapInterpolateV(values: any[]): void;
  14534. /*!
  14535. * @license
  14536. * Copyright Google LLC All Rights Reserved.
  14537. *
  14538. * Use of this source code is governed by an MIT-style license that can be
  14539. * found in the LICENSE file at https://angular.dev/license
  14540. */
  14541. /**
  14542. * Instruction that returns the component instance in which the current instruction is executing.
  14543. * This is a constant-time version of `nextContent` for the case where we know that we need the
  14544. * component instance specifically, rather than the context of a particular template.
  14545. *
  14546. * @codeGenApi
  14547. */
  14548. declare function ɵɵcomponentInstance(): unknown;
  14549. /**
  14550. * The conditional instruction represents the basic building block on the runtime side to support
  14551. * built-in "if" and "switch". On the high level this instruction is responsible for adding and
  14552. * removing views selected by a conditional expression.
  14553. *
  14554. * @param matchingTemplateIndex Index of a template TNode representing a conditional view to be
  14555. * inserted; -1 represents a special case when there is no view to insert.
  14556. * @param contextValue Value that should be exposed as the context of the conditional.
  14557. * @codeGenApi
  14558. */
  14559. declare function ɵɵconditional<T>(matchingTemplateIndex: number, contextValue?: T): void;
  14560. /**
  14561. * A built-in trackBy function used for situations where users specified collection index as a
  14562. * tracking expression. Having this function body in the runtime avoids unnecessary code generation.
  14563. *
  14564. * @param index
  14565. * @returns
  14566. */
  14567. declare function ɵɵrepeaterTrackByIndex(index: number): number;
  14568. /**
  14569. * A built-in trackBy function used for situations where users specified collection item reference
  14570. * as a tracking expression. Having this function body in the runtime avoids unnecessary code
  14571. * generation.
  14572. *
  14573. * @param index
  14574. * @returns
  14575. */
  14576. declare function ɵɵrepeaterTrackByIdentity<T>(_: number, value: T): T;
  14577. /**
  14578. * The repeaterCreate instruction runs in the creation part of the template pass and initializes
  14579. * internal data structures required by the update pass of the built-in repeater logic. Repeater
  14580. * metadata are allocated in the data part of LView with the following layout:
  14581. * - LView[HEADER_OFFSET + index] - metadata
  14582. * - LView[HEADER_OFFSET + index + 1] - reference to a template function rendering an item
  14583. * - LView[HEADER_OFFSET + index + 2] - optional reference to a template function rendering an empty
  14584. * block
  14585. *
  14586. * @param index Index at which to store the metadata of the repeater.
  14587. * @param templateFn Reference to the template of the main repeater block.
  14588. * @param decls The number of nodes, local refs, and pipes for the main block.
  14589. * @param vars The number of bindings for the main block.
  14590. * @param tagName The name of the container element, if applicable
  14591. * @param attrsIndex Index of template attributes in the `consts` array.
  14592. * @param trackByFn Reference to the tracking function.
  14593. * @param trackByUsesComponentInstance Whether the tracking function has any references to the
  14594. * component instance. If it doesn't, we can avoid rebinding it.
  14595. * @param emptyTemplateFn Reference to the template function of the empty block.
  14596. * @param emptyDecls The number of nodes, local refs, and pipes for the empty block.
  14597. * @param emptyVars The number of bindings for the empty block.
  14598. * @param emptyTagName The name of the empty block container element, if applicable
  14599. * @param emptyAttrsIndex Index of the empty block template attributes in the `consts` array.
  14600. *
  14601. * @codeGenApi
  14602. */
  14603. declare function ɵɵrepeaterCreate(index: number, templateFn: ComponentTemplate<unknown>, decls: number, vars: number, tagName: string | null, attrsIndex: number | null, trackByFn: TrackByFunction<unknown>, trackByUsesComponentInstance?: boolean, emptyTemplateFn?: ComponentTemplate<unknown>, emptyDecls?: number, emptyVars?: number, emptyTagName?: string | null, emptyAttrsIndex?: number | null): void;
  14604. /**
  14605. * The repeater instruction does update-time diffing of a provided collection (against the
  14606. * collection seen previously) and maps changes in the collection to views structure (by adding,
  14607. * removing or moving views as needed).
  14608. * @param collection - the collection instance to be checked for changes
  14609. * @codeGenApi
  14610. */
  14611. declare function ɵɵrepeater(collection: Iterable<unknown> | undefined | null): void;
  14612. /**
  14613. * Returns the value associated to the given token from the injectors.
  14614. *
  14615. * `directiveInject` is intended to be used for directive, component and pipe factories.
  14616. * All other injection use `inject` which does not walk the node injector tree.
  14617. *
  14618. * Usage example (in factory function):
  14619. *
  14620. * ```ts
  14621. * class SomeDirective {
  14622. * constructor(directive: DirectiveA) {}
  14623. *
  14624. * static ɵdir = ɵɵdefineDirective({
  14625. * type: SomeDirective,
  14626. * factory: () => new SomeDirective(ɵɵdirectiveInject(DirectiveA))
  14627. * });
  14628. * }
  14629. * ```
  14630. * @param token the type or token to inject
  14631. * @param flags Injection flags
  14632. * @returns the value from the injector or `null` when not found
  14633. *
  14634. * @codeGenApi
  14635. */
  14636. declare function ɵɵdirectiveInject<T>(token: ProviderToken<T>): T;
  14637. declare function ɵɵdirectiveInject<T>(token: ProviderToken<T>, flags: InjectFlags): T;
  14638. /**
  14639. * Throws an error indicating that a factory function could not be generated by the compiler for a
  14640. * particular class.
  14641. *
  14642. * This instruction allows the actual error message to be optimized away when ngDevMode is turned
  14643. * off, saving bytes of generated code while still providing a good experience in dev mode.
  14644. *
  14645. * The name of the class is not mentioned here, but will be in the generated factory function name
  14646. * and thus in the stack trace.
  14647. *
  14648. * @codeGenApi
  14649. */
  14650. declare function ɵɵinvalidFactory(): never;
  14651. /**
  14652. * Facade for the attribute injection from DI.
  14653. *
  14654. * @codeGenApi
  14655. */
  14656. declare function ɵɵinjectAttribute(attrNameToInject: string): string | null;
  14657. /**
  14658. * Create DOM element. The instruction must later be followed by `elementEnd()` call.
  14659. *
  14660. * @param index Index of the element in the LView array
  14661. * @param name Name of the DOM Node
  14662. * @param attrsIndex Index of the element's attributes in the `consts` array.
  14663. * @param localRefsIndex Index of the element's local references in the `consts` array.
  14664. * @returns This function returns itself so that it may be chained.
  14665. *
  14666. * Attributes and localRefs are passed as an array of strings where elements with an even index
  14667. * hold an attribute name and elements with an odd index hold an attribute value, ex.:
  14668. * ['id', 'warning5', 'class', 'alert']
  14669. *
  14670. * @codeGenApi
  14671. */
  14672. declare function ɵɵelementStart(index: number, name: string, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵelementStart;
  14673. /**
  14674. * Mark the end of the element.
  14675. * @returns This function returns itself so that it may be chained.
  14676. *
  14677. * @codeGenApi
  14678. */
  14679. declare function ɵɵelementEnd(): typeof ɵɵelementEnd;
  14680. /**
  14681. * Creates an empty element using {@link elementStart} and {@link elementEnd}
  14682. *
  14683. * @param index Index of the element in the data array
  14684. * @param name Name of the DOM Node
  14685. * @param attrsIndex Index of the element's attributes in the `consts` array.
  14686. * @param localRefsIndex Index of the element's local references in the `consts` array.
  14687. * @returns This function returns itself so that it may be chained.
  14688. *
  14689. * @codeGenApi
  14690. */
  14691. declare function ɵɵelement(index: number, name: string, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵelement;
  14692. /**
  14693. * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM.
  14694. * The instruction must later be followed by `elementContainerEnd()` call.
  14695. *
  14696. * @param index Index of the element in the LView array
  14697. * @param attrsIndex Index of the container attributes in the `consts` array.
  14698. * @param localRefsIndex Index of the container's local references in the `consts` array.
  14699. * @returns This function returns itself so that it may be chained.
  14700. *
  14701. * Even if this instruction accepts a set of attributes no actual attribute values are propagated to
  14702. * the DOM (as a comment node can't have attributes). Attributes are here only for directive
  14703. * matching purposes and setting initial inputs of directives.
  14704. *
  14705. * @codeGenApi
  14706. */
  14707. declare function ɵɵelementContainerStart(index: number, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵelementContainerStart;
  14708. /**
  14709. * Mark the end of the <ng-container>.
  14710. * @returns This function returns itself so that it may be chained.
  14711. *
  14712. * @codeGenApi
  14713. */
  14714. declare function ɵɵelementContainerEnd(): typeof ɵɵelementContainerEnd;
  14715. /**
  14716. * Creates an empty logical container using {@link elementContainerStart}
  14717. * and {@link elementContainerEnd}
  14718. *
  14719. * @param index Index of the element in the LView array
  14720. * @param attrsIndex Index of the container attributes in the `consts` array.
  14721. * @param localRefsIndex Index of the container's local references in the `consts` array.
  14722. * @returns This function returns itself so that it may be chained.
  14723. *
  14724. * @codeGenApi
  14725. */
  14726. declare function ɵɵelementContainer(index: number, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵelementContainer;
  14727. /**
  14728. * Sets a strict mode for JIT-compiled components to throw an error on unknown elements,
  14729. * instead of just logging the error.
  14730. * (for AOT-compiled ones this check happens at build time).
  14731. */
  14732. declare function ɵsetUnknownElementStrictMode(shouldThrow: boolean): void;
  14733. /**
  14734. * Gets the current value of the strict mode.
  14735. */
  14736. declare function ɵgetUnknownElementStrictMode(): boolean;
  14737. /**
  14738. * Sets a strict mode for JIT-compiled components to throw an error on unknown properties,
  14739. * instead of just logging the error.
  14740. * (for AOT-compiled ones this check happens at build time).
  14741. */
  14742. declare function ɵsetUnknownPropertyStrictMode(shouldThrow: boolean): void;
  14743. /**
  14744. * Gets the current value of the strict mode.
  14745. */
  14746. declare function ɵgetUnknownPropertyStrictMode(): boolean;
  14747. /**
  14748. * Returns the current OpaqueViewState instance.
  14749. *
  14750. * Used in conjunction with the restoreView() instruction to save a snapshot
  14751. * of the current view and restore it when listeners are invoked. This allows
  14752. * walking the declaration view tree in listeners to get vars from parent views.
  14753. *
  14754. * @codeGenApi
  14755. */
  14756. declare function ɵɵgetCurrentView(): OpaqueViewState;
  14757. interface NO_CHANGE {
  14758. __brand__: 'NO_CHANGE';
  14759. }
  14760. /** A special value which designates that a value has not changed. */
  14761. declare const NO_CHANGE: NO_CHANGE;
  14762. /**
  14763. * Update a property on a host element. Only applies to native node properties, not inputs.
  14764. *
  14765. * Operates on the element selected by index via the {@link select} instruction.
  14766. *
  14767. * @param propName Name of property. Because it is going to DOM, this is not subject to
  14768. * renaming as part of minification.
  14769. * @param value New value to write.
  14770. * @param sanitizer An optional function used to sanitize the value.
  14771. * @returns This function returns itself so that it may be chained
  14772. * (e.g. `property('name', ctx.name)('title', ctx.title)`)
  14773. *
  14774. * @codeGenApi
  14775. */
  14776. declare function ɵɵhostProperty<T>(propName: string, value: T, sanitizer?: SanitizerFn | null): typeof ɵɵhostProperty;
  14777. /**
  14778. * Updates a synthetic host binding (e.g. `[@foo]`) on a component or directive.
  14779. *
  14780. * This instruction is for compatibility purposes and is designed to ensure that a
  14781. * synthetic host binding (e.g. `@HostBinding('@foo')`) properly gets rendered in
  14782. * the component's renderer. Normally all host bindings are evaluated with the parent
  14783. * component's renderer, but, in the case of animation @triggers, they need to be
  14784. * evaluated with the sub component's renderer (because that's where the animation
  14785. * triggers are defined).
  14786. *
  14787. * Do not use this instruction as a replacement for `elementProperty`. This instruction
  14788. * only exists to ensure compatibility with the ViewEngine's host binding behavior.
  14789. *
  14790. * @param index The index of the element to update in the data array
  14791. * @param propName Name of property. Because it is going to DOM, this is not subject to
  14792. * renaming as part of minification.
  14793. * @param value New value to write.
  14794. * @param sanitizer An optional function used to sanitize the value.
  14795. *
  14796. * @codeGenApi
  14797. */
  14798. declare function ɵɵsyntheticHostProperty<T>(propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null): typeof ɵɵsyntheticHostProperty;
  14799. declare global {
  14800. const ngI18nClosureMode: boolean;
  14801. }
  14802. /**
  14803. * Marks a block of text as translatable.
  14804. *
  14805. * The instructions `i18nStart` and `i18nEnd` mark the translation block in the template.
  14806. * The translation `message` is the value which is locale specific. The translation string may
  14807. * contain placeholders which associate inner elements and sub-templates within the translation.
  14808. *
  14809. * The translation `message` placeholders are:
  14810. * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be
  14811. * interpolated into. The placeholder `index` points to the expression binding index. An optional
  14812. * `block` that matches the sub-template in which it was declared.
  14813. * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*: Marks the beginning
  14814. * and end of DOM element that were embedded in the original translation block. The placeholder
  14815. * `index` points to the element index in the template instructions set. An optional `block` that
  14816. * matches the sub-template in which it was declared.
  14817. * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be
  14818. * split up and translated separately in each angular template function. The `index` points to the
  14819. * `template` instruction index. A `block` that matches the sub-template in which it was declared.
  14820. *
  14821. * @param index A unique index of the translation in the static block.
  14822. * @param messageIndex An index of the translation message from the `def.consts` array.
  14823. * @param subTemplateIndex Optional sub-template index in the `message`.
  14824. *
  14825. * @codeGenApi
  14826. */
  14827. declare function ɵɵi18nStart(index: number, messageIndex: number, subTemplateIndex?: number): void;
  14828. /**
  14829. * Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes
  14830. * into the render tree, moves the placeholder nodes and removes the deleted nodes.
  14831. *
  14832. * @codeGenApi
  14833. */
  14834. declare function ɵɵi18nEnd(): void;
  14835. /**
  14836. *
  14837. * Use this instruction to create a translation block that doesn't contain any placeholder.
  14838. * It calls both {@link i18nStart} and {@link i18nEnd} in one instruction.
  14839. *
  14840. * The translation `message` is the value which is locale specific. The translation string may
  14841. * contain placeholders which associate inner elements and sub-templates within the translation.
  14842. *
  14843. * The translation `message` placeholders are:
  14844. * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be
  14845. * interpolated into. The placeholder `index` points to the expression binding index. An optional
  14846. * `block` that matches the sub-template in which it was declared.
  14847. * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*: Marks the beginning
  14848. * and end of DOM element that were embedded in the original translation block. The placeholder
  14849. * `index` points to the element index in the template instructions set. An optional `block` that
  14850. * matches the sub-template in which it was declared.
  14851. * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be
  14852. * split up and translated separately in each angular template function. The `index` points to the
  14853. * `template` instruction index. A `block` that matches the sub-template in which it was declared.
  14854. *
  14855. * @param index A unique index of the translation in the static block.
  14856. * @param messageIndex An index of the translation message from the `def.consts` array.
  14857. * @param subTemplateIndex Optional sub-template index in the `message`.
  14858. *
  14859. * @codeGenApi
  14860. */
  14861. declare function ɵɵi18n(index: number, messageIndex: number, subTemplateIndex?: number): void;
  14862. /**
  14863. * Marks a list of attributes as translatable.
  14864. *
  14865. * @param index A unique index in the static block
  14866. * @param values
  14867. *
  14868. * @codeGenApi
  14869. */
  14870. declare function ɵɵi18nAttributes(index: number, attrsIndex: number): void;
  14871. /**
  14872. * Stores the values of the bindings during each update cycle in order to determine if we need to
  14873. * update the translated nodes.
  14874. *
  14875. * @param value The binding's value
  14876. * @returns This function returns itself so that it may be chained
  14877. * (e.g. `i18nExp(ctx.name)(ctx.title)`)
  14878. *
  14879. * @codeGenApi
  14880. */
  14881. declare function ɵɵi18nExp<T>(value: T): typeof ɵɵi18nExp;
  14882. /**
  14883. * Updates a translation block or an i18n attribute when the bindings have changed.
  14884. *
  14885. * @param index Index of either {@link i18nStart} (translation block) or {@link i18nAttributes}
  14886. * (i18n attribute) on which it should update the content.
  14887. *
  14888. * @codeGenApi
  14889. */
  14890. declare function ɵɵi18nApply(index: number): void;
  14891. /**
  14892. * Handles message string post-processing for internationalization.
  14893. *
  14894. * Handles message string post-processing by transforming it from intermediate
  14895. * format (that might contain some markers that we need to replace) to the final
  14896. * form, consumable by i18nStart instruction. Post processing steps include:
  14897. *
  14898. * 1. Resolve all multi-value cases (like [�*1:1��#2:1�|�#4:1�|�5�])
  14899. * 2. Replace all ICU vars (like "VAR_PLURAL")
  14900. * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}
  14901. * 4. Replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�)
  14902. * in case multiple ICUs have the same placeholder name
  14903. *
  14904. * @param message Raw translation string for post processing
  14905. * @param replacements Set of replacements that should be applied
  14906. *
  14907. * @returns Transformed string that can be consumed by i18nStart instruction
  14908. *
  14909. * @codeGenApi
  14910. */
  14911. declare function ɵɵi18nPostprocess(message: string, replacements?: {
  14912. [key: string]: string | string[];
  14913. }): string;
  14914. /**
  14915. * Adds an event listener to the current node.
  14916. *
  14917. * If an output exists on one of the node's directives, it also subscribes to the output
  14918. * and saves the subscription for later cleanup.
  14919. *
  14920. * @param eventName Name of the event
  14921. * @param listenerFn The function to be called when event emits
  14922. * @param useCapture Whether or not to use capture in event listener - this argument is a reminder
  14923. * from the Renderer3 infrastructure and should be removed from the instruction arguments
  14924. * @param eventTargetResolver Function that returns global target information in case this listener
  14925. * should be attached to a global object like window, document or body
  14926. *
  14927. * @codeGenApi
  14928. */
  14929. declare function ɵɵlistener(eventName: string, listenerFn: (e?: any) => any, useCapture?: boolean, eventTargetResolver?: GlobalTargetResolver): typeof ɵɵlistener;
  14930. /**
  14931. * Registers a synthetic host listener (e.g. `(@foo.start)`) on a component or directive.
  14932. *
  14933. * This instruction is for compatibility purposes and is designed to ensure that a
  14934. * synthetic host listener (e.g. `@HostListener('@foo.start')`) properly gets rendered
  14935. * in the component's renderer. Normally all host listeners are evaluated with the
  14936. * parent component's renderer, but, in the case of animation @triggers, they need
  14937. * to be evaluated with the sub component's renderer (because that's where the
  14938. * animation triggers are defined).
  14939. *
  14940. * Do not use this instruction as a replacement for `listener`. This instruction
  14941. * only exists to ensure compatibility with the ViewEngine's host binding behavior.
  14942. *
  14943. * @param eventName Name of the event
  14944. * @param listenerFn The function to be called when event emits
  14945. * @param useCapture Whether or not to use capture in event listener
  14946. * @param eventTargetResolver Function that returns global target information in case this listener
  14947. * should be attached to a global object like window, document or body
  14948. *
  14949. * @codeGenApi
  14950. */
  14951. declare function ɵɵsyntheticHostListener(eventName: string, listenerFn: (e?: any) => any): typeof ɵɵsyntheticHostListener;
  14952. /**
  14953. * Retrieves a context at the level specified and saves it as the global, contextViewData.
  14954. * Will get the next level up if level is not specified.
  14955. *
  14956. * This is used to save contexts of parent views so they can be bound in embedded views, or
  14957. * in conjunction with reference() to bind a ref from a parent view.
  14958. *
  14959. * @param level The relative level of the view from which to grab context compared to contextVewData
  14960. * @returns context
  14961. *
  14962. * @codeGenApi
  14963. */
  14964. declare function ɵɵnextContext<T = any>(level?: number): T;
  14965. /**
  14966. * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.
  14967. * It takes all the selectors from the entire component's template and decides where
  14968. * each projected node belongs (it re-distributes nodes among "buckets" where each "bucket" is
  14969. * backed by a selector).
  14970. *
  14971. * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,
  14972. * un-parsed form.
  14973. *
  14974. * The parsed form is needed for efficient matching of a node against a given CSS selector.
  14975. * The un-parsed, textual form is needed for support of the ngProjectAs attribute.
  14976. *
  14977. * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more
  14978. * drawbacks:
  14979. * - having only a textual form would require runtime parsing of CSS selectors;
  14980. * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a
  14981. * template author).
  14982. *
  14983. * @param projectionSlots? A collection of projection slots. A projection slot can be based
  14984. * on a parsed CSS selectors or set to the wildcard selector ("*") in order to match
  14985. * all nodes which do not match any selector. If not specified, a single wildcard
  14986. * selector projection slot will be defined.
  14987. *
  14988. * @codeGenApi
  14989. */
  14990. declare function ɵɵprojectionDef(projectionSlots?: ProjectionSlots): void;
  14991. /**
  14992. * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call
  14993. * to the projectionDef instruction.
  14994. *
  14995. * @param nodeIndex Index of the projection node.
  14996. * @param selectorIndex Index of the slot selector.
  14997. * - 0 when the selector is `*` (or unspecified as this is the default value),
  14998. * - 1 based index of the selector from the {@link projectionDef}
  14999. * @param attrs Static attributes set on the `ng-content` node.
  15000. * @param fallbackTemplateFn Template function with fallback content.
  15001. * Will be rendered if the slot is empty at runtime.
  15002. * @param fallbackDecls Number of declarations in the fallback template.
  15003. * @param fallbackVars Number of variables in the fallback template.
  15004. *
  15005. * @codeGenApi
  15006. */
  15007. declare function ɵɵprojection(nodeIndex: number, selectorIndex?: number, attrs?: TAttributes, fallbackTemplateFn?: ComponentTemplate<unknown>, fallbackDecls?: number, fallbackVars?: number): void;
  15008. /**
  15009. * Update a property on a selected element.
  15010. *
  15011. * Operates on the element selected by index via the {@link select} instruction.
  15012. *
  15013. * If the property name also exists as an input property on one of the element's directives,
  15014. * the component property will be set instead of the element property. This check must
  15015. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled
  15016. *
  15017. * @param propName Name of property. Because it is going to DOM, this is not subject to
  15018. * renaming as part of minification.
  15019. * @param value New value to write.
  15020. * @param sanitizer An optional function used to sanitize the value.
  15021. * @returns This function returns itself so that it may be chained
  15022. * (e.g. `property('name', ctx.name)('title', ctx.title)`)
  15023. *
  15024. * @codeGenApi
  15025. */
  15026. declare function ɵɵproperty<T>(propName: string, value: T, sanitizer?: SanitizerFn | null): typeof ɵɵproperty;
  15027. /**
  15028. *
  15029. * Update an interpolated property on an element with a lone bound value
  15030. *
  15031. * Used when the value passed to a property has 1 interpolated value in it, an no additional text
  15032. * surrounds that interpolated value:
  15033. *
  15034. * ```html
  15035. * <div title="{{v0}}"></div>
  15036. * ```
  15037. *
  15038. * Its compiled representation is::
  15039. *
  15040. * ```ts
  15041. * ɵɵpropertyInterpolate('title', v0);
  15042. * ```
  15043. *
  15044. * If the property name also exists as an input property on one of the element's directives,
  15045. * the component property will be set instead of the element property. This check must
  15046. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15047. *
  15048. * @param propName The name of the property to update
  15049. * @param prefix Static value used for concatenation only.
  15050. * @param v0 Value checked for change.
  15051. * @param suffix Static value used for concatenation only.
  15052. * @param sanitizer An optional sanitizer function
  15053. * @returns itself, so that it may be chained.
  15054. * @codeGenApi
  15055. */
  15056. declare function ɵɵpropertyInterpolate(propName: string, v0: any, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate;
  15057. /**
  15058. *
  15059. * Update an interpolated property on an element with single bound value surrounded by text.
  15060. *
  15061. * Used when the value passed to a property has 1 interpolated value in it:
  15062. *
  15063. * ```html
  15064. * <div title="prefix{{v0}}suffix"></div>
  15065. * ```
  15066. *
  15067. * Its compiled representation is::
  15068. *
  15069. * ```ts
  15070. * ɵɵpropertyInterpolate1('title', 'prefix', v0, 'suffix');
  15071. * ```
  15072. *
  15073. * If the property name also exists as an input property on one of the element's directives,
  15074. * the component property will be set instead of the element property. This check must
  15075. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15076. *
  15077. * @param propName The name of the property to update
  15078. * @param prefix Static value used for concatenation only.
  15079. * @param v0 Value checked for change.
  15080. * @param suffix Static value used for concatenation only.
  15081. * @param sanitizer An optional sanitizer function
  15082. * @returns itself, so that it may be chained.
  15083. * @codeGenApi
  15084. */
  15085. declare function ɵɵpropertyInterpolate1(propName: string, prefix: string, v0: any, suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate1;
  15086. /**
  15087. *
  15088. * Update an interpolated property on an element with 2 bound values surrounded by text.
  15089. *
  15090. * Used when the value passed to a property has 2 interpolated values in it:
  15091. *
  15092. * ```html
  15093. * <div title="prefix{{v0}}-{{v1}}suffix"></div>
  15094. * ```
  15095. *
  15096. * Its compiled representation is::
  15097. *
  15098. * ```ts
  15099. * ɵɵpropertyInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
  15100. * ```
  15101. *
  15102. * If the property name also exists as an input property on one of the element's directives,
  15103. * the component property will be set instead of the element property. This check must
  15104. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15105. *
  15106. * @param propName The name of the property to update
  15107. * @param prefix Static value used for concatenation only.
  15108. * @param v0 Value checked for change.
  15109. * @param i0 Static value used for concatenation only.
  15110. * @param v1 Value checked for change.
  15111. * @param suffix Static value used for concatenation only.
  15112. * @param sanitizer An optional sanitizer function
  15113. * @returns itself, so that it may be chained.
  15114. * @codeGenApi
  15115. */
  15116. declare function ɵɵpropertyInterpolate2(propName: string, prefix: string, v0: any, i0: string, v1: any, suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate2;
  15117. /**
  15118. *
  15119. * Update an interpolated property on an element with 3 bound values surrounded by text.
  15120. *
  15121. * Used when the value passed to a property has 3 interpolated values in it:
  15122. *
  15123. * ```html
  15124. * <div title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
  15125. * ```
  15126. *
  15127. * Its compiled representation is::
  15128. *
  15129. * ```ts
  15130. * ɵɵpropertyInterpolate3(
  15131. * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
  15132. * ```
  15133. *
  15134. * If the property name also exists as an input property on one of the element's directives,
  15135. * the component property will be set instead of the element property. This check must
  15136. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15137. *
  15138. * @param propName The name of the property to update
  15139. * @param prefix Static value used for concatenation only.
  15140. * @param v0 Value checked for change.
  15141. * @param i0 Static value used for concatenation only.
  15142. * @param v1 Value checked for change.
  15143. * @param i1 Static value used for concatenation only.
  15144. * @param v2 Value checked for change.
  15145. * @param suffix Static value used for concatenation only.
  15146. * @param sanitizer An optional sanitizer function
  15147. * @returns itself, so that it may be chained.
  15148. * @codeGenApi
  15149. */
  15150. declare function ɵɵpropertyInterpolate3(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate3;
  15151. /**
  15152. *
  15153. * Update an interpolated property on an element with 4 bound values surrounded by text.
  15154. *
  15155. * Used when the value passed to a property has 4 interpolated values in it:
  15156. *
  15157. * ```html
  15158. * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
  15159. * ```
  15160. *
  15161. * Its compiled representation is::
  15162. *
  15163. * ```ts
  15164. * ɵɵpropertyInterpolate4(
  15165. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
  15166. * ```
  15167. *
  15168. * If the property name also exists as an input property on one of the element's directives,
  15169. * the component property will be set instead of the element property. This check must
  15170. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15171. *
  15172. * @param propName The name of the property to update
  15173. * @param prefix Static value used for concatenation only.
  15174. * @param v0 Value checked for change.
  15175. * @param i0 Static value used for concatenation only.
  15176. * @param v1 Value checked for change.
  15177. * @param i1 Static value used for concatenation only.
  15178. * @param v2 Value checked for change.
  15179. * @param i2 Static value used for concatenation only.
  15180. * @param v3 Value checked for change.
  15181. * @param suffix Static value used for concatenation only.
  15182. * @param sanitizer An optional sanitizer function
  15183. * @returns itself, so that it may be chained.
  15184. * @codeGenApi
  15185. */
  15186. declare function ɵɵpropertyInterpolate4(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate4;
  15187. /**
  15188. *
  15189. * Update an interpolated property on an element with 5 bound values surrounded by text.
  15190. *
  15191. * Used when the value passed to a property has 5 interpolated values in it:
  15192. *
  15193. * ```html
  15194. * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
  15195. * ```
  15196. *
  15197. * Its compiled representation is::
  15198. *
  15199. * ```ts
  15200. * ɵɵpropertyInterpolate5(
  15201. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
  15202. * ```
  15203. *
  15204. * If the property name also exists as an input property on one of the element's directives,
  15205. * the component property will be set instead of the element property. This check must
  15206. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15207. *
  15208. * @param propName The name of the property to update
  15209. * @param prefix Static value used for concatenation only.
  15210. * @param v0 Value checked for change.
  15211. * @param i0 Static value used for concatenation only.
  15212. * @param v1 Value checked for change.
  15213. * @param i1 Static value used for concatenation only.
  15214. * @param v2 Value checked for change.
  15215. * @param i2 Static value used for concatenation only.
  15216. * @param v3 Value checked for change.
  15217. * @param i3 Static value used for concatenation only.
  15218. * @param v4 Value checked for change.
  15219. * @param suffix Static value used for concatenation only.
  15220. * @param sanitizer An optional sanitizer function
  15221. * @returns itself, so that it may be chained.
  15222. * @codeGenApi
  15223. */
  15224. declare function ɵɵpropertyInterpolate5(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate5;
  15225. /**
  15226. *
  15227. * Update an interpolated property on an element with 6 bound values surrounded by text.
  15228. *
  15229. * Used when the value passed to a property has 6 interpolated values in it:
  15230. *
  15231. * ```html
  15232. * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
  15233. * ```
  15234. *
  15235. * Its compiled representation is::
  15236. *
  15237. * ```ts
  15238. * ɵɵpropertyInterpolate6(
  15239. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
  15240. * ```
  15241. *
  15242. * If the property name also exists as an input property on one of the element's directives,
  15243. * the component property will be set instead of the element property. This check must
  15244. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15245. *
  15246. * @param propName The name of the property to update
  15247. * @param prefix Static value used for concatenation only.
  15248. * @param v0 Value checked for change.
  15249. * @param i0 Static value used for concatenation only.
  15250. * @param v1 Value checked for change.
  15251. * @param i1 Static value used for concatenation only.
  15252. * @param v2 Value checked for change.
  15253. * @param i2 Static value used for concatenation only.
  15254. * @param v3 Value checked for change.
  15255. * @param i3 Static value used for concatenation only.
  15256. * @param v4 Value checked for change.
  15257. * @param i4 Static value used for concatenation only.
  15258. * @param v5 Value checked for change.
  15259. * @param suffix Static value used for concatenation only.
  15260. * @param sanitizer An optional sanitizer function
  15261. * @returns itself, so that it may be chained.
  15262. * @codeGenApi
  15263. */
  15264. declare function ɵɵpropertyInterpolate6(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate6;
  15265. /**
  15266. *
  15267. * Update an interpolated property on an element with 7 bound values surrounded by text.
  15268. *
  15269. * Used when the value passed to a property has 7 interpolated values in it:
  15270. *
  15271. * ```html
  15272. * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div>
  15273. * ```
  15274. *
  15275. * Its compiled representation is::
  15276. *
  15277. * ```ts
  15278. * ɵɵpropertyInterpolate7(
  15279. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
  15280. * ```
  15281. *
  15282. * If the property name also exists as an input property on one of the element's directives,
  15283. * the component property will be set instead of the element property. This check must
  15284. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15285. *
  15286. * @param propName The name of the property to update
  15287. * @param prefix Static value used for concatenation only.
  15288. * @param v0 Value checked for change.
  15289. * @param i0 Static value used for concatenation only.
  15290. * @param v1 Value checked for change.
  15291. * @param i1 Static value used for concatenation only.
  15292. * @param v2 Value checked for change.
  15293. * @param i2 Static value used for concatenation only.
  15294. * @param v3 Value checked for change.
  15295. * @param i3 Static value used for concatenation only.
  15296. * @param v4 Value checked for change.
  15297. * @param i4 Static value used for concatenation only.
  15298. * @param v5 Value checked for change.
  15299. * @param i5 Static value used for concatenation only.
  15300. * @param v6 Value checked for change.
  15301. * @param suffix Static value used for concatenation only.
  15302. * @param sanitizer An optional sanitizer function
  15303. * @returns itself, so that it may be chained.
  15304. * @codeGenApi
  15305. */
  15306. declare function ɵɵpropertyInterpolate7(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate7;
  15307. /**
  15308. *
  15309. * Update an interpolated property on an element with 8 bound values surrounded by text.
  15310. *
  15311. * Used when the value passed to a property has 8 interpolated values in it:
  15312. *
  15313. * ```html
  15314. * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div>
  15315. * ```
  15316. *
  15317. * Its compiled representation is::
  15318. *
  15319. * ```ts
  15320. * ɵɵpropertyInterpolate8(
  15321. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
  15322. * ```
  15323. *
  15324. * If the property name also exists as an input property on one of the element's directives,
  15325. * the component property will be set instead of the element property. This check must
  15326. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15327. *
  15328. * @param propName The name of the property to update
  15329. * @param prefix Static value used for concatenation only.
  15330. * @param v0 Value checked for change.
  15331. * @param i0 Static value used for concatenation only.
  15332. * @param v1 Value checked for change.
  15333. * @param i1 Static value used for concatenation only.
  15334. * @param v2 Value checked for change.
  15335. * @param i2 Static value used for concatenation only.
  15336. * @param v3 Value checked for change.
  15337. * @param i3 Static value used for concatenation only.
  15338. * @param v4 Value checked for change.
  15339. * @param i4 Static value used for concatenation only.
  15340. * @param v5 Value checked for change.
  15341. * @param i5 Static value used for concatenation only.
  15342. * @param v6 Value checked for change.
  15343. * @param i6 Static value used for concatenation only.
  15344. * @param v7 Value checked for change.
  15345. * @param suffix Static value used for concatenation only.
  15346. * @param sanitizer An optional sanitizer function
  15347. * @returns itself, so that it may be chained.
  15348. * @codeGenApi
  15349. */
  15350. declare function ɵɵpropertyInterpolate8(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any, suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate8;
  15351. /**
  15352. * Update an interpolated property on an element with 9 or more bound values surrounded by text.
  15353. *
  15354. * Used when the number of interpolated values exceeds 8.
  15355. *
  15356. * ```html
  15357. * <div
  15358. * title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix"></div>
  15359. * ```
  15360. *
  15361. * Its compiled representation is::
  15362. *
  15363. * ```ts
  15364. * ɵɵpropertyInterpolateV(
  15365. * 'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
  15366. * 'suffix']);
  15367. * ```
  15368. *
  15369. * If the property name also exists as an input property on one of the element's directives,
  15370. * the component property will be set instead of the element property. This check must
  15371. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15372. *
  15373. * @param propName The name of the property to update.
  15374. * @param values The collection of values and the strings in between those values, beginning with a
  15375. * string prefix and ending with a string suffix.
  15376. * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
  15377. * @param sanitizer An optional sanitizer function
  15378. * @returns itself, so that it may be chained.
  15379. * @codeGenApi
  15380. */
  15381. declare function ɵɵpropertyInterpolateV(propName: string, values: any[], sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolateV;
  15382. /**
  15383. * Registers a QueryList, associated with a content query, for later refresh (part of a view
  15384. * refresh).
  15385. *
  15386. * @param directiveIndex Current directive index
  15387. * @param predicate The type for which the query will search
  15388. * @param flags Flags associated with the query
  15389. * @param read What to save in the query
  15390. * @returns QueryList<T>
  15391. *
  15392. * @codeGenApi
  15393. */
  15394. declare function ɵɵcontentQuery<T>(directiveIndex: number, predicate: ProviderToken<unknown> | string | string[], flags: QueryFlags, read?: any): void;
  15395. /**
  15396. * Creates a new view query by initializing internal data structures.
  15397. *
  15398. * @param predicate The type for which the query will search
  15399. * @param flags Flags associated with the query
  15400. * @param read What to save in the query
  15401. *
  15402. * @codeGenApi
  15403. */
  15404. declare function ɵɵviewQuery<T>(predicate: ProviderToken<unknown> | string | string[], flags: QueryFlags, read?: any): void;
  15405. /**
  15406. * Refreshes a query by combining matches from all active views and removing matches from deleted
  15407. * views.
  15408. *
  15409. * @returns `true` if a query got dirty during change detection or if this is a static query
  15410. * resolving in creation mode, `false` otherwise.
  15411. *
  15412. * @codeGenApi
  15413. */
  15414. declare function ɵɵqueryRefresh(queryList: QueryList<any>): boolean;
  15415. /**
  15416. * Loads a QueryList corresponding to the current view or content query.
  15417. *
  15418. * @codeGenApi
  15419. */
  15420. declare function ɵɵloadQuery<T>(): QueryList<T>;
  15421. /**
  15422. * Creates a new content query and binds it to a signal created by an authoring function.
  15423. *
  15424. * @param directiveIndex Current directive index
  15425. * @param target The target signal to which the query should be bound
  15426. * @param predicate The type for which the query will search
  15427. * @param flags Flags associated with the query
  15428. * @param read What to save in the query
  15429. *
  15430. * @codeGenApi
  15431. */
  15432. declare function ɵɵcontentQuerySignal<T>(directiveIndex: number, target: Signal<T>, predicate: ProviderToken<unknown> | string[], flags: QueryFlags, read?: any): void;
  15433. /**
  15434. * Creates a new view query by initializing internal data structures and binding a new query to the
  15435. * target signal.
  15436. *
  15437. * @param target The target signal to assign the query results to.
  15438. * @param predicate The type or label that should match a given query
  15439. * @param flags Flags associated with the query
  15440. * @param read What to save in the query
  15441. *
  15442. * @codeGenApi
  15443. */
  15444. declare function ɵɵviewQuerySignal(target: Signal<unknown>, predicate: ProviderToken<unknown> | string[], flags: QueryFlags, read?: ProviderToken<unknown>): void;
  15445. /**
  15446. * Advances the current query index by a specified offset.
  15447. *
  15448. * Adjusting the current query index is necessary in cases where a given directive has a mix of
  15449. * zone-based and signal-based queries. The signal-based queries don't require tracking of the
  15450. * current index (those are refreshed on demand and not during change detection) so this instruction
  15451. * is only necessary for backward-compatibility.
  15452. *
  15453. * @param index offset to apply to the current query index (defaults to 1)
  15454. *
  15455. * @codeGenApi
  15456. */
  15457. declare function ɵɵqueryAdvance(indexOffset?: number): void;
  15458. /** Store a value in the `data` at a given `index`. */
  15459. declare function store<T>(tView: TView, lView: LView, index: number, value: T): void;
  15460. /**
  15461. * Retrieves a local reference from the current contextViewData.
  15462. *
  15463. * If the reference to retrieve is in a parent view, this instruction is used in conjunction
  15464. * with a nextContext() call, which walks up the tree and updates the contextViewData instance.
  15465. *
  15466. * @param index The index of the local ref in contextViewData.
  15467. *
  15468. * @codeGenApi
  15469. */
  15470. declare function ɵɵreference<T>(index: number): T;
  15471. /**
  15472. *
  15473. * Update an interpolated style on an element with single bound value surrounded by text.
  15474. *
  15475. * Used when the value passed to a property has 1 interpolated value in it:
  15476. *
  15477. * ```html
  15478. * <div style="key: {{v0}}suffix"></div>
  15479. * ```
  15480. *
  15481. * Its compiled representation is:
  15482. *
  15483. * ```ts
  15484. * ɵɵstyleMapInterpolate1('key: ', v0, 'suffix');
  15485. * ```
  15486. *
  15487. * @param prefix Static value used for concatenation only.
  15488. * @param v0 Value checked for change.
  15489. * @param suffix Static value used for concatenation only.
  15490. * @codeGenApi
  15491. */
  15492. declare function ɵɵstyleMapInterpolate1(prefix: string, v0: any, suffix: string): void;
  15493. /**
  15494. *
  15495. * Update an interpolated style on an element with 2 bound values surrounded by text.
  15496. *
  15497. * Used when the value passed to a property has 2 interpolated values in it:
  15498. *
  15499. * ```html
  15500. * <div style="key: {{v0}}; key1: {{v1}}suffix"></div>
  15501. * ```
  15502. *
  15503. * Its compiled representation is:
  15504. *
  15505. * ```ts
  15506. * ɵɵstyleMapInterpolate2('key: ', v0, '; key1: ', v1, 'suffix');
  15507. * ```
  15508. *
  15509. * @param prefix Static value used for concatenation only.
  15510. * @param v0 Value checked for change.
  15511. * @param i0 Static value used for concatenation only.
  15512. * @param v1 Value checked for change.
  15513. * @param suffix Static value used for concatenation only.
  15514. * @codeGenApi
  15515. */
  15516. declare function ɵɵstyleMapInterpolate2(prefix: string, v0: any, i0: string, v1: any, suffix: string): void;
  15517. /**
  15518. *
  15519. * Update an interpolated style on an element with 3 bound values surrounded by text.
  15520. *
  15521. * Used when the value passed to a property has 3 interpolated values in it:
  15522. *
  15523. * ```html
  15524. * <div style="key: {{v0}}; key2: {{v1}}; key2: {{v2}}suffix"></div>
  15525. * ```
  15526. *
  15527. * Its compiled representation is:
  15528. *
  15529. * ```ts
  15530. * ɵɵstyleMapInterpolate3(
  15531. * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, 'suffix');
  15532. * ```
  15533. *
  15534. * @param prefix Static value used for concatenation only.
  15535. * @param v0 Value checked for change.
  15536. * @param i0 Static value used for concatenation only.
  15537. * @param v1 Value checked for change.
  15538. * @param i1 Static value used for concatenation only.
  15539. * @param v2 Value checked for change.
  15540. * @param suffix Static value used for concatenation only.
  15541. * @codeGenApi
  15542. */
  15543. declare function ɵɵstyleMapInterpolate3(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string): void;
  15544. /**
  15545. *
  15546. * Update an interpolated style on an element with 4 bound values surrounded by text.
  15547. *
  15548. * Used when the value passed to a property has 4 interpolated values in it:
  15549. *
  15550. * ```html
  15551. * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}suffix"></div>
  15552. * ```
  15553. *
  15554. * Its compiled representation is:
  15555. *
  15556. * ```ts
  15557. * ɵɵstyleMapInterpolate4(
  15558. * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, 'suffix');
  15559. * ```
  15560. *
  15561. * @param prefix Static value used for concatenation only.
  15562. * @param v0 Value checked for change.
  15563. * @param i0 Static value used for concatenation only.
  15564. * @param v1 Value checked for change.
  15565. * @param i1 Static value used for concatenation only.
  15566. * @param v2 Value checked for change.
  15567. * @param i2 Static value used for concatenation only.
  15568. * @param v3 Value checked for change.
  15569. * @param suffix Static value used for concatenation only.
  15570. * @codeGenApi
  15571. */
  15572. declare function ɵɵstyleMapInterpolate4(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix: string): void;
  15573. /**
  15574. *
  15575. * Update an interpolated style on an element with 5 bound values surrounded by text.
  15576. *
  15577. * Used when the value passed to a property has 5 interpolated values in it:
  15578. *
  15579. * ```html
  15580. * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}suffix"></div>
  15581. * ```
  15582. *
  15583. * Its compiled representation is:
  15584. *
  15585. * ```ts
  15586. * ɵɵstyleMapInterpolate5(
  15587. * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, 'suffix');
  15588. * ```
  15589. *
  15590. * @param prefix Static value used for concatenation only.
  15591. * @param v0 Value checked for change.
  15592. * @param i0 Static value used for concatenation only.
  15593. * @param v1 Value checked for change.
  15594. * @param i1 Static value used for concatenation only.
  15595. * @param v2 Value checked for change.
  15596. * @param i2 Static value used for concatenation only.
  15597. * @param v3 Value checked for change.
  15598. * @param i3 Static value used for concatenation only.
  15599. * @param v4 Value checked for change.
  15600. * @param suffix Static value used for concatenation only.
  15601. * @codeGenApi
  15602. */
  15603. declare function ɵɵstyleMapInterpolate5(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, suffix: string): void;
  15604. /**
  15605. *
  15606. * Update an interpolated style on an element with 6 bound values surrounded by text.
  15607. *
  15608. * Used when the value passed to a property has 6 interpolated values in it:
  15609. *
  15610. * ```html
  15611. * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}};
  15612. * key5: {{v5}}suffix"></div>
  15613. * ```
  15614. *
  15615. * Its compiled representation is:
  15616. *
  15617. * ```ts
  15618. * ɵɵstyleMapInterpolate6(
  15619. * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,
  15620. * 'suffix');
  15621. * ```
  15622. *
  15623. * @param prefix Static value used for concatenation only.
  15624. * @param v0 Value checked for change.
  15625. * @param i0 Static value used for concatenation only.
  15626. * @param v1 Value checked for change.
  15627. * @param i1 Static value used for concatenation only.
  15628. * @param v2 Value checked for change.
  15629. * @param i2 Static value used for concatenation only.
  15630. * @param v3 Value checked for change.
  15631. * @param i3 Static value used for concatenation only.
  15632. * @param v4 Value checked for change.
  15633. * @param i4 Static value used for concatenation only.
  15634. * @param v5 Value checked for change.
  15635. * @param suffix Static value used for concatenation only.
  15636. * @codeGenApi
  15637. */
  15638. declare function ɵɵstyleMapInterpolate6(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string): void;
  15639. /**
  15640. *
  15641. * Update an interpolated style on an element with 7 bound values surrounded by text.
  15642. *
  15643. * Used when the value passed to a property has 7 interpolated values in it:
  15644. *
  15645. * ```html
  15646. * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};
  15647. * key6: {{v6}}suffix"></div>
  15648. * ```
  15649. *
  15650. * Its compiled representation is:
  15651. *
  15652. * ```ts
  15653. * ɵɵstyleMapInterpolate7(
  15654. * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,
  15655. * '; key6: ', v6, 'suffix');
  15656. * ```
  15657. *
  15658. * @param prefix Static value used for concatenation only.
  15659. * @param v0 Value checked for change.
  15660. * @param i0 Static value used for concatenation only.
  15661. * @param v1 Value checked for change.
  15662. * @param i1 Static value used for concatenation only.
  15663. * @param v2 Value checked for change.
  15664. * @param i2 Static value used for concatenation only.
  15665. * @param v3 Value checked for change.
  15666. * @param i3 Static value used for concatenation only.
  15667. * @param v4 Value checked for change.
  15668. * @param i4 Static value used for concatenation only.
  15669. * @param v5 Value checked for change.
  15670. * @param i5 Static value used for concatenation only.
  15671. * @param v6 Value checked for change.
  15672. * @param suffix Static value used for concatenation only.
  15673. * @codeGenApi
  15674. */
  15675. declare function ɵɵstyleMapInterpolate7(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string): void;
  15676. /**
  15677. *
  15678. * Update an interpolated style on an element with 8 bound values surrounded by text.
  15679. *
  15680. * Used when the value passed to a property has 8 interpolated values in it:
  15681. *
  15682. * ```html
  15683. * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};
  15684. * key6: {{v6}}; key7: {{v7}}suffix"></div>
  15685. * ```
  15686. *
  15687. * Its compiled representation is:
  15688. *
  15689. * ```ts
  15690. * ɵɵstyleMapInterpolate8(
  15691. * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,
  15692. * '; key6: ', v6, '; key7: ', v7, 'suffix');
  15693. * ```
  15694. *
  15695. * @param prefix Static value used for concatenation only.
  15696. * @param v0 Value checked for change.
  15697. * @param i0 Static value used for concatenation only.
  15698. * @param v1 Value checked for change.
  15699. * @param i1 Static value used for concatenation only.
  15700. * @param v2 Value checked for change.
  15701. * @param i2 Static value used for concatenation only.
  15702. * @param v3 Value checked for change.
  15703. * @param i3 Static value used for concatenation only.
  15704. * @param v4 Value checked for change.
  15705. * @param i4 Static value used for concatenation only.
  15706. * @param v5 Value checked for change.
  15707. * @param i5 Static value used for concatenation only.
  15708. * @param v6 Value checked for change.
  15709. * @param i6 Static value used for concatenation only.
  15710. * @param v7 Value checked for change.
  15711. * @param suffix Static value used for concatenation only.
  15712. * @codeGenApi
  15713. */
  15714. declare function ɵɵstyleMapInterpolate8(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any, suffix: string): void;
  15715. /**
  15716. * Update an interpolated style on an element with 9 or more bound values surrounded by text.
  15717. *
  15718. * Used when the number of interpolated values exceeds 8.
  15719. *
  15720. * ```html
  15721. * <div
  15722. * class="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};
  15723. * key6: {{v6}}; key7: {{v7}}; key8: {{v8}}; key9: {{v9}}suffix"></div>
  15724. * ```
  15725. *
  15726. * Its compiled representation is:
  15727. *
  15728. * ```ts
  15729. * ɵɵstyleMapInterpolateV(
  15730. * ['key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,
  15731. * '; key6: ', v6, '; key7: ', v7, '; key8: ', v8, '; key9: ', v9, 'suffix']);
  15732. * ```
  15733. *.
  15734. * @param values The collection of values and the strings in-between those values, beginning with
  15735. * a string prefix and ending with a string suffix.
  15736. * (e.g. `['prefix', value0, '; key2: ', value1, '; key2: ', value2, ..., value99, 'suffix']`)
  15737. * @codeGenApi
  15738. */
  15739. declare function ɵɵstyleMapInterpolateV(values: any[]): void;
  15740. /**
  15741. *
  15742. * Update an interpolated style property on an element with single bound value surrounded by text.
  15743. *
  15744. * Used when the value passed to a property has 1 interpolated value in it:
  15745. *
  15746. * ```html
  15747. * <div style.color="prefix{{v0}}suffix"></div>
  15748. * ```
  15749. *
  15750. * Its compiled representation is:
  15751. *
  15752. * ```ts
  15753. * ɵɵstylePropInterpolate1(0, 'prefix', v0, 'suffix');
  15754. * ```
  15755. *
  15756. * @param styleIndex Index of style to update. This index value refers to the
  15757. * index of the style in the style bindings array that was passed into
  15758. * `styling`.
  15759. * @param prefix Static value used for concatenation only.
  15760. * @param v0 Value checked for change.
  15761. * @param suffix Static value used for concatenation only.
  15762. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  15763. * @returns itself, so that it may be chained.
  15764. * @codeGenApi
  15765. */
  15766. declare function ɵɵstylePropInterpolate1(prop: string, prefix: string, v0: any, suffix: string, valueSuffix?: string | null): typeof ɵɵstylePropInterpolate1;
  15767. /**
  15768. *
  15769. * Update an interpolated style property on an element with 2 bound values surrounded by text.
  15770. *
  15771. * Used when the value passed to a property has 2 interpolated values in it:
  15772. *
  15773. * ```html
  15774. * <div style.color="prefix{{v0}}-{{v1}}suffix"></div>
  15775. * ```
  15776. *
  15777. * Its compiled representation is:
  15778. *
  15779. * ```ts
  15780. * ɵɵstylePropInterpolate2(0, 'prefix', v0, '-', v1, 'suffix');
  15781. * ```
  15782. *
  15783. * @param styleIndex Index of style to update. This index value refers to the
  15784. * index of the style in the style bindings array that was passed into
  15785. * `styling`.
  15786. * @param prefix Static value used for concatenation only.
  15787. * @param v0 Value checked for change.
  15788. * @param i0 Static value used for concatenation only.
  15789. * @param v1 Value checked for change.
  15790. * @param suffix Static value used for concatenation only.
  15791. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  15792. * @returns itself, so that it may be chained.
  15793. * @codeGenApi
  15794. */
  15795. declare function ɵɵstylePropInterpolate2(prop: string, prefix: string, v0: any, i0: string, v1: any, suffix: string, valueSuffix?: string | null): typeof ɵɵstylePropInterpolate2;
  15796. /**
  15797. *
  15798. * Update an interpolated style property on an element with 3 bound values surrounded by text.
  15799. *
  15800. * Used when the value passed to a property has 3 interpolated values in it:
  15801. *
  15802. * ```html
  15803. * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
  15804. * ```
  15805. *
  15806. * Its compiled representation is:
  15807. *
  15808. * ```ts
  15809. * ɵɵstylePropInterpolate3(0, 'prefix', v0, '-', v1, '-', v2, 'suffix');
  15810. * ```
  15811. *
  15812. * @param styleIndex Index of style to update. This index value refers to the
  15813. * index of the style in the style bindings array that was passed into
  15814. * `styling`.
  15815. * @param prefix Static value used for concatenation only.
  15816. * @param v0 Value checked for change.
  15817. * @param i0 Static value used for concatenation only.
  15818. * @param v1 Value checked for change.
  15819. * @param i1 Static value used for concatenation only.
  15820. * @param v2 Value checked for change.
  15821. * @param suffix Static value used for concatenation only.
  15822. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  15823. * @returns itself, so that it may be chained.
  15824. * @codeGenApi
  15825. */
  15826. declare function ɵɵstylePropInterpolate3(prop: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string, valueSuffix?: string | null): typeof ɵɵstylePropInterpolate3;
  15827. /**
  15828. *
  15829. * Update an interpolated style property on an element with 4 bound values surrounded by text.
  15830. *
  15831. * Used when the value passed to a property has 4 interpolated values in it:
  15832. *
  15833. * ```html
  15834. * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
  15835. * ```
  15836. *
  15837. * Its compiled representation is:
  15838. *
  15839. * ```ts
  15840. * ɵɵstylePropInterpolate4(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
  15841. * ```
  15842. *
  15843. * @param styleIndex Index of style to update. This index value refers to the
  15844. * index of the style in the style bindings array that was passed into
  15845. * `styling`.
  15846. * @param prefix Static value used for concatenation only.
  15847. * @param v0 Value checked for change.
  15848. * @param i0 Static value used for concatenation only.
  15849. * @param v1 Value checked for change.
  15850. * @param i1 Static value used for concatenation only.
  15851. * @param v2 Value checked for change.
  15852. * @param i2 Static value used for concatenation only.
  15853. * @param v3 Value checked for change.
  15854. * @param suffix Static value used for concatenation only.
  15855. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  15856. * @returns itself, so that it may be chained.
  15857. * @codeGenApi
  15858. */
  15859. declare function ɵɵstylePropInterpolate4(prop: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix: string, valueSuffix?: string | null): typeof ɵɵstylePropInterpolate4;
  15860. /**
  15861. *
  15862. * Update an interpolated style property on an element with 5 bound values surrounded by text.
  15863. *
  15864. * Used when the value passed to a property has 5 interpolated values in it:
  15865. *
  15866. * ```html
  15867. * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
  15868. * ```
  15869. *
  15870. * Its compiled representation is:
  15871. *
  15872. * ```ts
  15873. * ɵɵstylePropInterpolate5(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
  15874. * ```
  15875. *
  15876. * @param styleIndex Index of style to update. This index value refers to the
  15877. * index of the style in the style bindings array that was passed into
  15878. * `styling`.
  15879. * @param prefix Static value used for concatenation only.
  15880. * @param v0 Value checked for change.
  15881. * @param i0 Static value used for concatenation only.
  15882. * @param v1 Value checked for change.
  15883. * @param i1 Static value used for concatenation only.
  15884. * @param v2 Value checked for change.
  15885. * @param i2 Static value used for concatenation only.
  15886. * @param v3 Value checked for change.
  15887. * @param i3 Static value used for concatenation only.
  15888. * @param v4 Value checked for change.
  15889. * @param suffix Static value used for concatenation only.
  15890. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  15891. * @returns itself, so that it may be chained.
  15892. * @codeGenApi
  15893. */
  15894. declare function ɵɵstylePropInterpolate5(prop: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, suffix: string, valueSuffix?: string | null): typeof ɵɵstylePropInterpolate5;
  15895. /**
  15896. *
  15897. * Update an interpolated style property on an element with 6 bound values surrounded by text.
  15898. *
  15899. * Used when the value passed to a property has 6 interpolated values in it:
  15900. *
  15901. * ```html
  15902. * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
  15903. * ```
  15904. *
  15905. * Its compiled representation is:
  15906. *
  15907. * ```ts
  15908. * ɵɵstylePropInterpolate6(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
  15909. * ```
  15910. *
  15911. * @param styleIndex Index of style to update. This index value refers to the
  15912. * index of the style in the style bindings array that was passed into
  15913. * `styling`.
  15914. * @param prefix Static value used for concatenation only.
  15915. * @param v0 Value checked for change.
  15916. * @param i0 Static value used for concatenation only.
  15917. * @param v1 Value checked for change.
  15918. * @param i1 Static value used for concatenation only.
  15919. * @param v2 Value checked for change.
  15920. * @param i2 Static value used for concatenation only.
  15921. * @param v3 Value checked for change.
  15922. * @param i3 Static value used for concatenation only.
  15923. * @param v4 Value checked for change.
  15924. * @param i4 Static value used for concatenation only.
  15925. * @param v5 Value checked for change.
  15926. * @param suffix Static value used for concatenation only.
  15927. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  15928. * @returns itself, so that it may be chained.
  15929. * @codeGenApi
  15930. */
  15931. declare function ɵɵstylePropInterpolate6(prop: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string, valueSuffix?: string | null): typeof ɵɵstylePropInterpolate6;
  15932. /**
  15933. *
  15934. * Update an interpolated style property on an element with 7 bound values surrounded by text.
  15935. *
  15936. * Used when the value passed to a property has 7 interpolated values in it:
  15937. *
  15938. * ```html
  15939. * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div>
  15940. * ```
  15941. *
  15942. * Its compiled representation is:
  15943. *
  15944. * ```ts
  15945. * ɵɵstylePropInterpolate7(
  15946. * 0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
  15947. * ```
  15948. *
  15949. * @param styleIndex Index of style to update. This index value refers to the
  15950. * index of the style in the style bindings array that was passed into
  15951. * `styling`.
  15952. * @param prefix Static value used for concatenation only.
  15953. * @param v0 Value checked for change.
  15954. * @param i0 Static value used for concatenation only.
  15955. * @param v1 Value checked for change.
  15956. * @param i1 Static value used for concatenation only.
  15957. * @param v2 Value checked for change.
  15958. * @param i2 Static value used for concatenation only.
  15959. * @param v3 Value checked for change.
  15960. * @param i3 Static value used for concatenation only.
  15961. * @param v4 Value checked for change.
  15962. * @param i4 Static value used for concatenation only.
  15963. * @param v5 Value checked for change.
  15964. * @param i5 Static value used for concatenation only.
  15965. * @param v6 Value checked for change.
  15966. * @param suffix Static value used for concatenation only.
  15967. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  15968. * @returns itself, so that it may be chained.
  15969. * @codeGenApi
  15970. */
  15971. declare function ɵɵstylePropInterpolate7(prop: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string, valueSuffix?: string | null): typeof ɵɵstylePropInterpolate7;
  15972. /**
  15973. *
  15974. * Update an interpolated style property on an element with 8 bound values surrounded by text.
  15975. *
  15976. * Used when the value passed to a property has 8 interpolated values in it:
  15977. *
  15978. * ```html
  15979. * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div>
  15980. * ```
  15981. *
  15982. * Its compiled representation is:
  15983. *
  15984. * ```ts
  15985. * ɵɵstylePropInterpolate8(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6,
  15986. * '-', v7, 'suffix');
  15987. * ```
  15988. *
  15989. * @param styleIndex Index of style to update. This index value refers to the
  15990. * index of the style in the style bindings array that was passed into
  15991. * `styling`.
  15992. * @param prefix Static value used for concatenation only.
  15993. * @param v0 Value checked for change.
  15994. * @param i0 Static value used for concatenation only.
  15995. * @param v1 Value checked for change.
  15996. * @param i1 Static value used for concatenation only.
  15997. * @param v2 Value checked for change.
  15998. * @param i2 Static value used for concatenation only.
  15999. * @param v3 Value checked for change.
  16000. * @param i3 Static value used for concatenation only.
  16001. * @param v4 Value checked for change.
  16002. * @param i4 Static value used for concatenation only.
  16003. * @param v5 Value checked for change.
  16004. * @param i5 Static value used for concatenation only.
  16005. * @param v6 Value checked for change.
  16006. * @param i6 Static value used for concatenation only.
  16007. * @param v7 Value checked for change.
  16008. * @param suffix Static value used for concatenation only.
  16009. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  16010. * @returns itself, so that it may be chained.
  16011. * @codeGenApi
  16012. */
  16013. declare function ɵɵstylePropInterpolate8(prop: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any, suffix: string, valueSuffix?: string | null): typeof ɵɵstylePropInterpolate8;
  16014. /**
  16015. * Update an interpolated style property on an element with 9 or more bound values surrounded by
  16016. * text.
  16017. *
  16018. * Used when the number of interpolated values exceeds 8.
  16019. *
  16020. * ```html
  16021. * <div
  16022. * style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix">
  16023. * </div>
  16024. * ```
  16025. *
  16026. * Its compiled representation is:
  16027. *
  16028. * ```ts
  16029. * ɵɵstylePropInterpolateV(
  16030. * 0, ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
  16031. * 'suffix']);
  16032. * ```
  16033. *
  16034. * @param styleIndex Index of style to update. This index value refers to the
  16035. * index of the style in the style bindings array that was passed into
  16036. * `styling`..
  16037. * @param values The collection of values and the strings in-between those values, beginning with
  16038. * a string prefix and ending with a string suffix.
  16039. * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
  16040. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  16041. * @returns itself, so that it may be chained.
  16042. * @codeGenApi
  16043. */
  16044. declare function ɵɵstylePropInterpolateV(prop: string, values: any[], valueSuffix?: string | null): typeof ɵɵstylePropInterpolateV;
  16045. /**
  16046. * Update a style binding on an element with the provided value.
  16047. *
  16048. * If the style value is falsy then it will be removed from the element
  16049. * (or assigned a different value depending if there are any styles placed
  16050. * on the element with `styleMap` or any static styles that are
  16051. * present from when the element was created with `styling`).
  16052. *
  16053. * Note that the styling element is updated as part of `stylingApply`.
  16054. *
  16055. * @param prop A valid CSS property.
  16056. * @param value New value to write (`null` or an empty string to remove).
  16057. * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.
  16058. *
  16059. * Note that this will apply the provided style value to the host element if this function is called
  16060. * within a host binding function.
  16061. *
  16062. * @codeGenApi
  16063. */
  16064. declare function ɵɵstyleProp(prop: string, value: string | number | SafeValue | undefined | null, suffix?: string | null): typeof ɵɵstyleProp;
  16065. /**
  16066. * Update a class binding on an element with the provided value.
  16067. *
  16068. * This instruction is meant to handle the `[class.foo]="exp"` case and,
  16069. * therefore, the class binding itself must already be allocated using
  16070. * `styling` within the creation block.
  16071. *
  16072. * @param prop A valid CSS class (only one).
  16073. * @param value A true/false value which will turn the class on or off.
  16074. *
  16075. * Note that this will apply the provided class value to the host element if this function
  16076. * is called within a host binding function.
  16077. *
  16078. * @codeGenApi
  16079. */
  16080. declare function ɵɵclassProp(className: string, value: boolean | undefined | null): typeof ɵɵclassProp;
  16081. /**
  16082. * Update style bindings using an object literal on an element.
  16083. *
  16084. * This instruction is meant to apply styling via the `[style]="exp"` template bindings.
  16085. * When styles are applied to the element they will then be updated with respect to
  16086. * any styles/classes set via `styleProp`. If any styles are set to falsy
  16087. * then they will be removed from the element.
  16088. *
  16089. * Note that the styling instruction will not be applied until `stylingApply` is called.
  16090. *
  16091. * @param styles A key/value style map of the styles that will be applied to the given element.
  16092. * Any missing styles (that have already been applied to the element beforehand) will be
  16093. * removed (unset) from the element's styling.
  16094. *
  16095. * Note that this will apply the provided styleMap value to the host element if this function
  16096. * is called within a host binding.
  16097. *
  16098. * @codeGenApi
  16099. */
  16100. declare function ɵɵstyleMap(styles: {
  16101. [styleName: string]: any;
  16102. } | string | undefined | null): void;
  16103. /**
  16104. * Update class bindings using an object literal or class-string on an element.
  16105. *
  16106. * This instruction is meant to apply styling via the `[class]="exp"` template bindings.
  16107. * When classes are applied to the element they will then be updated with
  16108. * respect to any styles/classes set via `classProp`. If any
  16109. * classes are set to falsy then they will be removed from the element.
  16110. *
  16111. * Note that the styling instruction will not be applied until `stylingApply` is called.
  16112. * Note that this will the provided classMap value to the host element if this function is called
  16113. * within a host binding.
  16114. *
  16115. * @param classes A key/value map or string of CSS classes that will be added to the
  16116. * given element. Any missing classes (that have already been applied to the element
  16117. * beforehand) will be removed (unset) from the element's list of CSS classes.
  16118. *
  16119. * @codeGenApi
  16120. */
  16121. declare function ɵɵclassMap(classes: {
  16122. [className: string]: boolean | undefined | null;
  16123. } | string | undefined | null): void;
  16124. /**
  16125. * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.
  16126. *
  16127. * <ng-template #foo>
  16128. * <div></div>
  16129. * </ng-template>
  16130. *
  16131. * @param index The index of the container in the data array
  16132. * @param templateFn Inline template
  16133. * @param decls The number of nodes, local refs, and pipes for this template
  16134. * @param vars The number of bindings for this template
  16135. * @param tagName The name of the container element, if applicable
  16136. * @param attrsIndex Index of template attributes in the `consts` array.
  16137. * @param localRefs Index of the local references in the `consts` array.
  16138. * @param localRefExtractor A function which extracts local-refs values from the template.
  16139. * Defaults to the current element associated with the local-ref.
  16140. *
  16141. * @codeGenApi
  16142. */
  16143. declare function ɵɵtemplate(index: number, templateFn: ComponentTemplate<any> | null, decls: number, vars: number, tagName?: string | null, attrsIndex?: number | null, localRefsIndex?: number | null, localRefExtractor?: LocalRefExtractor): typeof ɵɵtemplate;
  16144. /**
  16145. * Create static text node
  16146. *
  16147. * @param index Index of the node in the data array
  16148. * @param value Static string value to write.
  16149. *
  16150. * @codeGenApi
  16151. */
  16152. declare function ɵɵtext(index: number, value?: string): void;
  16153. /**
  16154. *
  16155. * Update text content with a lone bound value
  16156. *
  16157. * Used when a text node has 1 interpolated value in it, an no additional text
  16158. * surrounds that interpolated value:
  16159. *
  16160. * ```html
  16161. * <div>{{v0}}</div>
  16162. * ```
  16163. *
  16164. * Its compiled representation is:
  16165. *
  16166. * ```ts
  16167. * ɵɵtextInterpolate(v0);
  16168. * ```
  16169. * @returns itself, so that it may be chained.
  16170. * @see textInterpolateV
  16171. * @codeGenApi
  16172. */
  16173. declare function ɵɵtextInterpolate(v0: any): typeof ɵɵtextInterpolate;
  16174. /**
  16175. *
  16176. * Update text content with single bound value surrounded by other text.
  16177. *
  16178. * Used when a text node has 1 interpolated value in it:
  16179. *
  16180. * ```html
  16181. * <div>prefix{{v0}}suffix</div>
  16182. * ```
  16183. *
  16184. * Its compiled representation is:
  16185. *
  16186. * ```ts
  16187. * ɵɵtextInterpolate1('prefix', v0, 'suffix');
  16188. * ```
  16189. * @returns itself, so that it may be chained.
  16190. * @see textInterpolateV
  16191. * @codeGenApi
  16192. */
  16193. declare function ɵɵtextInterpolate1(prefix: string, v0: any, suffix: string): typeof ɵɵtextInterpolate1;
  16194. /**
  16195. *
  16196. * Update text content with 2 bound values surrounded by other text.
  16197. *
  16198. * Used when a text node has 2 interpolated values in it:
  16199. *
  16200. * ```html
  16201. * <div>prefix{{v0}}-{{v1}}suffix</div>
  16202. * ```
  16203. *
  16204. * Its compiled representation is:
  16205. *
  16206. * ```ts
  16207. * ɵɵtextInterpolate2('prefix', v0, '-', v1, 'suffix');
  16208. * ```
  16209. * @returns itself, so that it may be chained.
  16210. * @see textInterpolateV
  16211. * @codeGenApi
  16212. */
  16213. declare function ɵɵtextInterpolate2(prefix: string, v0: any, i0: string, v1: any, suffix: string): typeof ɵɵtextInterpolate2;
  16214. /**
  16215. *
  16216. * Update text content with 3 bound values surrounded by other text.
  16217. *
  16218. * Used when a text node has 3 interpolated values in it:
  16219. *
  16220. * ```html
  16221. * <div>prefix{{v0}}-{{v1}}-{{v2}}suffix</div>
  16222. * ```
  16223. *
  16224. * Its compiled representation is:
  16225. *
  16226. * ```ts
  16227. * ɵɵtextInterpolate3(
  16228. * 'prefix', v0, '-', v1, '-', v2, 'suffix');
  16229. * ```
  16230. * @returns itself, so that it may be chained.
  16231. * @see textInterpolateV
  16232. * @codeGenApi
  16233. */
  16234. declare function ɵɵtextInterpolate3(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string): typeof ɵɵtextInterpolate3;
  16235. /**
  16236. *
  16237. * Update text content with 4 bound values surrounded by other text.
  16238. *
  16239. * Used when a text node has 4 interpolated values in it:
  16240. *
  16241. * ```html
  16242. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix</div>
  16243. * ```
  16244. *
  16245. * Its compiled representation is:
  16246. *
  16247. * ```ts
  16248. * ɵɵtextInterpolate4(
  16249. * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
  16250. * ```
  16251. * @returns itself, so that it may be chained.
  16252. * @see ɵɵtextInterpolateV
  16253. * @codeGenApi
  16254. */
  16255. declare function ɵɵtextInterpolate4(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix: string): typeof ɵɵtextInterpolate4;
  16256. /**
  16257. *
  16258. * Update text content with 5 bound values surrounded by other text.
  16259. *
  16260. * Used when a text node has 5 interpolated values in it:
  16261. *
  16262. * ```html
  16263. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix</div>
  16264. * ```
  16265. *
  16266. * Its compiled representation is:
  16267. *
  16268. * ```ts
  16269. * ɵɵtextInterpolate5(
  16270. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
  16271. * ```
  16272. * @returns itself, so that it may be chained.
  16273. * @see textInterpolateV
  16274. * @codeGenApi
  16275. */
  16276. declare function ɵɵtextInterpolate5(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, suffix: string): typeof ɵɵtextInterpolate5;
  16277. /**
  16278. *
  16279. * Update text content with 6 bound values surrounded by other text.
  16280. *
  16281. * Used when a text node has 6 interpolated values in it:
  16282. *
  16283. * ```html
  16284. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix</div>
  16285. * ```
  16286. *
  16287. * Its compiled representation is:
  16288. *
  16289. * ```ts
  16290. * ɵɵtextInterpolate6(
  16291. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
  16292. * ```
  16293. *
  16294. * @param i4 Static value used for concatenation only.
  16295. * @param v5 Value checked for change. @returns itself, so that it may be chained.
  16296. * @see textInterpolateV
  16297. * @codeGenApi
  16298. */
  16299. declare function ɵɵtextInterpolate6(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string): typeof ɵɵtextInterpolate6;
  16300. /**
  16301. *
  16302. * Update text content with 7 bound values surrounded by other text.
  16303. *
  16304. * Used when a text node has 7 interpolated values in it:
  16305. *
  16306. * ```html
  16307. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix</div>
  16308. * ```
  16309. *
  16310. * Its compiled representation is:
  16311. *
  16312. * ```ts
  16313. * ɵɵtextInterpolate7(
  16314. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
  16315. * ```
  16316. * @returns itself, so that it may be chained.
  16317. * @see textInterpolateV
  16318. * @codeGenApi
  16319. */
  16320. declare function ɵɵtextInterpolate7(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string): typeof ɵɵtextInterpolate7;
  16321. /**
  16322. *
  16323. * Update text content with 8 bound values surrounded by other text.
  16324. *
  16325. * Used when a text node has 8 interpolated values in it:
  16326. *
  16327. * ```html
  16328. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix</div>
  16329. * ```
  16330. *
  16331. * Its compiled representation is:
  16332. *
  16333. * ```ts
  16334. * ɵɵtextInterpolate8(
  16335. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
  16336. * ```
  16337. * @returns itself, so that it may be chained.
  16338. * @see textInterpolateV
  16339. * @codeGenApi
  16340. */
  16341. declare function ɵɵtextInterpolate8(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any, suffix: string): typeof ɵɵtextInterpolate8;
  16342. /**
  16343. * Update text content with 9 or more bound values other surrounded by text.
  16344. *
  16345. * Used when the number of interpolated values exceeds 8.
  16346. *
  16347. * ```html
  16348. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix</div>
  16349. * ```
  16350. *
  16351. * Its compiled representation is:
  16352. *
  16353. * ```ts
  16354. * ɵɵtextInterpolateV(
  16355. * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
  16356. * 'suffix']);
  16357. * ```
  16358. *.
  16359. * @param values The collection of values and the strings in between those values, beginning with
  16360. * a string prefix and ending with a string suffix.
  16361. * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
  16362. *
  16363. * @returns itself, so that it may be chained.
  16364. * @codeGenApi
  16365. */
  16366. declare function ɵɵtextInterpolateV(values: any[]): typeof ɵɵtextInterpolateV;
  16367. /*!
  16368. * @license
  16369. * Copyright Google LLC All Rights Reserved.
  16370. *
  16371. * Use of this source code is governed by an MIT-style license that can be
  16372. * found in the LICENSE file at https://angular.dev/license
  16373. */
  16374. /**
  16375. * Update a two-way bound property on a selected element.
  16376. *
  16377. * Operates on the element selected by index via the {@link select} instruction.
  16378. *
  16379. * @param propName Name of property.
  16380. * @param value New value to write.
  16381. * @param sanitizer An optional function used to sanitize the value.
  16382. * @returns This function returns itself so that it may be chained
  16383. * (e.g. `twoWayProperty('name', ctx.name)('title', ctx.title)`)
  16384. *
  16385. * @codeGenApi
  16386. */
  16387. declare function ɵɵtwoWayProperty<T>(propName: string, value: T | WritableSignal<T>, sanitizer?: SanitizerFn | null): typeof ɵɵtwoWayProperty;
  16388. /**
  16389. * Function used inside two-way listeners to conditionally set the value of the bound expression.
  16390. *
  16391. * @param target Field on which to set the value.
  16392. * @param value Value to be set to the field.
  16393. *
  16394. * @codeGenApi
  16395. */
  16396. declare function ɵɵtwoWayBindingSet<T>(target: unknown, value: T): boolean;
  16397. /**
  16398. * Adds an event listener that updates a two-way binding to the current node.
  16399. *
  16400. * @param eventName Name of the event.
  16401. * @param listenerFn The function to be called when event emits.
  16402. *
  16403. * @codeGenApi
  16404. */
  16405. declare function ɵɵtwoWayListener(eventName: string, listenerFn: (e?: any) => any): typeof ɵɵtwoWayListener;
  16406. /*!
  16407. * @license
  16408. * Copyright Google LLC All Rights Reserved.
  16409. *
  16410. * Use of this source code is governed by an MIT-style license that can be
  16411. * found in the LICENSE file at https://angular.dev/license
  16412. */
  16413. /**
  16414. * Declares an `@let` at a specific data slot. Returns itself to allow chaining.
  16415. *
  16416. * @param index Index at which to declare the `@let`.
  16417. *
  16418. * @codeGenApi
  16419. */
  16420. declare function ɵɵdeclareLet(index: number): typeof ɵɵdeclareLet;
  16421. /**
  16422. * Instruction that stores the value of a `@let` declaration on the current view.
  16423. * Returns the value to allow usage inside variable initializers.
  16424. *
  16425. * @codeGenApi
  16426. */
  16427. declare function ɵɵstoreLet<T>(value: T): T;
  16428. /**
  16429. * Retrieves the value of a `@let` declaration defined in a parent view.
  16430. *
  16431. * @param index Index of the declaration within the view.
  16432. *
  16433. * @codeGenApi
  16434. */
  16435. declare function ɵɵreadContextLet<T>(index: number): T;
  16436. /*!
  16437. * @license
  16438. * Copyright Google LLC All Rights Reserved.
  16439. *
  16440. * Use of this source code is governed by an MIT-style license that can be
  16441. * found in the LICENSE file at https://angular.dev/license
  16442. */
  16443. /**
  16444. * Sets the location within the source template at which
  16445. * each element in the current view was defined.
  16446. *
  16447. * @param index Index at which the DOM node was created.
  16448. * @param templatePath Path to the template at which the node was defined.
  16449. * @param locations Element locations to which to attach the source location.
  16450. *
  16451. * @codeGenApi
  16452. */
  16453. declare function ɵɵattachSourceLocations(templatePath: string, locations: [index: number, offset: number, line: number, column: number][]): void;
  16454. /**
  16455. * Create a pipe.
  16456. *
  16457. * @param index Pipe index where the pipe will be stored.
  16458. * @param pipeName The name of the pipe
  16459. * @returns T the instance of the pipe.
  16460. *
  16461. * @codeGenApi
  16462. */
  16463. declare function ɵɵpipe(index: number, pipeName: string): any;
  16464. /**
  16465. * Invokes a pipe with 1 arguments.
  16466. *
  16467. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  16468. * the pipe only when an input to the pipe changes.
  16469. *
  16470. * @param index Pipe index where the pipe was stored on creation.
  16471. * @param offset the binding offset
  16472. * @param v1 1st argument to {@link PipeTransform#transform}.
  16473. *
  16474. * @codeGenApi
  16475. */
  16476. declare function ɵɵpipeBind1(index: number, offset: number, v1: any): any;
  16477. /**
  16478. * Invokes a pipe with 2 arguments.
  16479. *
  16480. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  16481. * the pipe only when an input to the pipe changes.
  16482. *
  16483. * @param index Pipe index where the pipe was stored on creation.
  16484. * @param slotOffset the offset in the reserved slot space
  16485. * @param v1 1st argument to {@link PipeTransform#transform}.
  16486. * @param v2 2nd argument to {@link PipeTransform#transform}.
  16487. *
  16488. * @codeGenApi
  16489. */
  16490. declare function ɵɵpipeBind2(index: number, slotOffset: number, v1: any, v2: any): any;
  16491. /**
  16492. * Invokes a pipe with 3 arguments.
  16493. *
  16494. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  16495. * the pipe only when an input to the pipe changes.
  16496. *
  16497. * @param index Pipe index where the pipe was stored on creation.
  16498. * @param slotOffset the offset in the reserved slot space
  16499. * @param v1 1st argument to {@link PipeTransform#transform}.
  16500. * @param v2 2nd argument to {@link PipeTransform#transform}.
  16501. * @param v3 4rd argument to {@link PipeTransform#transform}.
  16502. *
  16503. * @codeGenApi
  16504. */
  16505. declare function ɵɵpipeBind3(index: number, slotOffset: number, v1: any, v2: any, v3: any): any;
  16506. /**
  16507. * Invokes a pipe with 4 arguments.
  16508. *
  16509. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  16510. * the pipe only when an input to the pipe changes.
  16511. *
  16512. * @param index Pipe index where the pipe was stored on creation.
  16513. * @param slotOffset the offset in the reserved slot space
  16514. * @param v1 1st argument to {@link PipeTransform#transform}.
  16515. * @param v2 2nd argument to {@link PipeTransform#transform}.
  16516. * @param v3 3rd argument to {@link PipeTransform#transform}.
  16517. * @param v4 4th argument to {@link PipeTransform#transform}.
  16518. *
  16519. * @codeGenApi
  16520. */
  16521. declare function ɵɵpipeBind4(index: number, slotOffset: number, v1: any, v2: any, v3: any, v4: any): any;
  16522. /**
  16523. * Invokes a pipe with variable number of arguments.
  16524. *
  16525. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  16526. * the pipe only when an input to the pipe changes.
  16527. *
  16528. * @param index Pipe index where the pipe was stored on creation.
  16529. * @param slotOffset the offset in the reserved slot space
  16530. * @param values Array of arguments to pass to {@link PipeTransform#transform} method.
  16531. *
  16532. * @codeGenApi
  16533. */
  16534. declare function ɵɵpipeBindV(index: number, slotOffset: number, values: [any, ...any[]]): any;
  16535. /**
  16536. * Bindings for pure functions are stored after regular bindings.
  16537. *
  16538. * |-------decls------|---------vars---------| |----- hostVars (dir1) ------|
  16539. * ------------------------------------------------------------------------------------------
  16540. * | nodes/refs/pipes | bindings | fn slots | injector | dir1 | host bindings | host slots |
  16541. * ------------------------------------------------------------------------------------------
  16542. * ^ ^
  16543. * TView.bindingStartIndex TView.expandoStartIndex
  16544. *
  16545. * Pure function instructions are given an offset from the binding root. Adding the offset to the
  16546. * binding root gives the first index where the bindings are stored. In component views, the binding
  16547. * root is the bindingStartIndex. In host bindings, the binding root is the expandoStartIndex +
  16548. * any directive instances + any hostVars in directives evaluated before it.
  16549. *
  16550. * See VIEW_DATA.md for more information about host binding resolution.
  16551. */
  16552. /**
  16553. * If the value hasn't been saved, calls the pure function to store and return the
  16554. * value. If it has been saved, returns the saved value.
  16555. *
  16556. * @param slotOffset the offset from binding root to the reserved slot
  16557. * @param pureFn Function that returns a value
  16558. * @param thisArg Optional calling context of pureFn
  16559. * @returns value
  16560. *
  16561. * @codeGenApi
  16562. */
  16563. declare function ɵɵpureFunction0<T>(slotOffset: number, pureFn: () => T, thisArg?: any): T;
  16564. /**
  16565. * If the value of the provided exp has changed, calls the pure function to return
  16566. * an updated value. Or if the value has not changed, returns cached value.
  16567. *
  16568. * @param slotOffset the offset from binding root to the reserved slot
  16569. * @param pureFn Function that returns an updated value
  16570. * @param exp Updated expression value
  16571. * @param thisArg Optional calling context of pureFn
  16572. * @returns Updated or cached value
  16573. *
  16574. * @codeGenApi
  16575. */
  16576. declare function ɵɵpureFunction1(slotOffset: number, pureFn: (v: any) => any, exp: any, thisArg?: any): any;
  16577. /**
  16578. * If the value of any provided exp has changed, calls the pure function to return
  16579. * an updated value. Or if no values have changed, returns cached value.
  16580. *
  16581. * @param slotOffset the offset from binding root to the reserved slot
  16582. * @param pureFn
  16583. * @param exp1
  16584. * @param exp2
  16585. * @param thisArg Optional calling context of pureFn
  16586. * @returns Updated or cached value
  16587. *
  16588. * @codeGenApi
  16589. */
  16590. declare function ɵɵpureFunction2(slotOffset: number, pureFn: (v1: any, v2: any) => any, exp1: any, exp2: any, thisArg?: any): any;
  16591. /**
  16592. * If the value of any provided exp has changed, calls the pure function to return
  16593. * an updated value. Or if no values have changed, returns cached value.
  16594. *
  16595. * @param slotOffset the offset from binding root to the reserved slot
  16596. * @param pureFn
  16597. * @param exp1
  16598. * @param exp2
  16599. * @param exp3
  16600. * @param thisArg Optional calling context of pureFn
  16601. * @returns Updated or cached value
  16602. *
  16603. * @codeGenApi
  16604. */
  16605. declare function ɵɵpureFunction3(slotOffset: number, pureFn: (v1: any, v2: any, v3: any) => any, exp1: any, exp2: any, exp3: any, thisArg?: any): any;
  16606. /**
  16607. * If the value of any provided exp has changed, calls the pure function to return
  16608. * an updated value. Or if no values have changed, returns cached value.
  16609. *
  16610. * @param slotOffset the offset from binding root to the reserved slot
  16611. * @param pureFn
  16612. * @param exp1
  16613. * @param exp2
  16614. * @param exp3
  16615. * @param exp4
  16616. * @param thisArg Optional calling context of pureFn
  16617. * @returns Updated or cached value
  16618. *
  16619. * @codeGenApi
  16620. */
  16621. declare function ɵɵpureFunction4(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, thisArg?: any): any;
  16622. /**
  16623. * If the value of any provided exp has changed, calls the pure function to return
  16624. * an updated value. Or if no values have changed, returns cached value.
  16625. *
  16626. * @param slotOffset the offset from binding root to the reserved slot
  16627. * @param pureFn
  16628. * @param exp1
  16629. * @param exp2
  16630. * @param exp3
  16631. * @param exp4
  16632. * @param exp5
  16633. * @param thisArg Optional calling context of pureFn
  16634. * @returns Updated or cached value
  16635. *
  16636. * @codeGenApi
  16637. */
  16638. declare function ɵɵpureFunction5(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, thisArg?: any): any;
  16639. /**
  16640. * If the value of any provided exp has changed, calls the pure function to return
  16641. * an updated value. Or if no values have changed, returns cached value.
  16642. *
  16643. * @param slotOffset the offset from binding root to the reserved slot
  16644. * @param pureFn
  16645. * @param exp1
  16646. * @param exp2
  16647. * @param exp3
  16648. * @param exp4
  16649. * @param exp5
  16650. * @param exp6
  16651. * @param thisArg Optional calling context of pureFn
  16652. * @returns Updated or cached value
  16653. *
  16654. * @codeGenApi
  16655. */
  16656. declare function ɵɵpureFunction6(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, thisArg?: any): any;
  16657. /**
  16658. * If the value of any provided exp has changed, calls the pure function to return
  16659. * an updated value. Or if no values have changed, returns cached value.
  16660. *
  16661. * @param slotOffset the offset from binding root to the reserved slot
  16662. * @param pureFn
  16663. * @param exp1
  16664. * @param exp2
  16665. * @param exp3
  16666. * @param exp4
  16667. * @param exp5
  16668. * @param exp6
  16669. * @param exp7
  16670. * @param thisArg Optional calling context of pureFn
  16671. * @returns Updated or cached value
  16672. *
  16673. * @codeGenApi
  16674. */
  16675. declare function ɵɵpureFunction7(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, thisArg?: any): any;
  16676. /**
  16677. * If the value of any provided exp has changed, calls the pure function to return
  16678. * an updated value. Or if no values have changed, returns cached value.
  16679. *
  16680. * @param slotOffset the offset from binding root to the reserved slot
  16681. * @param pureFn
  16682. * @param exp1
  16683. * @param exp2
  16684. * @param exp3
  16685. * @param exp4
  16686. * @param exp5
  16687. * @param exp6
  16688. * @param exp7
  16689. * @param exp8
  16690. * @param thisArg Optional calling context of pureFn
  16691. * @returns Updated or cached value
  16692. *
  16693. * @codeGenApi
  16694. */
  16695. declare function ɵɵpureFunction8(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any, v8: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, exp8: any, thisArg?: any): any;
  16696. /**
  16697. * pureFunction instruction that can support any number of bindings.
  16698. *
  16699. * If the value of any provided exp has changed, calls the pure function to return
  16700. * an updated value. Or if no values have changed, returns cached value.
  16701. *
  16702. * @param slotOffset the offset from binding root to the reserved slot
  16703. * @param pureFn A pure function that takes binding values and builds an object or array
  16704. * containing those values.
  16705. * @param exps An array of binding values
  16706. * @param thisArg Optional calling context of pureFn
  16707. * @returns Updated or cached value
  16708. *
  16709. * @codeGenApi
  16710. */
  16711. declare function ɵɵpureFunctionV(slotOffset: number, pureFn: (...v: any[]) => any, exps: any[], thisArg?: any): any;
  16712. /**
  16713. *
  16714. * @codeGenApi
  16715. */
  16716. declare function ɵɵresolveWindow(element: RElement & {
  16717. ownerDocument: Document;
  16718. }): (Window & typeof globalThis) | null;
  16719. /**
  16720. *
  16721. * @codeGenApi
  16722. */
  16723. declare function ɵɵresolveDocument(element: RElement & {
  16724. ownerDocument: Document;
  16725. }): Document;
  16726. /**
  16727. *
  16728. * @codeGenApi
  16729. */
  16730. declare function ɵɵresolveBody(element: RElement & {
  16731. ownerDocument: Document;
  16732. }): HTMLElement;
  16733. /**
  16734. * Retrieves `TemplateRef` instance from `Injector` when a local reference is placed on the
  16735. * `<ng-template>` element.
  16736. *
  16737. * @codeGenApi
  16738. */
  16739. declare function ɵɵtemplateRefExtractor(tNode: TNode, lView: LView): TemplateRef<any> | null;
  16740. declare function ɵɵgetComponentDepsFactory(type: ComponentType<any>, rawImports?: RawScopeInfoFromDecorator[]): () => DependencyTypeList;
  16741. /**
  16742. * Sets the debug info for an Angular class.
  16743. *
  16744. * This runtime is guarded by ngDevMode flag.
  16745. */
  16746. declare function ɵsetClassDebugInfo(type: Type$1<any>, debugInfo: ClassDebugInfo): void;
  16747. /*!
  16748. * @license
  16749. * Copyright Google LLC All Rights Reserved.
  16750. *
  16751. * Use of this source code is governed by an MIT-style license that can be
  16752. * found in the LICENSE file at https://angular.dev/license
  16753. */
  16754. /** Represents `import.meta` plus some information that's not in the built-in types. */
  16755. type ImportMetaExtended = ImportMeta & {
  16756. hot?: {
  16757. send?: (name: string, payload: unknown) => void;
  16758. };
  16759. };
  16760. /**
  16761. * Replaces the metadata of a component type and re-renders all live instances of the component.
  16762. * @param type Class whose metadata will be replaced.
  16763. * @param applyMetadata Callback that will apply a new set of metadata on the `type` when invoked.
  16764. * @param environment Syntehtic namespace imports that need to be passed along to the callback.
  16765. * @param locals Local symbols from the source location that have to be exposed to the callback.
  16766. * @param importMeta `import.meta` from the call site of the replacement function. Optional since
  16767. * it isn't used internally.
  16768. * @param id ID to the class being replaced. **Not** the same as the component definition ID.
  16769. * Optional since the ID might not be available internally.
  16770. * @codeGenApi
  16771. */
  16772. declare function ɵɵreplaceMetadata(type: Type$1<unknown>, applyMetadata: (...args: [Type$1<unknown>, unknown[], ...unknown[]]) => void, namespaces: unknown[], locals: unknown[], importMeta?: ImportMetaExtended | null, id?: string | null): void;
  16773. /**
  16774. * Tell ivy what the `document` is for this platform.
  16775. *
  16776. * It is only necessary to call this if the current platform is not a browser.
  16777. *
  16778. * @param document The object representing the global `document` in this environment.
  16779. */
  16780. declare function setDocument(document: Document | undefined): void;
  16781. type Type = Function;
  16782. type OpaqueValue = unknown;
  16783. declare enum FactoryTarget {
  16784. Directive = 0,
  16785. Component = 1,
  16786. Injectable = 2,
  16787. Pipe = 3,
  16788. NgModule = 4
  16789. }
  16790. interface R3DeclareDependencyMetadataFacade {
  16791. token: OpaqueValue;
  16792. attribute?: boolean;
  16793. host?: boolean;
  16794. optional?: boolean;
  16795. self?: boolean;
  16796. skipSelf?: boolean;
  16797. }
  16798. interface R3HostDirectiveMetadataFacade {
  16799. directive: Type;
  16800. inputs?: string[];
  16801. outputs?: string[];
  16802. }
  16803. type LegacyInputPartialMapping = string | [bindingPropertyName: string, classPropertyName: string, transformFunction?: Function];
  16804. interface R3DeclareDirectiveFacade {
  16805. selector?: string;
  16806. type: Type;
  16807. version: string;
  16808. inputs?: {
  16809. [fieldName: string]: {
  16810. classPropertyName: string;
  16811. publicName: string;
  16812. isSignal: boolean;
  16813. isRequired: boolean;
  16814. transformFunction: Function | null;
  16815. } | LegacyInputPartialMapping;
  16816. };
  16817. outputs?: {
  16818. [classPropertyName: string]: string;
  16819. };
  16820. host?: {
  16821. attributes?: {
  16822. [key: string]: OpaqueValue;
  16823. };
  16824. listeners?: {
  16825. [key: string]: string;
  16826. };
  16827. properties?: {
  16828. [key: string]: string;
  16829. };
  16830. classAttribute?: string;
  16831. styleAttribute?: string;
  16832. };
  16833. queries?: R3DeclareQueryMetadataFacade[];
  16834. viewQueries?: R3DeclareQueryMetadataFacade[];
  16835. providers?: OpaqueValue;
  16836. exportAs?: string[];
  16837. usesInheritance?: boolean;
  16838. usesOnChanges?: boolean;
  16839. isStandalone?: boolean;
  16840. hostDirectives?: R3HostDirectiveMetadataFacade[] | null;
  16841. isSignal?: boolean;
  16842. }
  16843. interface R3DeclareComponentFacade extends R3DeclareDirectiveFacade {
  16844. template: string;
  16845. isInline?: boolean;
  16846. styles?: string[];
  16847. dependencies?: R3DeclareTemplateDependencyFacade[];
  16848. components?: R3DeclareDirectiveDependencyFacade[];
  16849. directives?: R3DeclareDirectiveDependencyFacade[];
  16850. pipes?: {
  16851. [pipeName: string]: OpaqueValue | (() => OpaqueValue);
  16852. };
  16853. deferBlockDependencies?: (() => Promise<Type> | null)[];
  16854. viewProviders?: OpaqueValue;
  16855. animations?: OpaqueValue;
  16856. changeDetection?: ChangeDetectionStrategy;
  16857. encapsulation?: ViewEncapsulation;
  16858. interpolation?: [string, string];
  16859. preserveWhitespaces?: boolean;
  16860. }
  16861. type R3DeclareTemplateDependencyFacade = {
  16862. kind: string;
  16863. } & (R3DeclareDirectiveDependencyFacade | R3DeclarePipeDependencyFacade | R3DeclareNgModuleDependencyFacade);
  16864. interface R3DeclareDirectiveDependencyFacade {
  16865. kind?: 'directive' | 'component';
  16866. selector: string;
  16867. type: OpaqueValue | (() => OpaqueValue);
  16868. inputs?: string[];
  16869. outputs?: string[];
  16870. exportAs?: string[];
  16871. }
  16872. interface R3DeclarePipeDependencyFacade {
  16873. kind?: 'pipe';
  16874. name: string;
  16875. type: OpaqueValue | (() => OpaqueValue);
  16876. }
  16877. interface R3DeclareNgModuleDependencyFacade {
  16878. kind: 'ngmodule';
  16879. type: OpaqueValue | (() => OpaqueValue);
  16880. }
  16881. interface R3DeclareFactoryFacade {
  16882. type: Type;
  16883. deps: R3DeclareDependencyMetadataFacade[] | 'invalid' | null;
  16884. target: FactoryTarget;
  16885. }
  16886. interface R3DeclareInjectableFacade {
  16887. type: Type;
  16888. providedIn?: Type | 'root' | 'platform' | 'any' | null;
  16889. useClass?: OpaqueValue;
  16890. useFactory?: OpaqueValue;
  16891. useExisting?: OpaqueValue;
  16892. useValue?: OpaqueValue;
  16893. deps?: R3DeclareDependencyMetadataFacade[];
  16894. }
  16895. declare enum ViewEncapsulation {
  16896. Emulated = 0,
  16897. None = 2,
  16898. ShadowDom = 3
  16899. }
  16900. type ChangeDetectionStrategy = number;
  16901. interface R3DeclareQueryMetadataFacade {
  16902. propertyName: string;
  16903. first?: boolean;
  16904. predicate: OpaqueValue | string[];
  16905. descendants?: boolean;
  16906. read?: OpaqueValue;
  16907. static?: boolean;
  16908. emitDistinctChangesOnly?: boolean;
  16909. isSignal?: boolean;
  16910. }
  16911. interface R3DeclareInjectorFacade {
  16912. type: Type;
  16913. imports?: OpaqueValue[];
  16914. providers?: OpaqueValue[];
  16915. }
  16916. interface R3DeclareNgModuleFacade {
  16917. type: Type;
  16918. bootstrap?: OpaqueValue[] | (() => OpaqueValue[]);
  16919. declarations?: OpaqueValue[] | (() => OpaqueValue[]);
  16920. imports?: OpaqueValue[] | (() => OpaqueValue[]);
  16921. exports?: OpaqueValue[] | (() => OpaqueValue[]);
  16922. schemas?: OpaqueValue[];
  16923. id?: OpaqueValue;
  16924. }
  16925. interface R3DeclarePipeFacade {
  16926. type: Type;
  16927. name: string;
  16928. version: string;
  16929. pure?: boolean;
  16930. isStandalone?: boolean;
  16931. }
  16932. /**
  16933. * Compile an Angular component according to its decorator metadata, and patch the resulting
  16934. * component def (ɵcmp) onto the component type.
  16935. *
  16936. * Compilation may be asynchronous (due to the need to resolve URLs for the component template or
  16937. * other resources, for example). In the event that compilation is not immediate, `compileComponent`
  16938. * will enqueue resource resolution into a global queue and will fail to return the `ɵcmp`
  16939. * until the global queue has been resolved with a call to `resolveComponentResources`.
  16940. */
  16941. declare function compileComponent(type: Type$1<any>, metadata: Component): void;
  16942. /**
  16943. * Compile an Angular directive according to its decorator metadata, and patch the resulting
  16944. * directive def onto the component type.
  16945. *
  16946. * In the event that compilation is not immediate, `compileDirective` will return a `Promise` which
  16947. * will resolve when compilation completes and the directive becomes usable.
  16948. */
  16949. declare function compileDirective(type: Type$1<any>, directive: Directive | null): void;
  16950. declare function resetJitOptions(): void;
  16951. /**
  16952. * Loops over queued module definitions, if a given module definition has all of its
  16953. * declarations resolved, it dequeues that module definition and sets the scope on
  16954. * its declarations.
  16955. */
  16956. declare function flushModuleScopingQueueAsMuchAsPossible(): void;
  16957. /**
  16958. * Compiles a module in JIT mode.
  16959. *
  16960. * This function automatically gets called when a class has a `@NgModule` decorator.
  16961. */
  16962. declare function compileNgModule(moduleType: Type$1<any>, ngModule?: NgModule): void;
  16963. /**
  16964. * Compiles and adds the `ɵmod`, `ɵfac` and `ɵinj` properties to the module class.
  16965. *
  16966. * It's possible to compile a module via this API which will allow duplicate declarations in its
  16967. * root.
  16968. */
  16969. declare function compileNgModuleDefs(moduleType: NgModuleType, ngModule: NgModule, allowDuplicateDeclarationsInRoot?: boolean): void;
  16970. declare function generateStandaloneInDeclarationsError(type: Type$1<any>, location: string): string;
  16971. declare function resetCompiledComponents(): void;
  16972. /**
  16973. * Patch the definition of a component with directives and pipes from the compilation scope of
  16974. * a given module.
  16975. */
  16976. declare function patchComponentDefWithScope<C>(componentDef: ComponentDef<C>, transitiveScopes: NgModuleTransitiveScopes): void;
  16977. /**
  16978. * Compute the pair of transitive scopes (compilation scope and exported scope) for a given type
  16979. * (either a NgModule or a standalone component / directive / pipe).
  16980. */
  16981. declare function transitiveScopesFor<T>(type: Type$1<T>): NgModuleTransitiveScopes;
  16982. /**
  16983. * Compiles a partial directive declaration object into a full directive definition object.
  16984. *
  16985. * @codeGenApi
  16986. */
  16987. declare function ɵɵngDeclareDirective(decl: R3DeclareDirectiveFacade): unknown;
  16988. /**
  16989. * Evaluates the class metadata declaration.
  16990. *
  16991. * @codeGenApi
  16992. */
  16993. declare function ɵɵngDeclareClassMetadata(decl: {
  16994. type: Type$1<any>;
  16995. decorators: any[];
  16996. ctorParameters?: () => any[];
  16997. propDecorators?: {
  16998. [field: string]: any;
  16999. };
  17000. }): void;
  17001. /**
  17002. * Evaluates the class metadata of a component that contains deferred blocks.
  17003. *
  17004. * @codeGenApi
  17005. */
  17006. declare function ɵɵngDeclareClassMetadataAsync(decl: {
  17007. type: Type$1<any>;
  17008. resolveDeferredDeps: () => Promise<Type$1<unknown>>[];
  17009. resolveMetadata: (...types: Type$1<unknown>[]) => {
  17010. decorators: any[];
  17011. ctorParameters: (() => any[]) | null;
  17012. propDecorators: {
  17013. [field: string]: any;
  17014. } | null;
  17015. };
  17016. }): void;
  17017. /**
  17018. * Compiles a partial component declaration object into a full component definition object.
  17019. *
  17020. * @codeGenApi
  17021. */
  17022. declare function ɵɵngDeclareComponent(decl: R3DeclareComponentFacade): unknown;
  17023. /**
  17024. * Compiles a partial pipe declaration object into a full pipe definition object.
  17025. *
  17026. * @codeGenApi
  17027. */
  17028. declare function ɵɵngDeclareFactory(decl: R3DeclareFactoryFacade): unknown;
  17029. /**
  17030. * Compiles a partial injectable declaration object into a full injectable definition object.
  17031. *
  17032. * @codeGenApi
  17033. */
  17034. declare function ɵɵngDeclareInjectable(decl: R3DeclareInjectableFacade): unknown;
  17035. /**
  17036. * Compiles a partial injector declaration object into a full injector definition object.
  17037. *
  17038. * @codeGenApi
  17039. */
  17040. declare function ɵɵngDeclareInjector(decl: R3DeclareInjectorFacade): unknown;
  17041. /**
  17042. * Compiles a partial NgModule declaration object into a full NgModule definition object.
  17043. *
  17044. * @codeGenApi
  17045. */
  17046. declare function ɵɵngDeclareNgModule(decl: R3DeclareNgModuleFacade): unknown;
  17047. /**
  17048. * Compiles a partial pipe declaration object into a full pipe definition object.
  17049. *
  17050. * @codeGenApi
  17051. */
  17052. declare function ɵɵngDeclarePipe(decl: R3DeclarePipeFacade): unknown;
  17053. declare function compilePipe(type: Type$1<any>, meta: Pipe): void;
  17054. declare function isNgModule<T>(value: Type$1<T>): value is Type$1<T> & {
  17055. ɵmod: NgModuleDef<T>;
  17056. };
  17057. /*!
  17058. * @license
  17059. * Copyright Google LLC All Rights Reserved.
  17060. *
  17061. * Use of this source code is governed by an MIT-style license that can be
  17062. * found in the LICENSE file at https://angular.dev/license
  17063. */
  17064. /**
  17065. * Profiler events is an enum used by the profiler to distinguish between different calls of user
  17066. * code invoked throughout the application lifecycle.
  17067. */
  17068. declare const enum ProfilerEvent {
  17069. /**
  17070. * Corresponds to the point in time before the runtime has called the template function of a
  17071. * component with `RenderFlags.Create`.
  17072. */
  17073. TemplateCreateStart = 0,
  17074. /**
  17075. * Corresponds to the point in time after the runtime has called the template function of a
  17076. * component with `RenderFlags.Create`.
  17077. */
  17078. TemplateCreateEnd = 1,
  17079. /**
  17080. * Corresponds to the point in time before the runtime has called the template function of a
  17081. * component with `RenderFlags.Update`.
  17082. */
  17083. TemplateUpdateStart = 2,
  17084. /**
  17085. * Corresponds to the point in time after the runtime has called the template function of a
  17086. * component with `RenderFlags.Update`.
  17087. */
  17088. TemplateUpdateEnd = 3,
  17089. /**
  17090. * Corresponds to the point in time before the runtime has called a lifecycle hook of a component
  17091. * or directive.
  17092. */
  17093. LifecycleHookStart = 4,
  17094. /**
  17095. * Corresponds to the point in time after the runtime has called a lifecycle hook of a component
  17096. * or directive.
  17097. */
  17098. LifecycleHookEnd = 5,
  17099. /**
  17100. * Corresponds to the point in time before the runtime has evaluated an expression associated with
  17101. * an event or an output.
  17102. */
  17103. OutputStart = 6,
  17104. /**
  17105. * Corresponds to the point in time after the runtime has evaluated an expression associated with
  17106. * an event or an output.
  17107. */
  17108. OutputEnd = 7,
  17109. /**
  17110. * Corresponds to the point in time just before application bootstrap.
  17111. */
  17112. BootstrapApplicationStart = 8,
  17113. /**
  17114. * Corresponds to the point in time after application bootstrap.
  17115. */
  17116. BootstrapApplicationEnd = 9,
  17117. /**
  17118. * Corresponds to the point in time just before root component bootstrap.
  17119. */
  17120. BootstrapComponentStart = 10,
  17121. /**
  17122. * Corresponds to the point in time after root component bootstrap.
  17123. */
  17124. BootstrapComponentEnd = 11,
  17125. /**
  17126. * Corresponds to the point in time just before Angular starts a change detection tick.
  17127. */
  17128. ChangeDetectionStart = 12,
  17129. /**
  17130. * Corresponds to the point in time after Angular ended a change detection tick.
  17131. */
  17132. ChangeDetectionEnd = 13,
  17133. /**
  17134. * Corresponds to the point in time just before Angular starts a new synchronization pass of change detection tick.
  17135. */
  17136. ChangeDetectionSyncStart = 14,
  17137. /**
  17138. * Corresponds to the point in time after Angular ended a synchronization pass.
  17139. */
  17140. ChangeDetectionSyncEnd = 15,
  17141. /**
  17142. * Corresponds to the point in time just before Angular executes after render hooks.
  17143. */
  17144. AfterRenderHooksStart = 16,
  17145. /**
  17146. * Corresponds to the point in time after Angular executed after render hooks.
  17147. */
  17148. AfterRenderHooksEnd = 17,
  17149. /**
  17150. * Corresponds to the point in time just before Angular starts processing a component (create or update).
  17151. */
  17152. ComponentStart = 18,
  17153. /**
  17154. * Corresponds to the point in time after Angular finished processing a component.
  17155. */
  17156. ComponentEnd = 19,
  17157. /**
  17158. * Corresponds to the point in time just before a defer block transitions between states.
  17159. */
  17160. DeferBlockStateStart = 20,
  17161. /**
  17162. * Corresponds to the point in time after a defer block transitioned between states.
  17163. */
  17164. DeferBlockStateEnd = 21,
  17165. /**
  17166. * Corresponds to the point in time just before a component instance is created dynamically.
  17167. */
  17168. DynamicComponentStart = 22,
  17169. /**
  17170. * Corresponds to the point in time after a a component instance is created dynamically.
  17171. */
  17172. DynamicComponentEnd = 23,
  17173. /**
  17174. * Corresponds to the point in time before the runtime has called the host bindings function
  17175. * of a directive.
  17176. */
  17177. HostBindingsUpdateStart = 24,
  17178. /**
  17179. * Corresponds to the point in time after the runtime has called the host bindings function
  17180. * of a directive.
  17181. */
  17182. HostBindingsUpdateEnd = 25
  17183. }
  17184. /**
  17185. * Profiler function which the runtime will invoke before and after user code.
  17186. */
  17187. interface Profiler {
  17188. (event: ProfilerEvent, instance?: {} | null, hookOrListener?: (e?: any) => any): void;
  17189. }
  17190. /**
  17191. * Marks a component for check (in case of OnPush components) and synchronously
  17192. * performs change detection on the application this component belongs to.
  17193. *
  17194. * @param component Component to {@link /api/core/ChangeDetectorRef#markForCheck mark for check}
  17195. *
  17196. * @publicApi
  17197. */
  17198. declare function applyChanges(component: {}): void;
  17199. /*!
  17200. * @license
  17201. * Copyright Google LLC All Rights Reserved.
  17202. *
  17203. * Use of this source code is governed by an MIT-style license that can be
  17204. * found in the LICENSE file at https://angular.dev/license
  17205. */
  17206. /** Retrieved information about a `@defer` block. */
  17207. interface DeferBlockData {
  17208. /** Current state of the block. */
  17209. state: 'placeholder' | 'loading' | 'complete' | 'error' | 'initial';
  17210. /** Hydration state of the block. */
  17211. incrementalHydrationState: 'not-configured' | 'hydrated' | 'dehydrated';
  17212. /** Wherther the block has a connected `@error` block. */
  17213. hasErrorBlock: boolean;
  17214. /** Information about the connected `@loading` block. */
  17215. loadingBlock: {
  17216. /** Whether the block is defined. */
  17217. exists: boolean;
  17218. /** Minimum amount of milliseconds that the block should be shown. */
  17219. minimumTime: number | null;
  17220. /** Amount of time after which the block should be shown. */
  17221. afterTime: number | null;
  17222. };
  17223. /** Information about the connected `@placeholder` block. */
  17224. placeholderBlock: {
  17225. /** Whether the block is defined. */
  17226. exists: boolean;
  17227. /** Minimum amount of time that block should be shown. */
  17228. minimumTime: number | null;
  17229. };
  17230. /** Stringified version of the block's triggers. */
  17231. triggers: string[];
  17232. /** Element root nodes that are currently being shown in the block. */
  17233. rootNodes: Node[];
  17234. }
  17235. /**
  17236. * Gets all of the `@defer` blocks that are present inside the specified DOM node.
  17237. * @param node Node in which to look for `@defer` blocks.
  17238. *
  17239. * @publicApi
  17240. */
  17241. declare function getDeferBlocks(node: Node): DeferBlockData[];
  17242. /**
  17243. * Discovers the dependencies of an injectable instance. Provides DI information about each
  17244. * dependency that the injectable was instantiated with, including where they were provided from.
  17245. *
  17246. * @param injector An injector instance
  17247. * @param token a DI token that was constructed by the given injector instance
  17248. * @returns an object that contains the created instance of token as well as all of the dependencies
  17249. * that it was instantiated with OR undefined if the token was not created within the given
  17250. * injector.
  17251. */
  17252. declare function getDependenciesFromInjectable<T>(injector: Injector, token: Type$1<T> | InjectionToken<T>): {
  17253. instance: T;
  17254. dependencies: Omit<InjectedService, 'injectedIn'>[];
  17255. } | undefined;
  17256. /**
  17257. * Gets the providers configured on an injector.
  17258. *
  17259. * @param injector the injector to lookup the providers of
  17260. * @returns ProviderRecord[] an array of objects representing the providers of the given injector
  17261. */
  17262. declare function getInjectorProviders(injector: Injector): ProviderRecord[];
  17263. /**
  17264. *
  17265. * Given an injector, this function will return
  17266. * an object containing the type and source of the injector.
  17267. *
  17268. * | | type | source |
  17269. * |--------------|-------------|-------------------------------------------------------------|
  17270. * | NodeInjector | element | DOM element that created this injector |
  17271. * | R3Injector | environment | `injector.source` |
  17272. * | NullInjector | null | null |
  17273. *
  17274. * @param injector the Injector to get metadata for
  17275. * @returns an object containing the type and source of the given injector. If the injector metadata
  17276. * cannot be determined, returns null.
  17277. */
  17278. declare function getInjectorMetadata(injector: Injector): {
  17279. type: 'element';
  17280. source: RElement;
  17281. } | {
  17282. type: 'environment';
  17283. source: string | null;
  17284. } | {
  17285. type: 'null';
  17286. source: null;
  17287. } | null;
  17288. declare function getInjectorResolutionPath(injector: Injector): Injector[];
  17289. interface DebugSignalGraphNode {
  17290. kind: string;
  17291. label?: string;
  17292. value?: unknown;
  17293. }
  17294. interface DebugSignalGraphEdge {
  17295. /**
  17296. * Index of a signal node in the `nodes` array that is a consumer of the signal produced by the producer node.
  17297. */
  17298. consumer: number;
  17299. /**
  17300. * Index of a signal node in the `nodes` array that is a producer of the signal consumed by the consumer node.
  17301. */
  17302. producer: number;
  17303. }
  17304. /**
  17305. * A debug representation of the signal graph.
  17306. */
  17307. interface DebugSignalGraph {
  17308. nodes: DebugSignalGraphNode[];
  17309. edges: DebugSignalGraphEdge[];
  17310. }
  17311. /**
  17312. * Returns a debug representation of the signal graph for the given injector.
  17313. *
  17314. * Currently only supports element injectors. Starts by discovering the consumer nodes
  17315. * and then traverses their producer nodes to build the signal graph.
  17316. *
  17317. * @param injector The injector to get the signal graph for.
  17318. * @returns A debug representation of the signal graph.
  17319. * @throws If the injector is an environment injector.
  17320. */
  17321. declare function getSignalGraph(injector: Injector): DebugSignalGraph;
  17322. /**
  17323. * This file introduces series of globally accessible debug tools
  17324. * to allow for the Angular debugging story to function.
  17325. *
  17326. * To see this in action run the following command:
  17327. *
  17328. * bazel run //packages/core/test/bundling/todo:devserver
  17329. *
  17330. * Then load `localhost:5432` and start using the console tools.
  17331. */
  17332. /**
  17333. * This value reflects the property on the window where the dev
  17334. * tools are patched (window.ng).
  17335. * */
  17336. declare const GLOBAL_PUBLISH_EXPANDO_KEY = "ng";
  17337. interface NgGlobalPublishUtils {
  17338. ɵgetLoadedRoutes(route: any): any;
  17339. }
  17340. declare const globalUtilsFunctions: {
  17341. /**
  17342. * Warning: functions that start with `ɵ` are considered *INTERNAL* and should not be relied upon
  17343. * in application's code. The contract of those functions might be changed in any release and/or a
  17344. * function can be removed completely.
  17345. */
  17346. ɵgetDependenciesFromInjectable: typeof getDependenciesFromInjectable;
  17347. ɵgetInjectorProviders: typeof getInjectorProviders;
  17348. ɵgetInjectorResolutionPath: typeof getInjectorResolutionPath;
  17349. ɵgetInjectorMetadata: typeof getInjectorMetadata;
  17350. ɵsetProfiler: (profiler: _angular_core.ɵProfiler | null) => void;
  17351. ɵgetSignalGraph: typeof getSignalGraph;
  17352. ɵgetDeferBlocks: typeof getDeferBlocks;
  17353. getDirectiveMetadata: typeof getDirectiveMetadata;
  17354. getComponent: typeof getComponent;
  17355. getContext: typeof getContext;
  17356. getListeners: typeof getListeners;
  17357. getOwningComponent: typeof getOwningComponent;
  17358. getHostElement: typeof getHostElement;
  17359. getInjector: typeof getInjector;
  17360. getRootComponents: typeof getRootComponents;
  17361. getDirectives: typeof getDirectives;
  17362. applyChanges: typeof applyChanges;
  17363. isSignal: typeof isSignal;
  17364. };
  17365. type ExternalGlobalUtilsFunctions = keyof NgGlobalPublishUtils;
  17366. /**
  17367. * Default debug tools available under `window.ng`.
  17368. */
  17369. type GlobalDevModeUtils = {
  17370. [GLOBAL_PUBLISH_EXPANDO_KEY]: typeof globalUtilsFunctions;
  17371. };
  17372. /**
  17373. * Publishes the given function to `window.ng` from package other than @angular/core
  17374. * So that it can be used from the browser console when an application is not in production.
  17375. */
  17376. declare function publishExternalGlobalUtil<K extends ExternalGlobalUtilsFunctions>(name: K, fn: NgGlobalPublishUtils[K]): void;
  17377. /**
  17378. * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing
  17379. * dangerous content.
  17380. *
  17381. * This method parses the `html` and locates potentially dangerous content (such as urls and
  17382. * javascript) and removes it.
  17383. *
  17384. * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.
  17385. *
  17386. * @param unsafeHtml untrusted `html`, typically from the user.
  17387. * @returns `html` string which is safe to display to user, because all of the dangerous javascript
  17388. * and urls have been removed.
  17389. *
  17390. * @codeGenApi
  17391. */
  17392. declare function ɵɵsanitizeHtml(unsafeHtml: any): TrustedHTML | string;
  17393. /**
  17394. * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing
  17395. * dangerous content.
  17396. *
  17397. * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.
  17398. *
  17399. * @param unsafeStyle untrusted `style`, typically from the user.
  17400. * @returns `style` string which is safe to bind to the `style` properties.
  17401. *
  17402. * @codeGenApi
  17403. */
  17404. declare function ɵɵsanitizeStyle(unsafeStyle: any): string;
  17405. /**
  17406. * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing
  17407. * dangerous
  17408. * content.
  17409. *
  17410. * This method parses the `url` and locates potentially dangerous content (such as javascript) and
  17411. * removes it.
  17412. *
  17413. * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.
  17414. *
  17415. * @param unsafeUrl untrusted `url`, typically from the user.
  17416. * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
  17417. * all of the dangerous javascript has been removed.
  17418. *
  17419. * @codeGenApi
  17420. */
  17421. declare function ɵɵsanitizeUrl(unsafeUrl: any): string;
  17422. /**
  17423. * A `url` sanitizer which only lets trusted `url`s through.
  17424. *
  17425. * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.
  17426. *
  17427. * @param unsafeResourceUrl untrusted `url`, typically from the user.
  17428. * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
  17429. * only trusted `url`s have been allowed to pass.
  17430. *
  17431. * @codeGenApi
  17432. */
  17433. declare function ɵɵsanitizeResourceUrl(unsafeResourceUrl: any): TrustedScriptURL | string;
  17434. /**
  17435. * A `script` sanitizer which only lets trusted javascript through.
  17436. *
  17437. * This passes only `script`s marked trusted by calling {@link
  17438. * bypassSanitizationTrustScript}.
  17439. *
  17440. * @param unsafeScript untrusted `script`, typically from the user.
  17441. * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,
  17442. * because only trusted `scripts` have been allowed to pass.
  17443. *
  17444. * @codeGenApi
  17445. */
  17446. declare function ɵɵsanitizeScript(unsafeScript: any): TrustedScript | string;
  17447. /**
  17448. * A template tag function for promoting the associated constant literal to a
  17449. * TrustedHTML. Interpolation is explicitly not allowed.
  17450. *
  17451. * @param html constant template literal containing trusted HTML.
  17452. * @returns TrustedHTML wrapping `html`.
  17453. *
  17454. * @security This is a security-sensitive function and should only be used to
  17455. * convert constant values of attributes and properties found in
  17456. * application-provided Angular templates to TrustedHTML.
  17457. *
  17458. * @codeGenApi
  17459. */
  17460. declare function ɵɵtrustConstantHtml(html: TemplateStringsArray): TrustedHTML | string;
  17461. /**
  17462. * A template tag function for promoting the associated constant literal to a
  17463. * TrustedScriptURL. Interpolation is explicitly not allowed.
  17464. *
  17465. * @param url constant template literal containing a trusted script URL.
  17466. * @returns TrustedScriptURL wrapping `url`.
  17467. *
  17468. * @security This is a security-sensitive function and should only be used to
  17469. * convert constant values of attributes and properties found in
  17470. * application-provided Angular templates to TrustedScriptURL.
  17471. *
  17472. * @codeGenApi
  17473. */
  17474. declare function ɵɵtrustConstantResourceUrl(url: TemplateStringsArray): TrustedScriptURL | string;
  17475. /**
  17476. * Sanitizes URL, selecting sanitizer function based on tag and property names.
  17477. *
  17478. * This function is used in case we can't define security context at compile time, when only prop
  17479. * name is available. This happens when we generate host bindings for Directives/Components. The
  17480. * host element is unknown at compile time, so we defer calculation of specific sanitizer to
  17481. * runtime.
  17482. *
  17483. * @param unsafeUrl untrusted `url`, typically from the user.
  17484. * @param tag target element tag name.
  17485. * @param prop name of the property that contains the value.
  17486. * @returns `url` string which is safe to bind.
  17487. *
  17488. * @codeGenApi
  17489. */
  17490. declare function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl: any, tag: string, prop: string): any;
  17491. /**
  17492. * Validation function invoked at runtime for each binding that might potentially
  17493. * represent a security-sensitive attribute of an <iframe>.
  17494. * See `IFRAME_SECURITY_SENSITIVE_ATTRS` in the
  17495. * `packages/compiler/src/schema/dom_security_schema.ts` script for the full list
  17496. * of such attributes.
  17497. *
  17498. * @codeGenApi
  17499. */
  17500. declare function ɵɵvalidateIframeAttribute(attrValue: any, tagName: string, attrName: string): any;
  17501. /**
  17502. * Represents the set of dependencies of a type in a certain context.
  17503. */
  17504. interface ScopeData {
  17505. pipes: Set<PipeType<any>>;
  17506. directives: Set<DirectiveType<any> | ComponentType<any> | Type$1<any>>;
  17507. /**
  17508. * If true it indicates that calculating this scope somehow was not successful. The consumers
  17509. * should interpret this as empty dependencies. The application of this flag is when calculating
  17510. * scope recursively, the presence of this flag in a scope dependency implies that the scope is
  17511. * also poisoned and thus we can return immediately without having to continue the recursion. The
  17512. * reason for this error is displayed as an error message in the console as per JIT behavior
  17513. * today. In addition to that, in local compilation the other build/compilations run in parallel
  17514. * with local compilation may or may not reveal some details about the error as well.
  17515. */
  17516. isPoisoned?: boolean;
  17517. }
  17518. /**
  17519. * Represents scope data for standalone components as calculated during runtime by the deps
  17520. * tracker.
  17521. */
  17522. interface StandaloneCompScopeData extends ScopeData {
  17523. ngModules: Set<NgModuleType<any>>;
  17524. }
  17525. /** Represents scope data for NgModule as calculated during runtime by the deps tracker. */
  17526. interface NgModuleScope {
  17527. compilation: ScopeData;
  17528. exported: ScopeData;
  17529. }
  17530. /**
  17531. * Represents scope data for standalone component as calculated during runtime by the deps tracker.
  17532. */
  17533. interface StandaloneComponentScope {
  17534. compilation: StandaloneCompScopeData;
  17535. }
  17536. /** Component dependencies info as calculated during runtime by the deps tracker. */
  17537. interface ComponentDependencies {
  17538. dependencies: DependencyTypeList;
  17539. }
  17540. /**
  17541. * Public API for runtime deps tracker (RDT).
  17542. *
  17543. * All downstream tools should only use these methods.
  17544. */
  17545. interface DepsTrackerApi {
  17546. /**
  17547. * Computes the component dependencies, i.e., a set of components/directive/pipes that could be
  17548. * present in the component's template (This set might contain directives/components/pipes not
  17549. * necessarily used in the component's template depending on the implementation).
  17550. *
  17551. * Standalone components should specify `rawImports` as this information is not available from
  17552. * their type. The consumer (e.g., {@link getStandaloneDefFunctions}) is expected to pass this
  17553. * parameter.
  17554. *
  17555. * The implementation is expected to use some caching mechanism in order to optimize the resources
  17556. * needed to do this computation.
  17557. */
  17558. getComponentDependencies(cmp: ComponentType<any>, rawImports?: (Type$1<any> | (() => Type$1<any>))[]): ComponentDependencies;
  17559. /**
  17560. * Registers an NgModule into the tracker with the given scope info.
  17561. *
  17562. * This method should be called for every NgModule whether it is compiled in local mode or not.
  17563. * This is needed in order to compute component's dependencies as some dependencies might be in
  17564. * different compilation units with different compilation mode.
  17565. */
  17566. registerNgModule(type: Type$1<any>, scopeInfo: NgModuleScopeInfoFromDecorator): void;
  17567. /**
  17568. * Clears the scope cache for NgModule or standalone component. This will force re-calculation of
  17569. * the scope, which could be an expensive operation as it involves aggregating transitive closure.
  17570. *
  17571. * The main application of this method is for test beds where we want to clear the cache to
  17572. * enforce scope update after overriding.
  17573. */
  17574. clearScopeCacheFor(type: Type$1<any>): void;
  17575. /**
  17576. * Returns the scope of NgModule. Mainly to be used by JIT and test bed.
  17577. *
  17578. * The scope value here is memoized. To enforce a new calculation bust the cache by using
  17579. * `clearScopeCacheFor` method.
  17580. */
  17581. getNgModuleScope(type: NgModuleType<any>): NgModuleScope;
  17582. /**
  17583. * Returns the scope of standalone component. Mainly to be used by JIT. This method should be
  17584. * called lazily after the initial parsing so that all the forward refs can be resolved.
  17585. *
  17586. * @param rawImports the imports statement as appears on the component decorate which consists of
  17587. * Type as well as forward refs.
  17588. *
  17589. * The scope value here is memoized. To enforce a new calculation bust the cache by using
  17590. * `clearScopeCacheFor` method.
  17591. */
  17592. getStandaloneComponentScope(type: ComponentType<any>, rawImports: (Type$1<any> | (() => Type$1<any>))[]): StandaloneComponentScope;
  17593. /**
  17594. * Checks if the NgModule declaring the component is not loaded into the browser yet. Always
  17595. * returns false for standalone components.
  17596. */
  17597. isOrphanComponent(cmp: ComponentType<any>): boolean;
  17598. }
  17599. /**
  17600. * Indicates whether to use the runtime dependency tracker for scope calculation in JIT compilation.
  17601. * The value "false" means the old code path based on patching scope info into the types will be
  17602. * used.
  17603. *
  17604. * @deprecated For migration purposes only, to be removed soon.
  17605. */
  17606. declare const USE_RUNTIME_DEPS_TRACKER_FOR_JIT = true;
  17607. /**
  17608. * An implementation of DepsTrackerApi which will be used for JIT and local compilation.
  17609. */
  17610. declare class DepsTracker implements DepsTrackerApi {
  17611. private ownerNgModule;
  17612. private ngModulesWithSomeUnresolvedDecls;
  17613. private ngModulesScopeCache;
  17614. private standaloneComponentsScopeCache;
  17615. /**
  17616. * Attempts to resolve ng module's forward ref declarations as much as possible and add them to
  17617. * the `ownerNgModule` map. This method normally should be called after the initial parsing when
  17618. * all the forward refs are resolved (e.g., when trying to render a component)
  17619. */
  17620. private resolveNgModulesDecls;
  17621. /** @override */
  17622. getComponentDependencies(type: ComponentType<any>, rawImports?: RawScopeInfoFromDecorator[]): ComponentDependencies;
  17623. /**
  17624. * @override
  17625. * This implementation does not make use of param scopeInfo since it assumes the scope info is
  17626. * already added to the type itself through methods like {@link ɵɵsetNgModuleScope}
  17627. */
  17628. registerNgModule(type: Type$1<any>, scopeInfo: NgModuleScopeInfoFromDecorator): void;
  17629. /** @override */
  17630. clearScopeCacheFor(type: Type$1<any>): void;
  17631. /** @override */
  17632. getNgModuleScope(type: NgModuleType<any>): NgModuleScope;
  17633. /** Compute NgModule scope afresh. */
  17634. private computeNgModuleScope;
  17635. /** @override */
  17636. getStandaloneComponentScope(type: ComponentType<any>, rawImports?: RawScopeInfoFromDecorator[]): StandaloneComponentScope;
  17637. private computeStandaloneComponentScope;
  17638. /** @override */
  17639. isOrphanComponent(cmp: Type$1<any>): boolean;
  17640. }
  17641. /** The deps tracker to be used in the current Angular app in dev mode. */
  17642. declare const depsTracker: DepsTracker;
  17643. /**
  17644. * Options passed to the `computed` creation function.
  17645. */
  17646. interface CreateComputedOptions<T> {
  17647. /**
  17648. * A comparison function which defines equality for computed values.
  17649. */
  17650. equal?: ValueEqualityFn<T>;
  17651. /**
  17652. * A debug name for the computed signal. Used in Angular DevTools to identify the signal.
  17653. */
  17654. debugName?: string;
  17655. }
  17656. /**
  17657. * Create a computed `Signal` which derives a reactive value from an expression.
  17658. */
  17659. declare function computed<T>(computation: () => T, options?: CreateComputedOptions<T>): Signal<T>;
  17660. /**
  17661. * Creates a writable signal whose value is initialized and reset by the linked, reactive computation.
  17662. *
  17663. * @developerPreview
  17664. */
  17665. declare function linkedSignal<D>(computation: () => D, options?: {
  17666. equal?: ValueEqualityFn<NoInfer<D>>;
  17667. }): WritableSignal<D>;
  17668. /**
  17669. * Creates a writable signal whose value is initialized and reset by the linked, reactive computation.
  17670. * This is an advanced API form where the computation has access to the previous value of the signal and the computation result.
  17671. *
  17672. * Note: The computation is reactive, meaning the linked signal will automatically update whenever any of the signals used within the computation change.
  17673. *
  17674. * @developerPreview
  17675. */
  17676. declare function linkedSignal<S, D>(options: {
  17677. source: () => S;
  17678. computation: (source: NoInfer<S>, previous?: {
  17679. source: NoInfer<S>;
  17680. value: NoInfer<D>;
  17681. }) => D;
  17682. equal?: ValueEqualityFn<NoInfer<D>>;
  17683. }): WritableSignal<D>;
  17684. /**
  17685. * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function
  17686. * can, optionally, return a value.
  17687. */
  17688. declare function untracked<T>(nonReactiveReadsFn: () => T): T;
  17689. declare class MicrotaskEffectScheduler extends ZoneAwareEffectScheduler {
  17690. private readonly pendingTasks;
  17691. private taskId;
  17692. schedule(effect: SchedulableEffect): void;
  17693. flush(): void;
  17694. /** @nocollapse */
  17695. static ɵprov: unknown;
  17696. }
  17697. /**
  17698. * Create a global `Effect` for the given reactive function.
  17699. */
  17700. declare function microtaskEffect(effectFn: (onCleanup: EffectCleanupRegisterFn) => void, options?: CreateEffectOptions): EffectRef;
  17701. /**
  17702. * An argument list containing the first non-never type in the given type array, or an empty
  17703. * argument list if there are no non-never types in the type array.
  17704. */
  17705. type ɵFirstAvailable<T extends unknown[]> = T extends [infer H, ...infer R] ? [H] extends [never] ? ɵFirstAvailable<R> : [H] : [];
  17706. /**
  17707. * Options passed to `afterRender` and `afterNextRender`.
  17708. *
  17709. * @developerPreview
  17710. */
  17711. interface AfterRenderOptions {
  17712. /**
  17713. * The `Injector` to use during creation.
  17714. *
  17715. * If this is not provided, the current injection context will be used instead (via `inject`).
  17716. */
  17717. injector?: Injector;
  17718. /**
  17719. * Whether the hook should require manual cleanup.
  17720. *
  17721. * If this is `false` (the default) the hook will automatically register itself to be cleaned up
  17722. * with the current `DestroyRef`.
  17723. */
  17724. manualCleanup?: boolean;
  17725. /**
  17726. * The phase the callback should be invoked in.
  17727. *
  17728. * <div class="docs-alert docs-alert-critical">
  17729. *
  17730. * Defaults to `AfterRenderPhase.MixedReadWrite`. You should choose a more specific
  17731. * phase instead. See `AfterRenderPhase` for more information.
  17732. *
  17733. * </div>
  17734. *
  17735. * @deprecated Specify the phase for your callback to run in by passing a spec-object as the first
  17736. * parameter to `afterRender` or `afterNextRender` instead of a function.
  17737. */
  17738. phase?: AfterRenderPhase;
  17739. }
  17740. /**
  17741. * Register callbacks to be invoked each time the application finishes rendering, during the
  17742. * specified phases. The available phases are:
  17743. * - `earlyRead`
  17744. * Use this phase to **read** from the DOM before a subsequent `write` callback, for example to
  17745. * perform custom layout that the browser doesn't natively support. Prefer the `read` phase if
  17746. * reading can wait until after the write phase. **Never** write to the DOM in this phase.
  17747. * - `write`
  17748. * Use this phase to **write** to the DOM. **Never** read from the DOM in this phase.
  17749. * - `mixedReadWrite`
  17750. * Use this phase to read from and write to the DOM simultaneously. **Never** use this phase if
  17751. * it is possible to divide the work among the other phases instead.
  17752. * - `read`
  17753. * Use this phase to **read** from the DOM. **Never** write to the DOM in this phase.
  17754. *
  17755. * <div class="docs-alert docs-alert-critical">
  17756. *
  17757. * You should prefer using the `read` and `write` phases over the `earlyRead` and `mixedReadWrite`
  17758. * phases when possible, to avoid performance degradation.
  17759. *
  17760. * </div>
  17761. *
  17762. * Note that:
  17763. * - Callbacks run in the following phase order *after each render*:
  17764. * 1. `earlyRead`
  17765. * 2. `write`
  17766. * 3. `mixedReadWrite`
  17767. * 4. `read`
  17768. * - Callbacks in the same phase run in the order they are registered.
  17769. * - Callbacks run on browser platforms only, they will not run on the server.
  17770. *
  17771. * The first phase callback to run as part of this spec will receive no parameters. Each
  17772. * subsequent phase callback in this spec will receive the return value of the previously run
  17773. * phase callback as a parameter. This can be used to coordinate work across multiple phases.
  17774. *
  17775. * Angular is unable to verify or enforce that phases are used correctly, and instead
  17776. * relies on each developer to follow the guidelines documented for each value and
  17777. * carefully choose the appropriate one, refactoring their code if necessary. By doing
  17778. * so, Angular is better able to minimize the performance degradation associated with
  17779. * manual DOM access, ensuring the best experience for the end users of your application
  17780. * or library.
  17781. *
  17782. * <div class="docs-alert docs-alert-important">
  17783. *
  17784. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  17785. * You must use caution when directly reading or writing the DOM and layout.
  17786. *
  17787. * </div>
  17788. *
  17789. * @param spec The callback functions to register
  17790. * @param options Options to control the behavior of the callback
  17791. *
  17792. * @usageNotes
  17793. *
  17794. * Use `afterRender` to read or write the DOM after each render.
  17795. *
  17796. * ### Example
  17797. * ```angular-ts
  17798. * @Component({
  17799. * selector: 'my-cmp',
  17800. * template: `<span #content>{{ ... }}</span>`,
  17801. * })
  17802. * export class MyComponent {
  17803. * @ViewChild('content') contentRef: ElementRef;
  17804. *
  17805. * constructor() {
  17806. * afterRender({
  17807. * read: () => {
  17808. * console.log('content height: ' + this.contentRef.nativeElement.scrollHeight);
  17809. * }
  17810. * });
  17811. * }
  17812. * }
  17813. * ```
  17814. *
  17815. * @developerPreview
  17816. */
  17817. declare function afterRender<E = never, W = never, M = never>(spec: {
  17818. earlyRead?: () => E;
  17819. write?: (...args: ɵFirstAvailable<[E]>) => W;
  17820. mixedReadWrite?: (...args: ɵFirstAvailable<[W, E]>) => M;
  17821. read?: (...args: ɵFirstAvailable<[M, W, E]>) => void;
  17822. }, options?: Omit<AfterRenderOptions, 'phase'>): AfterRenderRef;
  17823. /**
  17824. * Register a callback to be invoked each time the application finishes rendering, during the
  17825. * `mixedReadWrite` phase.
  17826. *
  17827. * <div class="docs-alert docs-alert-critical">
  17828. *
  17829. * You should prefer specifying an explicit phase for the callback instead, or you risk significant
  17830. * performance degradation.
  17831. *
  17832. * </div>
  17833. *
  17834. * Note that the callback will run
  17835. * - in the order it was registered
  17836. * - once per render
  17837. * - on browser platforms only
  17838. * - during the `mixedReadWrite` phase
  17839. *
  17840. * <div class="docs-alert docs-alert-important">
  17841. *
  17842. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  17843. * You must use caution when directly reading or writing the DOM and layout.
  17844. *
  17845. * </div>
  17846. *
  17847. * @param callback A callback function to register
  17848. * @param options Options to control the behavior of the callback
  17849. *
  17850. * @usageNotes
  17851. *
  17852. * Use `afterRender` to read or write the DOM after each render.
  17853. *
  17854. * ### Example
  17855. * ```angular-ts
  17856. * @Component({
  17857. * selector: 'my-cmp',
  17858. * template: `<span #content>{{ ... }}</span>`,
  17859. * })
  17860. * export class MyComponent {
  17861. * @ViewChild('content') contentRef: ElementRef;
  17862. *
  17863. * constructor() {
  17864. * afterRender({
  17865. * read: () => {
  17866. * console.log('content height: ' + this.contentRef.nativeElement.scrollHeight);
  17867. * }
  17868. * });
  17869. * }
  17870. * }
  17871. * ```
  17872. *
  17873. * @developerPreview
  17874. */
  17875. declare function afterRender(callback: VoidFunction, options?: AfterRenderOptions): AfterRenderRef;
  17876. /**
  17877. * Register callbacks to be invoked the next time the application finishes rendering, during the
  17878. * specified phases. The available phases are:
  17879. * - `earlyRead`
  17880. * Use this phase to **read** from the DOM before a subsequent `write` callback, for example to
  17881. * perform custom layout that the browser doesn't natively support. Prefer the `read` phase if
  17882. * reading can wait until after the write phase. **Never** write to the DOM in this phase.
  17883. * - `write`
  17884. * Use this phase to **write** to the DOM. **Never** read from the DOM in this phase.
  17885. * - `mixedReadWrite`
  17886. * Use this phase to read from and write to the DOM simultaneously. **Never** use this phase if
  17887. * it is possible to divide the work among the other phases instead.
  17888. * - `read`
  17889. * Use this phase to **read** from the DOM. **Never** write to the DOM in this phase.
  17890. *
  17891. * <div class="docs-alert docs-alert-critical">
  17892. *
  17893. * You should prefer using the `read` and `write` phases over the `earlyRead` and `mixedReadWrite`
  17894. * phases when possible, to avoid performance degradation.
  17895. *
  17896. * </div>
  17897. *
  17898. * Note that:
  17899. * - Callbacks run in the following phase order *once, after the next render*:
  17900. * 1. `earlyRead`
  17901. * 2. `write`
  17902. * 3. `mixedReadWrite`
  17903. * 4. `read`
  17904. * - Callbacks in the same phase run in the order they are registered.
  17905. * - Callbacks run on browser platforms only, they will not run on the server.
  17906. *
  17907. * The first phase callback to run as part of this spec will receive no parameters. Each
  17908. * subsequent phase callback in this spec will receive the return value of the previously run
  17909. * phase callback as a parameter. This can be used to coordinate work across multiple phases.
  17910. *
  17911. * Angular is unable to verify or enforce that phases are used correctly, and instead
  17912. * relies on each developer to follow the guidelines documented for each value and
  17913. * carefully choose the appropriate one, refactoring their code if necessary. By doing
  17914. * so, Angular is better able to minimize the performance degradation associated with
  17915. * manual DOM access, ensuring the best experience for the end users of your application
  17916. * or library.
  17917. *
  17918. * <div class="docs-alert docs-alert-important">
  17919. *
  17920. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  17921. * You must use caution when directly reading or writing the DOM and layout.
  17922. *
  17923. * </div>
  17924. *
  17925. * @param spec The callback functions to register
  17926. * @param options Options to control the behavior of the callback
  17927. *
  17928. * @usageNotes
  17929. *
  17930. * Use `afterNextRender` to read or write the DOM once,
  17931. * for example to initialize a non-Angular library.
  17932. *
  17933. * ### Example
  17934. * ```angular-ts
  17935. * @Component({
  17936. * selector: 'my-chart-cmp',
  17937. * template: `<div #chart>{{ ... }}</div>`,
  17938. * })
  17939. * export class MyChartCmp {
  17940. * @ViewChild('chart') chartRef: ElementRef;
  17941. * chart: MyChart|null;
  17942. *
  17943. * constructor() {
  17944. * afterNextRender({
  17945. * write: () => {
  17946. * this.chart = new MyChart(this.chartRef.nativeElement);
  17947. * }
  17948. * });
  17949. * }
  17950. * }
  17951. * ```
  17952. *
  17953. * @developerPreview
  17954. */
  17955. declare function afterNextRender<E = never, W = never, M = never>(spec: {
  17956. earlyRead?: () => E;
  17957. write?: (...args: ɵFirstAvailable<[E]>) => W;
  17958. mixedReadWrite?: (...args: ɵFirstAvailable<[W, E]>) => M;
  17959. read?: (...args: ɵFirstAvailable<[M, W, E]>) => void;
  17960. }, options?: Omit<AfterRenderOptions, 'phase'>): AfterRenderRef;
  17961. /**
  17962. * Register a callback to be invoked the next time the application finishes rendering, during the
  17963. * `mixedReadWrite` phase.
  17964. *
  17965. * <div class="docs-alert docs-alert-critical">
  17966. *
  17967. * You should prefer specifying an explicit phase for the callback instead, or you risk significant
  17968. * performance degradation.
  17969. *
  17970. * </div>
  17971. *
  17972. * Note that the callback will run
  17973. * - in the order it was registered
  17974. * - on browser platforms only
  17975. * - during the `mixedReadWrite` phase
  17976. *
  17977. * <div class="docs-alert docs-alert-important">
  17978. *
  17979. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  17980. * You must use caution when directly reading or writing the DOM and layout.
  17981. *
  17982. * </div>
  17983. *
  17984. * @param callback A callback function to register
  17985. * @param options Options to control the behavior of the callback
  17986. *
  17987. * @usageNotes
  17988. *
  17989. * Use `afterNextRender` to read or write the DOM once,
  17990. * for example to initialize a non-Angular library.
  17991. *
  17992. * ### Example
  17993. * ```angular-ts
  17994. * @Component({
  17995. * selector: 'my-chart-cmp',
  17996. * template: `<div #chart>{{ ... }}</div>`,
  17997. * })
  17998. * export class MyChartCmp {
  17999. * @ViewChild('chart') chartRef: ElementRef;
  18000. * chart: MyChart|null;
  18001. *
  18002. * constructor() {
  18003. * afterNextRender({
  18004. * write: () => {
  18005. * this.chart = new MyChart(this.chartRef.nativeElement);
  18006. * }
  18007. * });
  18008. * }
  18009. * }
  18010. * ```
  18011. *
  18012. * @developerPreview
  18013. */
  18014. declare function afterNextRender(callback: VoidFunction, options?: AfterRenderOptions): AfterRenderRef;
  18015. /**
  18016. * An argument list containing the first non-never type in the given type array, or an empty
  18017. * argument list if there are no non-never types in the type array.
  18018. */
  18019. type ɵFirstAvailableSignal<T extends unknown[]> = T extends [infer H, ...infer R] ? [H] extends [never] ? ɵFirstAvailableSignal<R> : [Signal<H>] : [];
  18020. /**
  18021. * Register an effect that, when triggered, is invoked when the application finishes rendering, during the
  18022. * `mixedReadWrite` phase.
  18023. *
  18024. * <div class="docs-alert docs-alert-critical">
  18025. *
  18026. * You should prefer specifying an explicit phase for the effect instead, or you risk significant
  18027. * performance degradation.
  18028. *
  18029. * </div>
  18030. *
  18031. * Note that callback-based `afterRenderEffect`s will run
  18032. * - in the order it they are registered
  18033. * - only when dirty
  18034. * - on browser platforms only
  18035. * - during the `mixedReadWrite` phase
  18036. *
  18037. * <div class="docs-alert docs-alert-important">
  18038. *
  18039. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  18040. * You must use caution when directly reading or writing the DOM and layout.
  18041. *
  18042. * </div>
  18043. *
  18044. * @param callback An effect callback function to register
  18045. * @param options Options to control the behavior of the callback
  18046. *
  18047. * @experimental
  18048. */
  18049. declare function afterRenderEffect(callback: (onCleanup: EffectCleanupRegisterFn) => void, options?: Omit<AfterRenderOptions, 'phase'>): AfterRenderRef;
  18050. /**
  18051. * Register effects that, when triggered, are invoked when the application finishes rendering,
  18052. * during the specified phases. The available phases are:
  18053. * - `earlyRead`
  18054. * Use this phase to **read** from the DOM before a subsequent `write` callback, for example to
  18055. * perform custom layout that the browser doesn't natively support. Prefer the `read` phase if
  18056. * reading can wait until after the write phase. **Never** write to the DOM in this phase.
  18057. * - `write`
  18058. * Use this phase to **write** to the DOM. **Never** read from the DOM in this phase.
  18059. * - `mixedReadWrite`
  18060. * Use this phase to read from and write to the DOM simultaneously. **Never** use this phase if
  18061. * it is possible to divide the work among the other phases instead.
  18062. * - `read`
  18063. * Use this phase to **read** from the DOM. **Never** write to the DOM in this phase.
  18064. *
  18065. * <div class="docs-alert docs-alert-critical">
  18066. *
  18067. * You should prefer using the `read` and `write` phases over the `earlyRead` and `mixedReadWrite`
  18068. * phases when possible, to avoid performance degradation.
  18069. *
  18070. * </div>
  18071. *
  18072. * Note that:
  18073. * - Effects run in the following phase order, only when dirty through signal dependencies:
  18074. * 1. `earlyRead`
  18075. * 2. `write`
  18076. * 3. `mixedReadWrite`
  18077. * 4. `read`
  18078. * - `afterRenderEffect`s in the same phase run in the order they are registered.
  18079. * - `afterRenderEffect`s run on browser platforms only, they will not run on the server.
  18080. * - `afterRenderEffect`s will run at least once.
  18081. *
  18082. * The first phase callback to run as part of this spec will receive no parameters. Each
  18083. * subsequent phase callback in this spec will receive the return value of the previously run
  18084. * phase callback as a `Signal`. This can be used to coordinate work across multiple phases.
  18085. *
  18086. * Angular is unable to verify or enforce that phases are used correctly, and instead
  18087. * relies on each developer to follow the guidelines documented for each value and
  18088. * carefully choose the appropriate one, refactoring their code if necessary. By doing
  18089. * so, Angular is better able to minimize the performance degradation associated with
  18090. * manual DOM access, ensuring the best experience for the end users of your application
  18091. * or library.
  18092. *
  18093. * <div class="docs-alert docs-alert-important">
  18094. *
  18095. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  18096. * You must use caution when directly reading or writing the DOM and layout.
  18097. *
  18098. * </div>
  18099. *
  18100. * @param spec The effect functions to register
  18101. * @param options Options to control the behavior of the effects
  18102. *
  18103. * @usageNotes
  18104. *
  18105. * Use `afterRenderEffect` to create effects that will read or write from the DOM and thus should
  18106. * run after rendering.
  18107. *
  18108. * @experimental
  18109. */
  18110. declare function afterRenderEffect<E = never, W = never, M = never>(spec: {
  18111. earlyRead?: (onCleanup: EffectCleanupRegisterFn) => E;
  18112. write?: (...args: [...ɵFirstAvailableSignal<[E]>, EffectCleanupRegisterFn]) => W;
  18113. mixedReadWrite?: (...args: [...ɵFirstAvailableSignal<[W, E]>, EffectCleanupRegisterFn]) => M;
  18114. read?: (...args: [...ɵFirstAvailableSignal<[M, W, E]>, EffectCleanupRegisterFn]) => void;
  18115. }, options?: Omit<AfterRenderOptions, 'phase'>): AfterRenderRef;
  18116. /**
  18117. * Asserts that the current stack frame is not within a reactive context. Useful
  18118. * to disallow certain code from running inside a reactive context (see {@link /api/core/rxjs/toSignal toSignal})
  18119. *
  18120. * @param debugFn a reference to the function making the assertion (used for the error message).
  18121. *
  18122. * @publicApi
  18123. */
  18124. declare function assertNotInReactiveContext(debugFn: Function, extraContext?: string): void;
  18125. /**
  18126. * Creates a `ComponentRef` instance based on provided component type and a set of options.
  18127. *
  18128. * @usageNotes
  18129. *
  18130. * The example below demonstrates how the `createComponent` function can be used
  18131. * to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,
  18132. * so that it gets included into change detection cycles.
  18133. *
  18134. * Note: the example uses standalone components, but the function can also be used for
  18135. * non-standalone components (declared in an NgModule) as well.
  18136. *
  18137. * ```angular-ts
  18138. * @Component({
  18139. * standalone: true,
  18140. * template: `Hello {{ name }}!`
  18141. * })
  18142. * class HelloComponent {
  18143. * name = 'Angular';
  18144. * }
  18145. *
  18146. * @Component({
  18147. * standalone: true,
  18148. * template: `<div id="hello-component-host"></div>`
  18149. * })
  18150. * class RootComponent {}
  18151. *
  18152. * // Bootstrap an application.
  18153. * const applicationRef = await bootstrapApplication(RootComponent);
  18154. *
  18155. * // Locate a DOM node that would be used as a host.
  18156. * const hostElement = document.getElementById('hello-component-host');
  18157. *
  18158. * // Get an `EnvironmentInjector` instance from the `ApplicationRef`.
  18159. * const environmentInjector = applicationRef.injector;
  18160. *
  18161. * // We can now create a `ComponentRef` instance.
  18162. * const componentRef = createComponent(HelloComponent, {hostElement, environmentInjector});
  18163. *
  18164. * // Last step is to register the newly created ref using the `ApplicationRef` instance
  18165. * // to include the component view into change detection cycles.
  18166. * applicationRef.attachView(componentRef.hostView);
  18167. * componentRef.changeDetectorRef.detectChanges();
  18168. * ```
  18169. *
  18170. * @param component Component class reference.
  18171. * @param options Set of options to use:
  18172. * * `environmentInjector`: An `EnvironmentInjector` instance to be used for the component.
  18173. * * `hostElement` (optional): A DOM node that should act as a host node for the component. If not
  18174. * provided, Angular creates one based on the tag name used in the component selector (and falls
  18175. * back to using `div` if selector doesn't have tag name info).
  18176. * * `elementInjector` (optional): An `ElementInjector` instance, see additional info about it
  18177. * [here](guide/di/hierarchical-dependency-injection#elementinjector).
  18178. * * `projectableNodes` (optional): A list of DOM nodes that should be projected through
  18179. * [`<ng-content>`](api/core/ng-content) of the new component instance, e.g.,
  18180. * `[[element1, element2]]`: projects `element1` and `element2` into the same `<ng-content>`.
  18181. * `[[element1, element2], [element3]]`: projects `element1` and `element2` into one `<ng-content>`,
  18182. * and `element3` into a separate `<ng-content>`.
  18183. * @returns ComponentRef instance that represents a given Component.
  18184. *
  18185. * @publicApi
  18186. */
  18187. declare function createComponent<C>(component: Type$1<C>, options: {
  18188. environmentInjector: EnvironmentInjector;
  18189. hostElement?: Element;
  18190. elementInjector?: Injector;
  18191. projectableNodes?: Node[][];
  18192. }): ComponentRef$1<C>;
  18193. /**
  18194. * An interface that describes the subset of component metadata
  18195. * that can be retrieved using the `reflectComponentType` function.
  18196. *
  18197. * @publicApi
  18198. */
  18199. interface ComponentMirror<C> {
  18200. /**
  18201. * The component's HTML selector.
  18202. */
  18203. get selector(): string;
  18204. /**
  18205. * The type of component the factory will create.
  18206. */
  18207. get type(): Type$1<C>;
  18208. /**
  18209. * The inputs of the component.
  18210. */
  18211. get inputs(): ReadonlyArray<{
  18212. readonly propName: string;
  18213. readonly templateName: string;
  18214. readonly transform?: (value: any) => any;
  18215. readonly isSignal: boolean;
  18216. }>;
  18217. /**
  18218. * The outputs of the component.
  18219. */
  18220. get outputs(): ReadonlyArray<{
  18221. readonly propName: string;
  18222. readonly templateName: string;
  18223. }>;
  18224. /**
  18225. * Selector for all <ng-content> elements in the component.
  18226. */
  18227. get ngContentSelectors(): ReadonlyArray<string>;
  18228. /**
  18229. * Whether this component is marked as standalone.
  18230. * Note: an extra flag, not present in `ComponentFactory`.
  18231. */
  18232. get isStandalone(): boolean;
  18233. }
  18234. /**
  18235. * Creates an object that allows to retrieve component metadata.
  18236. *
  18237. * @usageNotes
  18238. *
  18239. * The example below demonstrates how to use the function and how the fields
  18240. * of the returned object map to the component metadata.
  18241. *
  18242. * ```angular-ts
  18243. * @Component({
  18244. * standalone: true,
  18245. * selector: 'foo-component',
  18246. * template: `
  18247. * <ng-content></ng-content>
  18248. * <ng-content select="content-selector-a"></ng-content>
  18249. * `,
  18250. * })
  18251. * class FooComponent {
  18252. * @Input('inputName') inputPropName: string;
  18253. * @Output('outputName') outputPropName = new EventEmitter<void>();
  18254. * }
  18255. *
  18256. * const mirror = reflectComponentType(FooComponent);
  18257. * expect(mirror.type).toBe(FooComponent);
  18258. * expect(mirror.selector).toBe('foo-component');
  18259. * expect(mirror.isStandalone).toBe(true);
  18260. * expect(mirror.inputs).toEqual([{propName: 'inputName', templateName: 'inputPropName'}]);
  18261. * expect(mirror.outputs).toEqual([{propName: 'outputName', templateName: 'outputPropName'}]);
  18262. * expect(mirror.ngContentSelectors).toEqual([
  18263. * '*', // first `<ng-content>` in a template, the selector defaults to `*`
  18264. * 'content-selector-a' // second `<ng-content>` in a template
  18265. * ]);
  18266. * ```
  18267. *
  18268. * @param component Component class reference.
  18269. * @returns An object that allows to retrieve component metadata.
  18270. *
  18271. * @publicApi
  18272. */
  18273. declare function reflectComponentType<C>(component: Type$1<C>): ComponentMirror<C> | null;
  18274. /**
  18275. * Checks whether a given Component, Directive or Pipe is marked as standalone.
  18276. * This will return false if passed anything other than a Component, Directive, or Pipe class
  18277. * See [this guide](guide/components/importing) for additional information:
  18278. *
  18279. * @param type A reference to a Component, Directive or Pipe.
  18280. * @publicApi
  18281. */
  18282. declare function isStandalone(type: Type$1<unknown>): boolean;
  18283. /**
  18284. * Set of config options available during the application bootstrap operation.
  18285. *
  18286. * @publicApi
  18287. */
  18288. interface ApplicationConfig {
  18289. /**
  18290. * List of providers that should be available to the root component and all its children.
  18291. */
  18292. providers: Array<Provider | EnvironmentProviders>;
  18293. }
  18294. /**
  18295. * Merge multiple application configurations from left to right.
  18296. *
  18297. * @param configs Two or more configurations to be merged.
  18298. * @returns A merged [ApplicationConfig](api/core/ApplicationConfig).
  18299. *
  18300. * @publicApi
  18301. */
  18302. declare function mergeApplicationConfig(...configs: ApplicationConfig[]): ApplicationConfig;
  18303. /**
  18304. * Injection token representing the current HTTP request object.
  18305. *
  18306. * Use this token to access the current request when handling server-side
  18307. * rendering (SSR).
  18308. *
  18309. * @remarks
  18310. * This token may be `null` in the following scenarios:
  18311. *
  18312. * * During the build processes.
  18313. * * When the application is rendered in the browser (client-side rendering).
  18314. * * When performing static site generation (SSG).
  18315. * * During route extraction in development (at the time of the request).
  18316. *
  18317. * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request | `Request` on MDN}
  18318. *
  18319. * @developerPreview
  18320. */
  18321. declare const REQUEST: InjectionToken<Request | null>;
  18322. /**
  18323. * Injection token for response initialization options.
  18324. *
  18325. * Use this token to provide response options for configuring or initializing
  18326. * HTTP responses in server-side rendering or API endpoints.
  18327. *
  18328. * @remarks
  18329. * This token may be `null` in the following scenarios:
  18330. *
  18331. * * During the build processes.
  18332. * * When the application is rendered in the browser (client-side rendering).
  18333. * * When performing static site generation (SSG).
  18334. * * During route extraction in development (at the time of the request).
  18335. *
  18336. * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response | `ResponseInit` on MDN}
  18337. *
  18338. * @developerPreview
  18339. */
  18340. declare const RESPONSE_INIT: InjectionToken<ResponseInit | null>;
  18341. /**
  18342. * Injection token for additional request context.
  18343. *
  18344. * Use this token to pass custom metadata or context related to the current request in server-side rendering.
  18345. *
  18346. * @remarks
  18347. * This token is only available during server-side rendering and will be `null` in other contexts.
  18348. *
  18349. * @developerPreview
  18350. */
  18351. declare const REQUEST_CONTEXT: InjectionToken<unknown>;
  18352. export { ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, type AbstractType, type AfterContentChecked, type AfterContentInit, type AfterRenderOptions, AfterRenderPhase, type AfterRenderRef, type AfterViewChecked, type AfterViewInit, type ApplicationConfig, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, type AttributeDecorator, type BaseResourceOptions, type BootstrapOptions, COMPILER_OPTIONS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy$1 as ChangeDetectionStrategy, ChangeDetectorRef, type ClassProvider, type ClassSansProvider, Compiler, CompilerFactory, type CompilerOptions, Component, type ComponentDecorator, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, type ComponentMirror, ComponentRef$1 as ComponentRef, type ConstructorProvider, type ConstructorSansProvider, ContentChild, type ContentChildDecorator, type ContentChildFunction, ContentChildren, type ContentChildrenDecorator, type CreateComputedOptions, type CreateEffectOptions, type CreateSignalOptions, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, DestroyRef, Directive, type DirectiveDecorator, type DoBootstrap, type DoCheck, ENVIRONMENT_INITIALIZER, type EffectCleanupFn, type EffectCleanupRegisterFn, type EffectRef, ElementRef, EmbeddedViewRef, EnvironmentInjector, type EnvironmentProviders, ErrorHandler, EventEmitter, type ExistingProvider, type ExistingSansProvider, type FactoryProvider, type FactorySansProvider, type ForwardRefFn, type GetTestability, HOST_TAG_NAME, Host, HostAttributeToken, HostBinding, type HostBindingDecorator, type HostDecorator, HostListener, type HostListenerDecorator, INJECTOR, type ImportProvidersSource, type ImportedNgModuleProviders, Inject, type InjectDecorator, InjectFlags, type InjectOptions, Injectable, type InjectableDecorator, type InjectableProvider, type InjectableType, InjectionToken, Injector, type InjectorType, Input, type InputDecorator, type InputFunction, type InputOptions, type InputOptionsWithTransform, type InputOptionsWithoutTransform, type InputSignal, type InputSignalWithTransform, type IterableChangeRecord, type IterableChanges, type IterableDiffer, type IterableDifferFactory, IterableDiffers, type KeyValueChangeRecord, type KeyValueChanges, type KeyValueDiffer, type KeyValueDifferFactory, KeyValueDiffers, LOCALE_ID, type ListenerOptions, MissingTranslationStrategy, type ModelFunction, type ModelOptions, type ModelSignal, ModuleWithComponentFactories, type ModuleWithProviders, NO_ERRORS_SCHEMA, type NgIterable, NgModule, type NgModuleDecorator, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, type NgZoneOptions, type OnChanges, type OnDestroy, type OnInit, Optional, type OptionalDecorator, Output, type OutputDecorator, OutputEmitterRef, type OutputOptions, type OutputRef, type OutputRefSubscription, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, PendingTasks, Pipe, type PipeDecorator, type PipeTransform, PlatformRef, type Predicate, type PromiseResourceOptions, type Provider, type ProviderToken, Query, QueryList, REQUEST, REQUEST_CONTEXT, RESPONSE_INIT, Renderer2, RendererFactory2, RendererStyleFlags2, type RendererType2, type Resource, type ResourceLoader, type ResourceLoaderParams, type ResourceOptions, type ResourceRef, ResourceStatus, type ResourceStreamItem, type ResourceStreamingLoader, Sanitizer, type SchemaMetadata, SecurityContext, Self, type SelfDecorator, type Signal, SimpleChange, type SimpleChanges, SkipSelf, type SkipSelfDecorator, type StateKey, type StaticClassProvider, type StaticClassSansProvider, type StaticProvider, type StreamingResourceOptions, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, type TrackByFunction, TransferState, Type$1 as Type, type TypeDecorator, type TypeProvider, VERSION, type ValueEqualityFn, type ValueProvider, type ValueSansProvider, Version, ViewChild, type ViewChildDecorator, type ViewChildFunction, ViewChildren, type ViewChildrenDecorator, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef$1 as ViewRef, type WritableResource, type WritableSignal, afterNextRender, afterRender, afterRenderEffect, asNativeElements, assertInInjectionContext, assertNotInReactiveContext, assertPlatform, booleanAttribute, computed, contentChild, contentChildren, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, input, isDevMode, isSignal, isStandalone, linkedSignal, makeEnvironmentProviders, makeStateKey, mergeApplicationConfig, model, numberAttribute, output, platformCore, provideAppInitializer, provideEnvironmentInitializer, provideExperimentalCheckNoChangesForDebug, provideExperimentalZonelessChangeDetection, providePlatformInitializer, provideZoneChangeDetection, reflectComponentType, resolveForwardRef, resource, runInInjectionContext, setTestabilityGetter, signal, untracked, viewChild, viewChildren, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, AfterRenderManager as ɵAfterRenderManager, AnimationRendererType as ɵAnimationRendererType, AttributeMarker as ɵAttributeMarker, BypassType as ɵBypassType, CONTAINER_HEADER_OFFSET as ɵCONTAINER_HEADER_OFFSET, ChangeDetectionScheduler as ɵChangeDetectionScheduler, ChangeDetectionSchedulerImpl as ɵChangeDetectionSchedulerImpl, type ComponentDebugMetadata as ɵComponentDebugMetadata, type ComponentDef as ɵComponentDef, ComponentFactory$1 as ɵComponentFactory, type ComponentType as ɵComponentType, Console as ɵConsole, type CssSelectorList as ɵCssSelectorList, CurrencyIndex as ɵCurrencyIndex, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG as ɵDEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR as ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DeferBlockBehavior as ɵDeferBlockBehavior, type DeferBlockConfig as ɵDeferBlockConfig, type DeferBlockDependencyInterceptor as ɵDeferBlockDependencyInterceptor, type DeferBlockDetails as ɵDeferBlockDetails, DeferBlockState as ɵDeferBlockState, type DirectiveDef as ɵDirectiveDef, type DirectiveType as ɵDirectiveType, ENABLE_ROOT_COMPONENT_BOOTSTRAP as ɵENABLE_ROOT_COMPONENT_BOOTSTRAP, EffectScheduler as ɵEffectScheduler, ExtraLocaleDataIndex as ɵExtraLocaleDataIndex, type ɵFirstAvailable, type ɵFirstAvailableSignal, type GlobalDevModeUtils as ɵGlobalDevModeUtils, type HydratedNode as ɵHydratedNode, type HydrationInfo as ɵHydrationInfo, IMAGE_CONFIG as ɵIMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS as ɵIMAGE_CONFIG_DEFAULTS, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, ɵINPUT_SIGNAL_BRAND_WRITE_TYPE, INTERNAL_APPLICATION_ERROR_HANDLER as ɵINTERNAL_APPLICATION_ERROR_HANDLER, IS_HYDRATION_DOM_REUSE_ENABLED as ɵIS_HYDRATION_DOM_REUSE_ENABLED, IS_INCREMENTAL_HYDRATION_ENABLED as ɵIS_INCREMENTAL_HYDRATION_ENABLED, type ImageConfig as ɵImageConfig, type InjectorProfilerContext as ɵInjectorProfilerContext, type InputSignalNode as ɵInputSignalNode, type InternalEnvironmentProviders as ɵInternalEnvironmentProviders, JSACTION_EVENT_CONTRACT as ɵJSACTION_EVENT_CONTRACT, LContext as ɵLContext, LocaleDataIndex as ɵLocaleDataIndex, MicrotaskEffectScheduler as ɵMicrotaskEffectScheduler, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, type NgModuleDef as ɵNgModuleDef, NgModuleFactory as ɵNgModuleFactory, type NgModuleTransitiveScopes as ɵNgModuleTransitiveScopes, type NgModuleType as ɵNgModuleType, NoopNgZone as ɵNoopNgZone, NotificationSource as ɵNotificationSource, PERFORMANCE_MARK_PREFIX as ɵPERFORMANCE_MARK_PREFIX, PROVIDED_NG_ZONE as ɵPROVIDED_NG_ZONE, PendingTasksInternal as ɵPendingTasksInternal, type PipeDef as ɵPipeDef, type Profiler as ɵProfiler, ProfilerEvent as ɵProfilerEvent, type ProviderRecord as ɵProviderRecord, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RenderFlags as ɵRenderFlags, ResourceImpl as ɵResourceImpl, RuntimeError as ɵRuntimeError, RuntimeErrorCode as ɵRuntimeErrorCode, SIGNAL as ɵSIGNAL, SSR_CONTENT_INTEGRITY_MARKER as ɵSSR_CONTENT_INTEGRITY_MARKER, type SafeHtml as ɵSafeHtml, type SafeResourceUrl as ɵSafeResourceUrl, type SafeScript as ɵSafeScript, type SafeStyle as ɵSafeStyle, type SafeUrl as ɵSafeUrl, type SafeValue as ɵSafeValue, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, TracingAction as ɵTracingAction, TracingService as ɵTracingService, type TracingSnapshot as ɵTracingSnapshot, USE_RUNTIME_DEPS_TRACKER_FOR_JIT as ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, type ɵUnwrapDirectiveSignalInputs, ViewRef as ɵViewRef, type Writable as ɵWritable, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, ZONELESS_ENABLED as ɵZONELESS_ENABLED, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, annotateForHydration as ɵannotateForHydration, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, depsTracker as ɵdepsTracker, detectChangesInViewIfRequired as ɵdetectChangesInViewIfRequired, devModeEqual as ɵdevModeEqual, disableProfiling as ɵdisableProfiling, enableProfiling as ɵenableProfiling, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, generateStandaloneInDeclarationsError as ɵgenerateStandaloneInDeclarationsError, getAsyncClassMetadataFn as ɵgetAsyncClassMetadataFn, getClosestComponentName as ɵgetClosestComponentName, getDebugNode as ɵgetDebugNode, getDeferBlocks$1 as ɵgetDeferBlocks, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getOutputDestroyRef as ɵgetOutputDestroyRef, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalCreateApplication as ɵinternalCreateApplication, internalProvideZoneChangeDetection as ɵinternalProvideZoneChangeDetection, isBoundToModule as ɵisBoundToModule, isComponentDefPendingResolution as ɵisComponentDefPendingResolution, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, isViewDirty as ɵisViewDirty, markForRefresh as ɵmarkForRefresh, microtaskEffect as ɵmicrotaskEffect, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, performanceMarkFeature as ɵperformanceMarkFeature, publishExternalGlobalUtil as ɵpublishExternalGlobalUtil, readHydrationInfo as ɵreadHydrationInfo, registerLocaleData as ɵregisterLocaleData, renderDeferBlockState as ɵrenderDeferBlockState, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, restoreComponentResolutionQueue as ɵrestoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, ɵsetClassDebugInfo, setClassMetadata as ɵsetClassMetadata, setClassMetadataAsync as ɵsetClassMetadataAsync, setDocument as ɵsetDocument, setInjectorProfilerContext as ɵsetInjectorProfilerContext, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, startMeasuring as ɵstartMeasuring, stopMeasuring as ɵstopMeasuring, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, triggerResourceLoading as ɵtriggerResourceLoading, truncateMiddle as ɵtruncateMiddle, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, ɵunwrapWritableSignal, withDomHydration as ɵwithDomHydration, withEventReplay as ɵwithEventReplay, withI18nSupport as ɵwithI18nSupport, withIncrementalHydration as ɵwithIncrementalHydration, type ɵɵComponentDeclaration, ɵɵCopyDefinitionFeature, type ɵɵDirectiveDeclaration, ɵɵExternalStylesFeature, type ɵɵFactoryDeclaration, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, type ɵɵInjectableDeclaration, type ɵɵInjectorDeclaration, type ɵɵInjectorDef, type ɵɵNgModuleDeclaration, ɵɵNgOnChangesFeature, type ɵɵPipeDeclaration, ɵɵProvidersFeature, ɵɵadvance, ɵɵattachSourceLocations, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵcontentQuery, ɵɵcontentQuerySignal, ɵɵdeclareLet, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferHydrateNever, ɵɵdeferHydrateOnHover, ɵɵdeferHydrateOnIdle, ɵɵdeferHydrateOnImmediate, ɵɵdeferHydrateOnInteraction, ɵɵdeferHydrateOnTimer, ɵɵdeferHydrateOnViewport, ɵɵdeferHydrateWhen, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareClassMetadataAsync, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryAdvance, ɵɵqueryRefresh, ɵɵreadContextLet, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵreplaceMetadata, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstoreLet, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵtwoWayBindingSet, ɵɵtwoWayListener, ɵɵtwoWayProperty, ɵɵvalidateIframeAttribute, ɵɵviewQuery, ɵɵviewQuerySignal };