index.d.ts 689 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722
  1. /**
  2. * @license Angular v19.2.13
  3. * (c) 2010-2025 Google LLC. https://angular.io/
  4. * License: MIT
  5. */
  6. import { SIGNAL, SignalNode, ReactiveNode, ValueEqualityFn as ValueEqualityFn$1 } from './weak_ref.d-DWHPG08n.js';
  7. export { setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl } from './weak_ref.d-DWHPG08n.js';
  8. import { EventContract } from './event_dispatcher.d-K56StcHr.js';
  9. import { Observable, Subject, Subscription, BehaviorSubject, Subscribable } from 'rxjs';
  10. import { Injector as Injector$1, InjectionToken as InjectionToken$1, NotFound } from '@angular/core/primitives/di';
  11. import * as _angular_core from '@angular/core';
  12. export { NavigateEvent as ɵNavigateEvent, Navigation as ɵNavigation, NavigationCurrentEntryChangeEvent as ɵNavigationCurrentEntryChangeEvent, NavigationDestination as ɵNavigationDestination, NavigationHistoryEntry as ɵNavigationHistoryEntry, NavigationInterceptOptions as ɵNavigationInterceptOptions, NavigationNavigateOptions as ɵNavigationNavigateOptions, NavigationOptions as ɵNavigationOptions, NavigationReloadOptions as ɵNavigationReloadOptions, NavigationResult as ɵNavigationResult, NavigationTransition as ɵNavigationTransition, NavigationTypeString as ɵNavigationTypeString, NavigationUpdateCurrentEntryOptions as ɵNavigationUpdateCurrentEntryOptions } from './navigation_types.d-fAxd92YV.js';
  13. export { setCurrentInjector as ɵsetCurrentInjector } from './primitives/di/index.js';
  14. /**
  15. * A reactive value which notifies consumers of any changes.
  16. *
  17. * Signals are functions which returns their current value. To access the current value of a signal,
  18. * call it.
  19. *
  20. * Ordinary values can be turned into `Signal`s with the `signal` function.
  21. */
  22. type Signal<T> = (() => T) & {
  23. [SIGNAL]: unknown;
  24. };
  25. /**
  26. * Checks if the given `value` is a reactive `Signal`.
  27. */
  28. declare function isSignal(value: unknown): value is Signal<unknown>;
  29. /**
  30. * A comparison function which can determine if two values are equal.
  31. */
  32. type ValueEqualityFn<T> = (a: T, b: T) => boolean;
  33. /**
  34. * Reactive node type for an input signal. An input signal extends a signal.
  35. * There are special properties to enable transforms and required inputs.
  36. */
  37. interface InputSignalNode<T, TransformT> extends SignalNode<T> {
  38. /**
  39. * User-configured transform that will run whenever a new value is applied
  40. * to the input signal node.
  41. */
  42. transformFn: ((value: TransformT) => T) | undefined;
  43. /**
  44. * Applies a new value to the input signal. Expects transforms to be run
  45. * manually before.
  46. *
  47. * This function is called by the framework runtime code whenever a binding
  48. * changes. The value can in practice be anything at runtime, but for typing
  49. * purposes we assume it's a valid `T` value. Type-checking will enforce that.
  50. */
  51. applyValueToInputSignal<T, TransformT>(node: InputSignalNode<T, TransformT>, value: T): void;
  52. /**
  53. * A debug name for the input signal. Used in Angular DevTools to identify the signal.
  54. */
  55. debugName?: string;
  56. }
  57. /**
  58. * @publicAPI
  59. *
  60. * Options for signal inputs.
  61. */
  62. interface InputOptions<T, TransformT> {
  63. /** Optional public name for the input. By default, the class field name is used. */
  64. alias?: string;
  65. /**
  66. * Optional transform that runs whenever a new value is bound. Can be used to
  67. * transform the input value before the input is updated.
  68. *
  69. * The transform function can widen the type of the input. For example, consider
  70. * an input for `disabled`. In practice, as the component author, you want to only
  71. * deal with a boolean, but users may want to bind a string if they just use the
  72. * attribute form to bind to the input via `<my-dir input>`. A transform can then
  73. * handle such string values and convert them to `boolean`. See: {@link booleanAttribute}.
  74. */
  75. transform?: (v: TransformT) => T;
  76. /**
  77. * A debug name for the input signal. Used in Angular DevTools to identify the signal.
  78. */
  79. debugName?: string;
  80. }
  81. /**
  82. * Signal input options without the transform option.
  83. *
  84. * @publicAPI
  85. */
  86. type InputOptionsWithoutTransform<T> = Omit<InputOptions<T, T>, 'transform'> & {
  87. transform?: undefined;
  88. };
  89. /**
  90. * Signal input options with the transform option required.
  91. *
  92. * @publicAPI
  93. */
  94. type InputOptionsWithTransform<T, TransformT> = Required<Pick<InputOptions<T, TransformT>, 'transform'>> & InputOptions<T, TransformT>;
  95. declare const ɵINPUT_SIGNAL_BRAND_READ_TYPE: unique symbol;
  96. declare const ɵINPUT_SIGNAL_BRAND_WRITE_TYPE: unique symbol;
  97. /**
  98. * `InputSignalWithTransform` represents a special `Signal` for a
  99. * directive/component input with a `transform` function.
  100. *
  101. * Signal inputs with transforms capture an extra generic for their transform write
  102. * type. Transforms can expand the accepted bound values for an input while ensuring
  103. * value retrievals of the signal input are still matching the generic input type.
  104. *
  105. * ```ts
  106. * class MyDir {
  107. * disabled = input(false, {
  108. * transform: (v: string|boolean) => convertToBoolean(v),
  109. * }); // InputSignalWithTransform<boolean, string|boolean>
  110. *
  111. * click() {
  112. * this.disabled() // always returns a `boolean`.
  113. * }
  114. * }
  115. * ```
  116. *
  117. * @see {@link InputSignal} for additional information.
  118. *
  119. * @publicAPI
  120. */
  121. interface InputSignalWithTransform<T, TransformT> extends Signal<T> {
  122. [SIGNAL]: InputSignalNode<T, TransformT>;
  123. [ɵINPUT_SIGNAL_BRAND_READ_TYPE]: T;
  124. [ɵINPUT_SIGNAL_BRAND_WRITE_TYPE]: TransformT;
  125. }
  126. /**
  127. * `InputSignal` represents a special `Signal` for a directive/component input.
  128. *
  129. * An input signal is similar to a non-writable signal except that it also
  130. * carries additional type-information for transforms, and that Angular internally
  131. * updates the signal whenever a new value is bound.
  132. *
  133. * @see {@link InputOptionsWithTransform} for inputs with transforms.
  134. *
  135. * @publicAPI
  136. */
  137. interface InputSignal<T> extends InputSignalWithTransform<T, T> {
  138. }
  139. /**
  140. * The `input` function allows declaration of inputs in directives and
  141. * components.
  142. *
  143. * The function exposes an API for also declaring required inputs via the
  144. * `input.required` function.
  145. *
  146. * @publicAPI
  147. * @docsPrivate Ignored because `input` is the canonical API entry.
  148. */
  149. interface InputFunction {
  150. /**
  151. * Initializes an input of type `T` with an initial value of `undefined`.
  152. * Angular will implicitly use `undefined` as initial value.
  153. */
  154. <T>(): InputSignal<T | undefined>;
  155. /** Declares an input of type `T` with an explicit initial value. */
  156. <T>(initialValue: T, opts?: InputOptionsWithoutTransform<T>): InputSignal<T>;
  157. /** Declares an input of type `T|undefined` without an initial value, but with input options */
  158. <T>(initialValue: undefined, opts: InputOptionsWithoutTransform<T>): InputSignal<T | undefined>;
  159. /**
  160. * Declares an input of type `T` with an initial value and a transform
  161. * function.
  162. *
  163. * The input accepts values of type `TransformT` and the given
  164. * transform function will transform the value to type `T`.
  165. */
  166. <T, TransformT>(initialValue: T, opts: InputOptionsWithTransform<T, TransformT>): InputSignalWithTransform<T, TransformT>;
  167. /**
  168. * Declares an input of type `T|undefined` without an initial value and with a transform
  169. * function.
  170. *
  171. * The input accepts values of type `TransformT` and the given
  172. * transform function will transform the value to type `T|undefined`.
  173. */ <T, TransformT>(initialValue: undefined, opts: InputOptionsWithTransform<T | undefined, TransformT>): InputSignalWithTransform<T | undefined, TransformT>;
  174. /**
  175. * Initializes a required input.
  176. *
  177. * Consumers of your directive/component need to bind to this
  178. * input. If unset, a compile time error will be reported.
  179. *
  180. * @publicAPI
  181. */
  182. required: {
  183. /** Declares a required input of type `T`. */
  184. <T>(opts?: InputOptionsWithoutTransform<T>): InputSignal<T>;
  185. /**
  186. * Declares a required input of type `T` with a transform function.
  187. *
  188. * The input accepts values of type `TransformT` and the given
  189. * transform function will transform the value to type `T`.
  190. */
  191. <T, TransformT>(opts: InputOptionsWithTransform<T, TransformT>): InputSignalWithTransform<T, TransformT>;
  192. };
  193. }
  194. /**
  195. * The `input` function allows declaration of Angular inputs in directives
  196. * and components.
  197. *
  198. * There are two variants of inputs that can be declared:
  199. *
  200. * 1. **Optional inputs** with an initial value.
  201. * 2. **Required inputs** that consumers need to set.
  202. *
  203. * By default, the `input` function will declare optional inputs that
  204. * always have an initial value. Required inputs can be declared
  205. * using the `input.required()` function.
  206. *
  207. * Inputs are signals. The values of an input are exposed as a `Signal`.
  208. * The signal always holds the latest value of the input that is bound
  209. * from the parent.
  210. *
  211. * @usageNotes
  212. * To use signal-based inputs, import `input` from `@angular/core`.
  213. *
  214. * ```ts
  215. * import {input} from '@angular/core`;
  216. * ```
  217. *
  218. * Inside your component, introduce a new class member and initialize
  219. * it with a call to `input` or `input.required`.
  220. *
  221. * ```ts
  222. * @Component({
  223. * ...
  224. * })
  225. * export class UserProfileComponent {
  226. * firstName = input<string>(); // Signal<string|undefined>
  227. * lastName = input.required<string>(); // Signal<string>
  228. * age = input(0) // Signal<number>
  229. * }
  230. * ```
  231. *
  232. * Inside your component template, you can display values of the inputs
  233. * by calling the signal.
  234. *
  235. * ```html
  236. * <span>{{firstName()}}</span>
  237. * ```
  238. *
  239. * @publicAPI
  240. * @initializerApiFunction
  241. */
  242. declare const input: InputFunction;
  243. /** Retrieves the write type of an `InputSignal` and `InputSignalWithTransform`. */
  244. type ɵUnwrapInputSignalWriteType<Field> = Field extends InputSignalWithTransform<any, infer WriteT> ? WriteT : never;
  245. /**
  246. * Unwraps all `InputSignal`/`InputSignalWithTransform` class fields of
  247. * the given directive.
  248. */
  249. type ɵUnwrapDirectiveSignalInputs<Dir, Fields extends keyof Dir> = {
  250. [P in Fields]: ɵUnwrapInputSignalWriteType<Dir[P]>;
  251. };
  252. /** Symbol used distinguish `WritableSignal` from other non-writable signals and functions. */
  253. declare const ɵWRITABLE_SIGNAL: unique symbol;
  254. /**
  255. * A `Signal` with a value that can be mutated via a setter interface.
  256. */
  257. interface WritableSignal<T> extends Signal<T> {
  258. [ɵWRITABLE_SIGNAL]: T;
  259. /**
  260. * Directly set the signal to a new value, and notify any dependents.
  261. */
  262. set(value: T): void;
  263. /**
  264. * Update the value of the signal based on its current value, and
  265. * notify any dependents.
  266. */
  267. update(updateFn: (value: T) => T): void;
  268. /**
  269. * Returns a readonly version of this signal. Readonly signals can be accessed to read their value
  270. * but can't be changed using set or update methods. The readonly signals do _not_ have
  271. * any built-in mechanism that would prevent deep-mutation of their value.
  272. */
  273. asReadonly(): Signal<T>;
  274. }
  275. /**
  276. * Utility function used during template type checking to extract the value from a `WritableSignal`.
  277. * @codeGenApi
  278. */
  279. declare function ɵunwrapWritableSignal<T>(value: T | {
  280. [ɵWRITABLE_SIGNAL]: T;
  281. }): T;
  282. /**
  283. * Options passed to the `signal` creation function.
  284. */
  285. interface CreateSignalOptions<T> {
  286. /**
  287. * A comparison function which defines equality for signal values.
  288. */
  289. equal?: ValueEqualityFn<T>;
  290. /**
  291. * A debug name for the signal. Used in Angular DevTools to identify the signal.
  292. */
  293. debugName?: string;
  294. }
  295. /**
  296. * Create a `Signal` that can be set or updated directly.
  297. */
  298. declare function signal<T>(initialValue: T, options?: CreateSignalOptions<T>): WritableSignal<T>;
  299. /**
  300. * Function that can be used to manually clean up a
  301. * programmatic {@link OutputRef#subscribe} subscription.
  302. *
  303. * Note: Angular will automatically clean up subscriptions
  304. * when the directive/component of the output is destroyed.
  305. *
  306. * @publicAPI
  307. */
  308. interface OutputRefSubscription {
  309. unsubscribe(): void;
  310. }
  311. /**
  312. * A reference to an Angular output.
  313. *
  314. * @publicAPI
  315. */
  316. interface OutputRef<T> {
  317. /**
  318. * Registers a callback that is invoked whenever the output
  319. * emits a new value of type `T`.
  320. *
  321. * Angular will automatically clean up the subscription when
  322. * the directive/component of the output is destroyed.
  323. */
  324. subscribe(callback: (value: T) => void): OutputRefSubscription;
  325. }
  326. /**
  327. * @publicAPI
  328. *
  329. * Options for model signals.
  330. */
  331. interface ModelOptions {
  332. /**
  333. * Optional public name of the input side of the model. The output side will have the same
  334. * name as the input, but suffixed with `Change`. By default, the class field name is used.
  335. */
  336. alias?: string;
  337. /**
  338. * A debug name for the model signal. Used in Angular DevTools to identify the signal.
  339. */
  340. debugName?: string;
  341. }
  342. /**
  343. * `ModelSignal` represents a special `Signal` for a directive/component model field.
  344. *
  345. * A model signal is a writeable signal that can be exposed as an output.
  346. * Whenever its value is updated, it emits to the output.
  347. *
  348. * @publicAPI
  349. */
  350. interface ModelSignal<T> extends WritableSignal<T>, InputSignal<T>, OutputRef<T> {
  351. [SIGNAL]: InputSignalNode<T, T>;
  352. }
  353. /**
  354. * `model` declares a writeable signal that is exposed as an input/output pair on the containing
  355. * directive. The input name is taken either from the class member or from the `alias` option.
  356. * The output name is generated by taking the input name and appending `Change`.
  357. *
  358. * The function exposes an API for also declaring required models via the
  359. * `model.required` function.
  360. *
  361. * @publicAPI
  362. * @docsPrivate Ignored because `model` is the canonical API entry.
  363. */
  364. interface ModelFunction {
  365. /**
  366. * Initializes a model of type `T` with an initial value of `undefined`.
  367. * Angular will implicitly use `undefined` as initial value.
  368. */
  369. <T>(): ModelSignal<T | undefined>;
  370. /** Initializes a model of type `T` with the given initial value. */
  371. <T>(initialValue: T, opts?: ModelOptions): ModelSignal<T>;
  372. required: {
  373. /**
  374. * Initializes a required model.
  375. *
  376. * Users of your directive/component need to bind to the input side of the model.
  377. * If unset, a compile time error will be reported.
  378. */
  379. <T>(opts?: ModelOptions): ModelSignal<T>;
  380. };
  381. }
  382. /**
  383. * `model` declares a writeable signal that is exposed as an input/output
  384. * pair on the containing directive.
  385. *
  386. * The input name is taken either from the class member or from the `alias` option.
  387. * The output name is generated by taking the input name and appending `Change`.
  388. *
  389. * @usageNotes
  390. *
  391. * To use `model()`, import the function from `@angular/core`.
  392. *
  393. * ```ts
  394. * import {model} from '@angular/core`;
  395. * ```
  396. *
  397. * Inside your component, introduce a new class member and initialize
  398. * it with a call to `model` or `model.required`.
  399. *
  400. * ```ts
  401. * @Directive({
  402. * ...
  403. * })
  404. * export class MyDir {
  405. * firstName = model<string>(); // ModelSignal<string|undefined>
  406. * lastName = model.required<string>(); // ModelSignal<string>
  407. * age = model(0); // ModelSignal<number>
  408. * }
  409. * ```
  410. *
  411. * Inside your component template, you can display the value of a `model`
  412. * by calling the signal.
  413. *
  414. * ```html
  415. * <span>{{firstName()}}</span>
  416. * ```
  417. *
  418. * Updating the `model` is equivalent to updating a writable signal.
  419. *
  420. * ```ts
  421. * updateName(newFirstName: string): void {
  422. * this.firstName.set(newFirstName);
  423. * }
  424. * ```
  425. *
  426. * @publicAPI
  427. * @initializerApiFunction
  428. */
  429. declare const model: ModelFunction;
  430. /**
  431. * @description
  432. *
  433. * Represents an abstract class `T`, if applied to a concrete class it would stop being
  434. * instantiable.
  435. *
  436. * @publicApi
  437. */
  438. interface AbstractType<T> extends Function {
  439. prototype: T;
  440. }
  441. /**
  442. * @description
  443. *
  444. * Represents a type that a Component or other object is instances of.
  445. *
  446. * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by
  447. * the `MyCustomComponent` constructor function.
  448. *
  449. * @publicApi
  450. */
  451. declare const Type$1: FunctionConstructor;
  452. interface Type$1<T> extends Function {
  453. new (...args: any[]): T;
  454. }
  455. /**
  456. * Returns a writable type version of type.
  457. *
  458. * USAGE:
  459. * Given:
  460. * ```ts
  461. * interface Person {readonly name: string}
  462. * ```
  463. *
  464. * We would like to get a read/write version of `Person`.
  465. * ```ts
  466. * const WritablePerson = Writable<Person>;
  467. * ```
  468. *
  469. * The result is that you can do:
  470. *
  471. * ```ts
  472. * const readonlyPerson: Person = {name: 'Marry'};
  473. * readonlyPerson.name = 'John'; // TypeError
  474. * (readonlyPerson as WritablePerson).name = 'John'; // OK
  475. *
  476. * // Error: Correctly detects that `Person` did not have `age` property.
  477. * (readonlyPerson as WritablePerson).age = 30;
  478. * ```
  479. */
  480. type Writable<T> = {
  481. -readonly [K in keyof T]: T[K];
  482. };
  483. /**
  484. * Creates a token that can be used in a DI Provider.
  485. *
  486. * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a
  487. * runtime representation) such as when injecting an interface, callable type, array or
  488. * parameterized type.
  489. *
  490. * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by
  491. * the `Injector`. This provides an additional level of type safety.
  492. *
  493. * <div class="docs-alert docs-alert-helpful">
  494. *
  495. * **Important Note**: Ensure that you use the same instance of the `InjectionToken` in both the
  496. * provider and the injection call. Creating a new instance of `InjectionToken` in different places,
  497. * even with the same description, will be treated as different tokens by Angular's DI system,
  498. * leading to a `NullInjectorError`.
  499. *
  500. * </div>
  501. *
  502. * {@example injection-token/src/main.ts region='InjectionToken'}
  503. *
  504. * When creating an `InjectionToken`, you can optionally specify a factory function which returns
  505. * (possibly by creating) a default value of the parameterized type `T`. This sets up the
  506. * `InjectionToken` using this factory as a provider as if it was defined explicitly in the
  507. * application's root injector. If the factory function, which takes zero arguments, needs to inject
  508. * dependencies, it can do so using the [`inject`](api/core/inject) function.
  509. * As you can see in the Tree-shakable InjectionToken example below.
  510. *
  511. * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which
  512. * overrides the above behavior and marks the token as belonging to a particular `@NgModule` (note:
  513. * this option is now deprecated). As mentioned above, `'root'` is the default value for
  514. * `providedIn`.
  515. *
  516. * The `providedIn: NgModule` and `providedIn: 'any'` options are deprecated.
  517. *
  518. * @usageNotes
  519. * ### Basic Examples
  520. *
  521. * ### Plain InjectionToken
  522. *
  523. * {@example core/di/ts/injector_spec.ts region='InjectionToken'}
  524. *
  525. * ### Tree-shakable InjectionToken
  526. *
  527. * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}
  528. *
  529. * @publicApi
  530. */
  531. declare class InjectionToken<T> {
  532. protected _desc: string;
  533. readonly ɵprov: unknown;
  534. /**
  535. * @param _desc Description for the token,
  536. * used only for debugging purposes,
  537. * it should but does not need to be unique
  538. * @param options Options for the token's usage, as described above
  539. */
  540. constructor(_desc: string, options?: {
  541. providedIn?: Type$1<any> | 'root' | 'platform' | 'any' | null;
  542. factory: () => T;
  543. });
  544. toString(): string;
  545. }
  546. declare const enum NotificationSource {
  547. MarkAncestorsForTraversal = 0,
  548. SetInput = 1,
  549. DeferBlockStateUpdate = 2,
  550. DebugApplyChanges = 3,
  551. MarkForCheck = 4,
  552. Listener = 5,
  553. CustomElement = 6,
  554. RenderHook = 7,
  555. ViewAttached = 8,
  556. ViewDetachedFromDOM = 9,
  557. AsyncAnimationsLoaded = 10,
  558. PendingTaskRemoved = 11,
  559. RootEffect = 12,
  560. ViewEffect = 13
  561. }
  562. /**
  563. * Injectable that is notified when an `LView` is made aware of changes to application state.
  564. */
  565. declare abstract class ChangeDetectionScheduler {
  566. abstract notify(source: NotificationSource): void;
  567. abstract runningTick: boolean;
  568. }
  569. /** Token used to indicate if zoneless was enabled via provideZonelessChangeDetection(). */
  570. declare const ZONELESS_ENABLED: InjectionToken<boolean>;
  571. /**
  572. * Configures the `Injector` to return a value for a token.
  573. * Base for `ValueProvider` decorator.
  574. *
  575. * @publicApi
  576. */
  577. interface ValueSansProvider {
  578. /**
  579. * The value to inject.
  580. */
  581. useValue: any;
  582. }
  583. /**
  584. * Configures the `Injector` to return a value for a token.
  585. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  586. *
  587. * @usageNotes
  588. *
  589. * ### Example
  590. *
  591. * {@example core/di/ts/provider_spec.ts region='ValueProvider'}
  592. *
  593. * ### Multi-value example
  594. *
  595. * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
  596. *
  597. * @publicApi
  598. */
  599. interface ValueProvider extends ValueSansProvider {
  600. /**
  601. * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
  602. */
  603. provide: any;
  604. /**
  605. * When true, injector returns an array of instances. This is useful to allow multiple
  606. * providers spread across many files to provide configuration information to a common token.
  607. */
  608. multi?: boolean;
  609. }
  610. /**
  611. * Configures the `Injector` to return an instance of `useClass` for a token.
  612. * Base for `StaticClassProvider` decorator.
  613. *
  614. * @publicApi
  615. */
  616. interface StaticClassSansProvider {
  617. /**
  618. * An optional class to instantiate for the `token`. By default, the `provide`
  619. * class is instantiated.
  620. */
  621. useClass: Type$1<any>;
  622. /**
  623. * A list of `token`s to be resolved by the injector. The list of values is then
  624. * used as arguments to the `useClass` constructor.
  625. */
  626. deps: any[];
  627. }
  628. /**
  629. * Configures the `Injector` to return an instance of `useClass` for a token.
  630. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  631. *
  632. * @usageNotes
  633. *
  634. * {@example core/di/ts/provider_spec.ts region='StaticClassProvider'}
  635. *
  636. * Note that following two providers are not equal:
  637. *
  638. * {@example core/di/ts/provider_spec.ts region='StaticClassProviderDifference'}
  639. *
  640. * ### Multi-value example
  641. *
  642. * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
  643. *
  644. * @publicApi
  645. */
  646. interface StaticClassProvider extends StaticClassSansProvider {
  647. /**
  648. * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
  649. */
  650. provide: any;
  651. /**
  652. * When true, injector returns an array of instances. This is useful to allow multiple
  653. * providers spread across many files to provide configuration information to a common token.
  654. */
  655. multi?: boolean;
  656. }
  657. /**
  658. * Configures the `Injector` to return an instance of a token.
  659. *
  660. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  661. *
  662. * @usageNotes
  663. *
  664. * ```ts
  665. * @Injectable(SomeModule, {deps: []})
  666. * class MyService {}
  667. * ```
  668. *
  669. * @publicApi
  670. */
  671. interface ConstructorSansProvider {
  672. /**
  673. * A list of `token`s to be resolved by the injector.
  674. */
  675. deps?: any[];
  676. }
  677. /**
  678. * Configures the `Injector` to return an instance of a token.
  679. *
  680. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  681. *
  682. * @usageNotes
  683. *
  684. * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
  685. *
  686. * ### Multi-value example
  687. *
  688. * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
  689. *
  690. * @publicApi
  691. */
  692. interface ConstructorProvider extends ConstructorSansProvider {
  693. /**
  694. * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
  695. */
  696. provide: Type$1<any>;
  697. /**
  698. * When true, injector returns an array of instances. This is useful to allow multiple
  699. * providers spread across many files to provide configuration information to a common token.
  700. */
  701. multi?: boolean;
  702. }
  703. /**
  704. * Configures the `Injector` to return a value of another `useExisting` token.
  705. *
  706. * @see {@link ExistingProvider}
  707. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  708. *
  709. * @publicApi
  710. */
  711. interface ExistingSansProvider {
  712. /**
  713. * Existing `token` to return. (Equivalent to `injector.get(useExisting)`)
  714. */
  715. useExisting: any;
  716. }
  717. /**
  718. * Configures the `Injector` to return a value of another `useExisting` token.
  719. *
  720. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  721. *
  722. * @usageNotes
  723. *
  724. * {@example core/di/ts/provider_spec.ts region='ExistingProvider'}
  725. *
  726. * ### Multi-value example
  727. *
  728. * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
  729. *
  730. * @publicApi
  731. */
  732. interface ExistingProvider extends ExistingSansProvider {
  733. /**
  734. * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
  735. */
  736. provide: any;
  737. /**
  738. * When true, injector returns an array of instances. This is useful to allow multiple
  739. * providers spread across many files to provide configuration information to a common token.
  740. */
  741. multi?: boolean;
  742. }
  743. /**
  744. * Configures the `Injector` to return a value by invoking a `useFactory` function.
  745. *
  746. * @see {@link FactoryProvider}
  747. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  748. *
  749. * @publicApi
  750. */
  751. interface FactorySansProvider {
  752. /**
  753. * A function to invoke to create a value for this `token`. The function is invoked with
  754. * resolved values of `token`s in the `deps` field.
  755. */
  756. useFactory: Function;
  757. /**
  758. * A list of `token`s to be resolved by the injector. The list of values is then
  759. * used as arguments to the `useFactory` function.
  760. */
  761. deps?: any[];
  762. }
  763. /**
  764. * Configures the `Injector` to return a value by invoking a `useFactory` function.
  765. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  766. *
  767. * @usageNotes
  768. *
  769. * {@example core/di/ts/provider_spec.ts region='FactoryProvider'}
  770. *
  771. * Dependencies can also be marked as optional:
  772. *
  773. * {@example core/di/ts/provider_spec.ts region='FactoryProviderOptionalDeps'}
  774. *
  775. * ### Multi-value example
  776. *
  777. * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
  778. *
  779. * @publicApi
  780. */
  781. interface FactoryProvider extends FactorySansProvider {
  782. /**
  783. * An injection token. (Typically an instance of `Type` or `InjectionToken`, but can be `any`).
  784. */
  785. provide: any;
  786. /**
  787. * When true, injector returns an array of instances. This is useful to allow multiple
  788. * providers spread across many files to provide configuration information to a common token.
  789. */
  790. multi?: boolean;
  791. }
  792. /**
  793. * Describes how an `Injector` should be configured as static (that is, without reflection).
  794. * A static provider provides tokens to an injector for various types of dependencies.
  795. *
  796. * @see {@link Injector.create()}
  797. * @see [Dependency Injection Guide](guide/di/dependency-injection-providers).
  798. *
  799. * @publicApi
  800. */
  801. type StaticProvider = ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider | any[];
  802. /**
  803. * Configures the `Injector` to return an instance of `Type` when `Type' is used as the token.
  804. *
  805. * Create an instance by invoking the `new` operator and supplying additional arguments.
  806. * This form is a short form of `TypeProvider`;
  807. *
  808. * For more details, see the ["Dependency Injection Guide"](guide/di/dependency-injection.
  809. *
  810. * @usageNotes
  811. *
  812. * {@example core/di/ts/provider_spec.ts region='TypeProvider'}
  813. *
  814. * @publicApi
  815. */
  816. interface TypeProvider extends Type$1<any> {
  817. }
  818. /**
  819. * Configures the `Injector` to return a value by invoking a `useClass` function.
  820. * Base for `ClassProvider` decorator.
  821. *
  822. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  823. *
  824. * @publicApi
  825. */
  826. interface ClassSansProvider {
  827. /**
  828. * Class to instantiate for the `token`.
  829. */
  830. useClass: Type$1<any>;
  831. }
  832. /**
  833. * Configures the `Injector` to return an instance of `useClass` for a token.
  834. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  835. *
  836. * @usageNotes
  837. *
  838. * {@example core/di/ts/provider_spec.ts region='ClassProvider'}
  839. *
  840. * Note that following two providers are not equal:
  841. *
  842. * {@example core/di/ts/provider_spec.ts region='ClassProviderDifference'}
  843. *
  844. * ### Multi-value example
  845. *
  846. * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
  847. *
  848. * @publicApi
  849. */
  850. interface ClassProvider extends ClassSansProvider {
  851. /**
  852. * An injection token. (Typically an instance of `Type` or `InjectionToken`, but can be `any`).
  853. */
  854. provide: any;
  855. /**
  856. * When true, injector returns an array of instances. This is useful to allow multiple
  857. * providers spread across many files to provide configuration information to a common token.
  858. */
  859. multi?: boolean;
  860. }
  861. /**
  862. * Describes how the `Injector` should be configured.
  863. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  864. *
  865. * @see {@link StaticProvider}
  866. *
  867. * @publicApi
  868. */
  869. type Provider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | any[];
  870. /**
  871. * Encapsulated `Provider`s that are only accepted during creation of an `EnvironmentInjector` (e.g.
  872. * in an `NgModule`).
  873. *
  874. * Using this wrapper type prevents providers which are only designed to work in
  875. * application/environment injectors from being accidentally included in
  876. * `@Component.providers` and ending up in a component injector.
  877. *
  878. * This wrapper type prevents access to the `Provider`s inside.
  879. *
  880. * @see {@link makeEnvironmentProviders}
  881. * @see {@link importProvidersFrom}
  882. *
  883. * @publicApi
  884. */
  885. type EnvironmentProviders = {
  886. ɵbrand: 'EnvironmentProviders';
  887. };
  888. interface InternalEnvironmentProviders extends EnvironmentProviders {
  889. ɵproviders: (Provider | EnvironmentProviders)[];
  890. /**
  891. * If present, indicates that the `EnvironmentProviders` were derived from NgModule providers.
  892. *
  893. * This is used to produce clearer error messages.
  894. */
  895. ɵfromNgModule?: true;
  896. }
  897. declare function isEnvironmentProviders(value: Provider | EnvironmentProviders | InternalEnvironmentProviders): value is InternalEnvironmentProviders;
  898. /**
  899. * Describes a function that is used to process provider lists (such as provider
  900. * overrides).
  901. */
  902. type ProcessProvidersFunction = (providers: Provider[]) => Provider[];
  903. /**
  904. * A wrapper around an NgModule that associates it with providers
  905. * Usage without a generic type is deprecated.
  906. *
  907. * @publicApi
  908. */
  909. interface ModuleWithProviders<T> {
  910. ngModule: Type$1<T>;
  911. providers?: Array<Provider | EnvironmentProviders>;
  912. }
  913. /**
  914. * Providers that were imported from NgModules via the `importProvidersFrom` function.
  915. *
  916. * These providers are meant for use in an application injector (or other environment injectors) and
  917. * should not be used in component injectors.
  918. *
  919. * This type cannot be directly implemented. It's returned from the `importProvidersFrom` function
  920. * and serves to prevent the extracted NgModule providers from being used in the wrong contexts.
  921. *
  922. * @see {@link importProvidersFrom}
  923. *
  924. * @publicApi
  925. * @deprecated replaced by `EnvironmentProviders`
  926. */
  927. type ImportedNgModuleProviders = EnvironmentProviders;
  928. /**
  929. * @fileoverview
  930. * While Angular only uses Trusted Types internally for the time being,
  931. * references to Trusted Types could leak into our core.d.ts, which would force
  932. * anyone compiling against @angular/core to provide the @types/trusted-types
  933. * package in their compilation unit.
  934. *
  935. * Until https://github.com/microsoft/TypeScript/issues/30024 is resolved, we
  936. * will keep Angular's public API surface free of references to Trusted Types.
  937. * For internal and semi-private APIs that need to reference Trusted Types, the
  938. * minimal type definitions for the Trusted Types API provided by this module
  939. * should be used instead. They are marked as "declare" to prevent them from
  940. * being renamed by compiler optimization.
  941. *
  942. * Adapted from
  943. * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/trusted-types/index.d.ts
  944. * but restricted to the API surface used within Angular.
  945. */
  946. type TrustedHTML = string & {
  947. __brand__: 'TrustedHTML';
  948. };
  949. type TrustedScript = string & {
  950. __brand__: 'TrustedScript';
  951. };
  952. type TrustedScriptURL = string & {
  953. __brand__: 'TrustedScriptURL';
  954. };
  955. /**
  956. * Function used to sanitize the value before writing it into the renderer.
  957. */
  958. type SanitizerFn = (value: any, tagName?: string, propName?: string) => string | TrustedHTML | TrustedScript | TrustedScriptURL;
  959. /**
  960. * Stores a list of nodes which need to be removed.
  961. *
  962. * Numbers are indexes into the `LView`
  963. * - index > 0: `removeRNode(lView[0])`
  964. * - index < 0: `removeICU(~lView[0])`
  965. */
  966. interface I18nRemoveOpCodes extends Array<number> {
  967. __brand__: 'I18nRemoveOpCodes';
  968. }
  969. /**
  970. * Array storing OpCode for dynamically creating `i18n` blocks.
  971. *
  972. * Example:
  973. * ```ts
  974. * <I18nCreateOpCode>[
  975. * // For adding text nodes
  976. * // ---------------------
  977. * // Equivalent to:
  978. * // lView[1].appendChild(lView[0] = document.createTextNode('xyz'));
  979. * 'xyz', 0, 1 << SHIFT_PARENT | 0 << SHIFT_REF | AppendChild,
  980. *
  981. * // For adding element nodes
  982. * // ---------------------
  983. * // Equivalent to:
  984. * // lView[1].appendChild(lView[0] = document.createElement('div'));
  985. * ELEMENT_MARKER, 'div', 0, 1 << SHIFT_PARENT | 0 << SHIFT_REF | AppendChild,
  986. *
  987. * // For adding comment nodes
  988. * // ---------------------
  989. * // Equivalent to:
  990. * // lView[1].appendChild(lView[0] = document.createComment(''));
  991. * ICU_MARKER, '', 0, 1 << SHIFT_PARENT | 0 << SHIFT_REF | AppendChild,
  992. *
  993. * // For moving existing nodes to a different location
  994. * // --------------------------------------------------
  995. * // Equivalent to:
  996. * // const node = lView[1];
  997. * // lView[2].appendChild(node);
  998. * 1 << SHIFT_REF | Select, 2 << SHIFT_PARENT | 0 << SHIFT_REF | AppendChild,
  999. *
  1000. * // For removing existing nodes
  1001. * // --------------------------------------------------
  1002. * // const node = lView[1];
  1003. * // removeChild(tView.data(1), node, lView);
  1004. * 1 << SHIFT_REF | Remove,
  1005. *
  1006. * // For writing attributes
  1007. * // --------------------------------------------------
  1008. * // const node = lView[1];
  1009. * // node.setAttribute('attr', 'value');
  1010. * 1 << SHIFT_REF | Attr, 'attr', 'value'
  1011. * ];
  1012. * ```
  1013. */
  1014. interface IcuCreateOpCodes extends Array<number | string | ELEMENT_MARKER | ICU_MARKER | null>, I18nDebug {
  1015. __brand__: 'I18nCreateOpCodes';
  1016. }
  1017. /**
  1018. * Marks that the next string is an element name.
  1019. *
  1020. * See `I18nMutateOpCodes` documentation.
  1021. */
  1022. declare const ELEMENT_MARKER: ELEMENT_MARKER;
  1023. interface ELEMENT_MARKER {
  1024. marker: 'element';
  1025. }
  1026. /**
  1027. * Marks that the next string is comment text need for ICU.
  1028. *
  1029. * See `I18nMutateOpCodes` documentation.
  1030. */
  1031. declare const ICU_MARKER: ICU_MARKER;
  1032. interface ICU_MARKER {
  1033. marker: 'ICU';
  1034. }
  1035. interface I18nDebug {
  1036. /**
  1037. * Human readable representation of the OpCode arrays.
  1038. *
  1039. * NOTE: This property only exists if `ngDevMode` is set to `true` and it is not present in
  1040. * production. Its presence is purely to help debug issue in development, and should not be relied
  1041. * on in production application.
  1042. */
  1043. debug?: string[];
  1044. }
  1045. /**
  1046. * Array storing OpCode for dynamically creating `i18n` translation DOM elements.
  1047. *
  1048. * This array creates a sequence of `Text` and `Comment` (as ICU anchor) DOM elements. It consists
  1049. * of a pair of `number` and `string` pairs which encode the operations for the creation of the
  1050. * translated block.
  1051. *
  1052. * The number is shifted and encoded according to `I18nCreateOpCode`
  1053. *
  1054. * Pseudocode:
  1055. * ```ts
  1056. * const i18nCreateOpCodes = [
  1057. * 10 << I18nCreateOpCode.SHIFT, "Text Node add to DOM",
  1058. * 11 << I18nCreateOpCode.SHIFT | I18nCreateOpCode.COMMENT, "Comment Node add to DOM",
  1059. * 12 << I18nCreateOpCode.SHIFT | I18nCreateOpCode.APPEND_LATER, "Text Node added later"
  1060. * ];
  1061. *
  1062. * for(var i=0; i<i18nCreateOpCodes.length; i++) {
  1063. * const opcode = i18NCreateOpCodes[i++];
  1064. * const index = opcode >> I18nCreateOpCode.SHIFT;
  1065. * const text = i18NCreateOpCodes[i];
  1066. * let node: Text|Comment;
  1067. * if (opcode & I18nCreateOpCode.COMMENT === I18nCreateOpCode.COMMENT) {
  1068. * node = lView[~index] = document.createComment(text);
  1069. * } else {
  1070. * node = lView[index] = document.createText(text);
  1071. * }
  1072. * if (opcode & I18nCreateOpCode.APPEND_EAGERLY !== I18nCreateOpCode.APPEND_EAGERLY) {
  1073. * parentNode.appendChild(node);
  1074. * }
  1075. * }
  1076. * ```
  1077. */
  1078. interface I18nCreateOpCodes extends Array<number | string>, I18nDebug {
  1079. __brand__: 'I18nCreateOpCodes';
  1080. }
  1081. /**
  1082. * Stores DOM operations which need to be applied to update DOM render tree due to changes in
  1083. * expressions.
  1084. *
  1085. * The basic idea is that `i18nExp` OpCodes capture expression changes and update a change
  1086. * mask bit. (Bit 1 for expression 1, bit 2 for expression 2 etc..., bit 32 for expression 32 and
  1087. * higher.) The OpCodes then compare its own change mask against the expression change mask to
  1088. * determine if the OpCodes should execute.
  1089. *
  1090. * NOTE: 32nd bit is special as it says 32nd or higher. This way if we have more than 32 bindings
  1091. * the code still works, but with lower efficiency. (it is unlikely that a translation would have
  1092. * more than 32 bindings.)
  1093. *
  1094. * These OpCodes can be used by both the i18n block as well as ICU sub-block.
  1095. *
  1096. * ## Example
  1097. *
  1098. * Assume
  1099. * ```ts
  1100. * if (rf & RenderFlags.Update) {
  1101. * i18nExp(ctx.exp1); // If changed set mask bit 1
  1102. * i18nExp(ctx.exp2); // If changed set mask bit 2
  1103. * i18nExp(ctx.exp3); // If changed set mask bit 3
  1104. * i18nExp(ctx.exp4); // If changed set mask bit 4
  1105. * i18nApply(0); // Apply all changes by executing the OpCodes.
  1106. * }
  1107. * ```
  1108. * We can assume that each call to `i18nExp` sets an internal `changeMask` bit depending on the
  1109. * index of `i18nExp`.
  1110. *
  1111. * ### OpCodes
  1112. * ```ts
  1113. * <I18nUpdateOpCodes>[
  1114. * // The following OpCodes represent: `<div i18n-title="pre{{exp1}}in{{exp2}}post">`
  1115. * // If `changeMask & 0b11`
  1116. * // has changed then execute update OpCodes.
  1117. * // has NOT changed then skip `8` values and start processing next OpCodes.
  1118. * 0b11, 8,
  1119. * // Concatenate `newValue = 'pre'+lView[bindIndex-4]+'in'+lView[bindIndex-3]+'post';`.
  1120. * 'pre', -4, 'in', -3, 'post',
  1121. * // Update attribute: `elementAttribute(1, 'title', sanitizerFn(newValue));`
  1122. * 1 << SHIFT_REF | Attr, 'title', sanitizerFn,
  1123. *
  1124. * // The following OpCodes represent: `<div i18n>Hello {{exp3}}!">`
  1125. * // If `changeMask & 0b100`
  1126. * // has changed then execute update OpCodes.
  1127. * // has NOT changed then skip `4` values and start processing next OpCodes.
  1128. * 0b100, 4,
  1129. * // Concatenate `newValue = 'Hello ' + lView[bindIndex -2] + '!';`.
  1130. * 'Hello ', -2, '!',
  1131. * // Update text: `lView[1].textContent = newValue;`
  1132. * 1 << SHIFT_REF | Text,
  1133. *
  1134. * // The following OpCodes represent: `<div i18n>{exp4, plural, ... }">`
  1135. * // If `changeMask & 0b1000`
  1136. * // has changed then execute update OpCodes.
  1137. * // has NOT changed then skip `2` values and start processing next OpCodes.
  1138. * 0b1000, 2,
  1139. * // Concatenate `newValue = lView[bindIndex -1];`.
  1140. * -1,
  1141. * // Switch ICU: `icuSwitchCase(lView[1], 0, newValue);`
  1142. * 0 << SHIFT_ICU | 1 << SHIFT_REF | IcuSwitch,
  1143. *
  1144. * // Note `changeMask & -1` is always true, so the IcuUpdate will always execute.
  1145. * -1, 1,
  1146. * // Update ICU: `icuUpdateCase(lView[1], 0);`
  1147. * 0 << SHIFT_ICU | 1 << SHIFT_REF | IcuUpdate,
  1148. *
  1149. * ];
  1150. * ```
  1151. *
  1152. */
  1153. interface I18nUpdateOpCodes extends Array<string | number | SanitizerFn | null>, I18nDebug {
  1154. __brand__: 'I18nUpdateOpCodes';
  1155. }
  1156. /**
  1157. * Store information for the i18n translation block.
  1158. */
  1159. interface TI18n {
  1160. /**
  1161. * A set of OpCodes which will create the Text Nodes and ICU anchors for the translation blocks.
  1162. *
  1163. * NOTE: The ICU anchors are filled in with ICU Update OpCode.
  1164. */
  1165. create: I18nCreateOpCodes;
  1166. /**
  1167. * A set of OpCodes which will be executed on each change detection to determine if any changes to
  1168. * DOM are required.
  1169. */
  1170. update: I18nUpdateOpCodes;
  1171. /**
  1172. * An AST representing the translated message. This is used for hydration (and serialization),
  1173. * while the Update and Create OpCodes are used at runtime.
  1174. */
  1175. ast: Array<I18nNode>;
  1176. /**
  1177. * Index of a parent TNode, which represents a host node for this i18n block.
  1178. */
  1179. parentTNodeIndex: number;
  1180. }
  1181. /**
  1182. * Defines the ICU type of `select` or `plural`
  1183. */
  1184. declare const enum IcuType {
  1185. select = 0,
  1186. plural = 1
  1187. }
  1188. interface TIcu {
  1189. /**
  1190. * Defines the ICU type of `select` or `plural`
  1191. */
  1192. type: IcuType;
  1193. /**
  1194. * Index in `LView` where the anchor node is stored. `<!-- ICU 0:0 -->`
  1195. */
  1196. anchorIdx: number;
  1197. /**
  1198. * Currently selected ICU case pointer.
  1199. *
  1200. * `lView[currentCaseLViewIndex]` stores the currently selected case. This is needed to know how
  1201. * to clean up the current case when transitioning no the new case.
  1202. *
  1203. * If the value stored is:
  1204. * `null`: No current case selected.
  1205. * `<0`: A flag which means that the ICU just switched and that `icuUpdate` must be executed
  1206. * regardless of the `mask`. (After the execution the flag is cleared)
  1207. * `>=0` A currently selected case index.
  1208. */
  1209. currentCaseLViewIndex: number;
  1210. /**
  1211. * A list of case values which the current ICU will try to match.
  1212. *
  1213. * The last value is `other`
  1214. */
  1215. cases: any[];
  1216. /**
  1217. * A set of OpCodes to apply in order to build up the DOM render tree for the ICU
  1218. */
  1219. create: IcuCreateOpCodes[];
  1220. /**
  1221. * A set of OpCodes to apply in order to destroy the DOM render tree for the ICU.
  1222. */
  1223. remove: I18nRemoveOpCodes[];
  1224. /**
  1225. * A set of OpCodes to apply in order to update the DOM render tree for the ICU bindings.
  1226. */
  1227. update: I18nUpdateOpCodes[];
  1228. }
  1229. type I18nNode = I18nTextNode | I18nElementNode | I18nICUNode | I18nPlaceholderNode;
  1230. /**
  1231. * Represents a block of text in a translation, such as `Hello, {{ name }}!`.
  1232. */
  1233. interface I18nTextNode {
  1234. /** The AST node kind */
  1235. kind: I18nNodeKind.TEXT;
  1236. /** The LView index */
  1237. index: number;
  1238. }
  1239. /**
  1240. * Represents a simple DOM element in a translation, such as `<div>...</div>`
  1241. */
  1242. interface I18nElementNode {
  1243. /** The AST node kind */
  1244. kind: I18nNodeKind.ELEMENT;
  1245. /** The LView index */
  1246. index: number;
  1247. /** The child nodes */
  1248. children: Array<I18nNode>;
  1249. }
  1250. /**
  1251. * Represents an ICU in a translation.
  1252. */
  1253. interface I18nICUNode {
  1254. /** The AST node kind */
  1255. kind: I18nNodeKind.ICU;
  1256. /** The LView index */
  1257. index: number;
  1258. /** The branching cases */
  1259. cases: Array<Array<I18nNode>>;
  1260. /** The LView index that stores the active case */
  1261. currentCaseLViewIndex: number;
  1262. }
  1263. /**
  1264. * Represents special content that is embedded into the translation. This can
  1265. * either be a special built-in element, such as <ng-container> and <ng-content>,
  1266. * or it can be a sub-template, for example, from a structural directive.
  1267. */
  1268. interface I18nPlaceholderNode {
  1269. /** The AST node kind */
  1270. kind: I18nNodeKind.PLACEHOLDER;
  1271. /** The LView index */
  1272. index: number;
  1273. /** The child nodes */
  1274. children: Array<I18nNode>;
  1275. /** The placeholder type */
  1276. type: I18nPlaceholderType;
  1277. }
  1278. declare const enum I18nPlaceholderType {
  1279. ELEMENT = 0,
  1280. SUBTEMPLATE = 1
  1281. }
  1282. declare const enum I18nNodeKind {
  1283. TEXT = 0,
  1284. ELEMENT = 1,
  1285. PLACEHOLDER = 2,
  1286. ICU = 3
  1287. }
  1288. /**
  1289. * The goal here is to make sure that the browser DOM API is the Renderer.
  1290. * We do this by defining a subset of DOM API to be the renderer and then
  1291. * use that at runtime for rendering.
  1292. *
  1293. * At runtime we can then use the DOM api directly, in server or web-worker
  1294. * it will be easy to implement such API.
  1295. */
  1296. /** Subset of API needed for appending elements and text nodes. */
  1297. interface RNode {
  1298. /**
  1299. * Returns the parent Element, Document, or DocumentFragment
  1300. */
  1301. parentNode: RNode | null;
  1302. /**
  1303. * Returns the parent Element if there is one
  1304. */
  1305. parentElement: RElement | null;
  1306. /**
  1307. * Gets the Node immediately following this one in the parent's childNodes
  1308. */
  1309. nextSibling: RNode | null;
  1310. /**
  1311. * Insert a child node.
  1312. *
  1313. * Used exclusively for adding View root nodes into ViewAnchor location.
  1314. */
  1315. insertBefore(newChild: RNode, refChild: RNode | null, isViewRoot: boolean): void;
  1316. /**
  1317. * Append a child node.
  1318. *
  1319. * Used exclusively for building up DOM which are static (ie not View roots)
  1320. */
  1321. appendChild(newChild: RNode): RNode;
  1322. }
  1323. /**
  1324. * Subset of API needed for writing attributes, properties, and setting up
  1325. * listeners on Element.
  1326. */
  1327. interface RElement extends RNode {
  1328. firstChild: RNode | null;
  1329. style: RCssStyleDeclaration;
  1330. classList: RDomTokenList;
  1331. className: string;
  1332. tagName: string;
  1333. textContent: string | null;
  1334. hasAttribute(name: string): boolean;
  1335. getAttribute(name: string): string | null;
  1336. setAttribute(name: string, value: string | TrustedHTML | TrustedScript | TrustedScriptURL): void;
  1337. removeAttribute(name: string): void;
  1338. setAttributeNS(namespaceURI: string, qualifiedName: string, value: string | TrustedHTML | TrustedScript | TrustedScriptURL): void;
  1339. addEventListener(type: string, listener: EventListener, useCapture?: boolean): void;
  1340. removeEventListener(type: string, listener?: EventListener, options?: boolean): void;
  1341. remove(): void;
  1342. setProperty?(name: string, value: any): void;
  1343. }
  1344. interface RCssStyleDeclaration {
  1345. removeProperty(propertyName: string): string;
  1346. setProperty(propertyName: string, value: string | null, priority?: string): void;
  1347. }
  1348. interface RDomTokenList {
  1349. add(token: string): void;
  1350. remove(token: string): void;
  1351. }
  1352. interface RText extends RNode {
  1353. textContent: string | null;
  1354. }
  1355. interface RComment extends RNode {
  1356. textContent: string | null;
  1357. }
  1358. /**
  1359. * Keys within serialized view data structure to represent various
  1360. * parts. See the `SerializedView` interface below for additional information.
  1361. */
  1362. declare const ELEMENT_CONTAINERS = "e";
  1363. declare const TEMPLATES = "t";
  1364. declare const CONTAINERS = "c";
  1365. declare const MULTIPLIER = "x";
  1366. declare const NUM_ROOT_NODES = "r";
  1367. declare const TEMPLATE_ID = "i";
  1368. declare const NODES = "n";
  1369. declare const DISCONNECTED_NODES = "d";
  1370. declare const I18N_DATA = "l";
  1371. declare const DEFER_BLOCK_ID = "di";
  1372. declare const DEFER_BLOCK_STATE = "s";
  1373. /**
  1374. * Represents element containers within this view, stored as key-value pairs
  1375. * where key is an index of a container in an LView (also used in the
  1376. * `elementContainerStart` instruction), the value is the number of root nodes
  1377. * in this container. This information is needed to locate an anchor comment
  1378. * node that goes after all container nodes.
  1379. */
  1380. interface SerializedElementContainers {
  1381. [key: number]: number;
  1382. }
  1383. /**
  1384. * Serialized data structure that contains relevant hydration
  1385. * annotation information that describes a given hydration boundary
  1386. * (e.g. a component).
  1387. */
  1388. interface SerializedView {
  1389. /**
  1390. * Serialized information about <ng-container>s.
  1391. */
  1392. [ELEMENT_CONTAINERS]?: SerializedElementContainers;
  1393. /**
  1394. * Serialized information about templates.
  1395. * Key-value pairs where a key is an index of the corresponding
  1396. * `template` instruction and the value is a unique id that can
  1397. * be used during hydration to identify that template.
  1398. */
  1399. [TEMPLATES]?: Record<number, string>;
  1400. /**
  1401. * Serialized information about view containers.
  1402. * Key-value pairs where a key is an index of the corresponding
  1403. * LContainer entry within an LView, and the value is a list
  1404. * of serialized information about views within this container.
  1405. */
  1406. [CONTAINERS]?: Record<number, SerializedContainerView[]>;
  1407. /**
  1408. * Serialized information about nodes in a template.
  1409. * Key-value pairs where a key is an index of the corresponding
  1410. * DOM node in an LView and the value is a path that describes
  1411. * the location of this node (as a set of navigation instructions).
  1412. */
  1413. [NODES]?: Record<number, string>;
  1414. /**
  1415. * A list of ids which represents a set of nodes disconnected
  1416. * from the DOM tree at the serialization time, but otherwise
  1417. * present in the internal data structures.
  1418. *
  1419. * This information is used to avoid triggering the hydration
  1420. * logic for such nodes and instead use a regular "creation mode".
  1421. */
  1422. [DISCONNECTED_NODES]?: number[];
  1423. /**
  1424. * Serialized information about i18n blocks in a template.
  1425. * Key-value pairs where a key is an index of the corresponding
  1426. * i18n entry within an LView, and the value is a list of
  1427. * active ICU cases.
  1428. */
  1429. [I18N_DATA]?: Record<number, number[]>;
  1430. /**
  1431. * If this view represents a `@defer` block, this field contains
  1432. * unique id of the block.
  1433. */
  1434. [DEFER_BLOCK_ID]?: string;
  1435. /**
  1436. * This field represents a status, based on the `DeferBlockState` enum.
  1437. */
  1438. [DEFER_BLOCK_STATE]?: number;
  1439. }
  1440. /**
  1441. * Serialized data structure that contains relevant hydration
  1442. * annotation information about a view that is a part of a
  1443. * ViewContainer collection.
  1444. */
  1445. interface SerializedContainerView extends SerializedView {
  1446. /**
  1447. * Unique id that represents a TView that was used to create
  1448. * a given instance of a view:
  1449. * - TViewType.Embedded: a unique id generated during serialization on the server
  1450. * - TViewType.Component: an id generated based on component properties
  1451. * (see `getComponentId` function for details)
  1452. */
  1453. [TEMPLATE_ID]: string;
  1454. /**
  1455. * Number of root nodes that belong to this view.
  1456. * This information is needed to effectively traverse the DOM tree
  1457. * and identify segments that belong to different views.
  1458. */
  1459. [NUM_ROOT_NODES]: number;
  1460. /**
  1461. * Number of times this view is repeated.
  1462. * This is used to avoid serializing and sending the same hydration
  1463. * information about similar views (for example, produced by *ngFor).
  1464. */
  1465. [MULTIPLIER]?: number;
  1466. }
  1467. /**
  1468. * An object that contains hydration-related information serialized
  1469. * on the server, as well as the necessary references to segments of
  1470. * the DOM, to facilitate the hydration process for a given hydration
  1471. * boundary on the client.
  1472. */
  1473. interface DehydratedView {
  1474. /**
  1475. * The readonly hydration annotation data.
  1476. */
  1477. data: Readonly<SerializedView>;
  1478. /**
  1479. * A reference to the first child in a DOM segment associated
  1480. * with a given hydration boundary.
  1481. *
  1482. * Once a view becomes hydrated, the value is set to `null`, which
  1483. * indicates that further detaching/attaching view actions should result
  1484. * in invoking corresponding DOM actions (attaching DOM nodes action is
  1485. * skipped when we hydrate, since nodes are already in the DOM).
  1486. */
  1487. firstChild: RNode | null;
  1488. /**
  1489. * Stores references to first nodes in DOM segments that
  1490. * represent either an <ng-container> or a view container.
  1491. */
  1492. segmentHeads?: {
  1493. [index: number]: RNode | null;
  1494. };
  1495. /**
  1496. * An instance of a Set that represents nodes disconnected from
  1497. * the DOM tree at the serialization time, but otherwise present
  1498. * in the internal data structures.
  1499. *
  1500. * The Set is based on the `SerializedView[DISCONNECTED_NODES]` data
  1501. * and is needed to have constant-time lookups.
  1502. *
  1503. * If the value is `null`, it means that there were no disconnected
  1504. * nodes detected in this view at serialization time.
  1505. */
  1506. disconnectedNodes?: Set<number> | null;
  1507. /**
  1508. * A mapping from a view to the first child to begin claiming nodes.
  1509. *
  1510. * This mapping is generated by an i18n block, and is the source of
  1511. * truth for the nodes inside of it.
  1512. */
  1513. i18nNodes?: Map<number, RNode | null>;
  1514. /**
  1515. * A mapping from the index of an ICU node to dehydrated data for it.
  1516. *
  1517. * This information is used during the hydration process on the client.
  1518. * ICU cases that were active during server-side rendering will be added
  1519. * to the map. The hydration logic will "claim" matching cases, removing
  1520. * them from the map. The remaining entries are "unclaimed", and will be
  1521. * removed from the DOM during hydration cleanup.
  1522. */
  1523. dehydratedIcuData?: Map<number, DehydratedIcuData>;
  1524. }
  1525. /**
  1526. * An object that contains hydration-related information serialized
  1527. * on the server, as well as the necessary references to segments of
  1528. * the DOM, to facilitate the hydration process for a given view
  1529. * inside a view container (either an embedded view or a view created
  1530. * for a component).
  1531. */
  1532. interface DehydratedContainerView extends DehydratedView {
  1533. data: Readonly<SerializedContainerView>;
  1534. }
  1535. /**
  1536. * An object that contains information about a dehydrated ICU case,
  1537. * to facilitate cleaning up ICU cases that were active during
  1538. * server-side rendering, but not during hydration.
  1539. */
  1540. interface DehydratedIcuData {
  1541. /**
  1542. * The case index that this data represents.
  1543. */
  1544. case: number;
  1545. /**
  1546. * A reference back to the AST for the ICU node. This allows the
  1547. * AST to be used to clean up dehydrated nodes.
  1548. */
  1549. node: I18nICUNode;
  1550. }
  1551. /**
  1552. * `KeyValueArray` is an array where even positions contain keys and odd positions contain values.
  1553. *
  1554. * `KeyValueArray` provides a very efficient way of iterating over its contents. For small
  1555. * sets (~10) the cost of binary searching an `KeyValueArray` has about the same performance
  1556. * characteristics that of a `Map` with significantly better memory footprint.
  1557. *
  1558. * If used as a `Map` the keys are stored in alphabetical order so that they can be binary searched
  1559. * for retrieval.
  1560. *
  1561. * See: `keyValueArraySet`, `keyValueArrayGet`, `keyValueArrayIndexOf`, `keyValueArrayDelete`.
  1562. */
  1563. interface KeyValueArray<VALUE> extends Array<VALUE | string> {
  1564. __brand__: 'array-map';
  1565. }
  1566. /**
  1567. * Value stored in the `TData` which is needed to re-concatenate the styling.
  1568. *
  1569. * See: `TStylingKeyPrimitive` and `TStylingStatic`
  1570. */
  1571. type TStylingKey = TStylingKeyPrimitive | TStylingStatic;
  1572. /**
  1573. * The primitive portion (`TStylingStatic` removed) of the value stored in the `TData` which is
  1574. * needed to re-concatenate the styling.
  1575. *
  1576. * - `string`: Stores the property name. Used with `ɵɵstyleProp`/`ɵɵclassProp` instruction.
  1577. * - `null`: Represents map, so there is no name. Used with `ɵɵstyleMap`/`ɵɵclassMap`.
  1578. * - `false`: Represents an ignore case. This happens when `ɵɵstyleProp`/`ɵɵclassProp` instruction
  1579. * is combined with directive which shadows its input `@Input('class')`. That way the binding
  1580. * should not participate in the styling resolution.
  1581. */
  1582. type TStylingKeyPrimitive = string | null | false;
  1583. /**
  1584. * Store the static values for the styling binding.
  1585. *
  1586. * The `TStylingStatic` is just `KeyValueArray` where key `""` (stored at location 0) contains the
  1587. * `TStylingKey` (stored at location 1). In other words this wraps the `TStylingKey` such that the
  1588. * `""` contains the wrapped value.
  1589. *
  1590. * When instructions are resolving styling they may need to look forward or backwards in the linked
  1591. * list to resolve the value. For this reason we have to make sure that he linked list also contains
  1592. * the static values. However the list only has space for one item per styling instruction. For this
  1593. * reason we store the static values here as part of the `TStylingKey`. This means that the
  1594. * resolution function when looking for a value needs to first look at the binding value, and than
  1595. * at `TStylingKey` (if it exists).
  1596. *
  1597. * Imagine we have:
  1598. *
  1599. * ```angular-ts
  1600. * <div class="TEMPLATE" my-dir>
  1601. *
  1602. * @Directive({
  1603. * host: {
  1604. * class: 'DIR',
  1605. * '[class.dynamic]': 'exp' // ɵɵclassProp('dynamic', ctx.exp);
  1606. * }
  1607. * })
  1608. * ```
  1609. *
  1610. * In the above case the linked list will contain one item:
  1611. *
  1612. * ```ts
  1613. * // assume binding location: 10 for `ɵɵclassProp('dynamic', ctx.exp);`
  1614. * tData[10] = <TStylingStatic>[
  1615. * '': 'dynamic', // This is the wrapped value of `TStylingKey`
  1616. * 'DIR': true, // This is the default static value of directive binding.
  1617. * ];
  1618. * tData[10 + 1] = 0; // We don't have prev/next.
  1619. *
  1620. * lView[10] = undefined; // assume `ctx.exp` is `undefined`
  1621. * lView[10 + 1] = undefined; // Just normalized `lView[10]`
  1622. * ```
  1623. *
  1624. * So when the function is resolving styling value, it first needs to look into the linked list
  1625. * (there is none) and than into the static `TStylingStatic` too see if there is a default value for
  1626. * `dynamic` (there is not). Therefore it is safe to remove it.
  1627. *
  1628. * If setting `true` case:
  1629. * ```ts
  1630. * lView[10] = true; // assume `ctx.exp` is `true`
  1631. * lView[10 + 1] = true; // Just normalized `lView[10]`
  1632. * ```
  1633. * So when the function is resolving styling value, it first needs to look into the linked list
  1634. * (there is none) and than into `TNode.residualClass` (TNode.residualStyle) which contains
  1635. * ```ts
  1636. * tNode.residualClass = [
  1637. * 'TEMPLATE': true,
  1638. * ];
  1639. * ```
  1640. *
  1641. * This means that it is safe to add class.
  1642. */
  1643. interface TStylingStatic extends KeyValueArray<any> {
  1644. }
  1645. /**
  1646. * This is a branded number which contains previous and next index.
  1647. *
  1648. * When we come across styling instructions we need to store the `TStylingKey` in the correct
  1649. * order so that we can re-concatenate the styling value in the desired priority.
  1650. *
  1651. * The insertion can happen either at the:
  1652. * - end of template as in the case of coming across additional styling instruction in the template
  1653. * - in front of the template in the case of coming across additional instruction in the
  1654. * `hostBindings`.
  1655. *
  1656. * We use `TStylingRange` to store the previous and next index into the `TData` where the template
  1657. * bindings can be found.
  1658. *
  1659. * - bit 0 is used to mark that the previous index has a duplicate for current value.
  1660. * - bit 1 is used to mark that the next index has a duplicate for the current value.
  1661. * - bits 2-16 are used to encode the next/tail of the template.
  1662. * - bits 17-32 are used to encode the previous/head of template.
  1663. *
  1664. * NODE: *duplicate* false implies that it is statically known that this binding will not collide
  1665. * with other bindings and therefore there is no need to check other bindings. For example the
  1666. * bindings in `<div [style.color]="exp" [style.width]="exp">` will never collide and will have
  1667. * their bits set accordingly. Previous duplicate means that we may need to check previous if the
  1668. * current binding is `null`. Next duplicate means that we may need to check next bindings if the
  1669. * current binding is not `null`.
  1670. *
  1671. * NOTE: `0` has special significance and represents `null` as in no additional pointer.
  1672. */
  1673. type TStylingRange = number & {
  1674. __brand__: 'TStylingRange';
  1675. };
  1676. /**
  1677. * A set of marker values to be used in the attributes arrays. These markers indicate that some
  1678. * items are not regular attributes and the processing should be adapted accordingly.
  1679. */
  1680. declare const enum AttributeMarker {
  1681. /**
  1682. * An implicit marker which indicates that the value in the array are of `attributeKey`,
  1683. * `attributeValue` format.
  1684. *
  1685. * NOTE: This is implicit as it is the type when no marker is present in array. We indicate that
  1686. * it should not be present at runtime by the negative number.
  1687. */
  1688. ImplicitAttributes = -1,
  1689. /**
  1690. * Marker indicates that the following 3 values in the attributes array are:
  1691. * namespaceUri, attributeName, attributeValue
  1692. * in that order.
  1693. */
  1694. NamespaceURI = 0,
  1695. /**
  1696. * Signals class declaration.
  1697. *
  1698. * Each value following `Classes` designates a class name to include on the element.
  1699. * ## Example:
  1700. *
  1701. * Given:
  1702. * ```html
  1703. * <div class="foo bar baz">...</div>
  1704. * ```
  1705. *
  1706. * the generated code is:
  1707. * ```ts
  1708. * var _c1 = [AttributeMarker.Classes, 'foo', 'bar', 'baz'];
  1709. * ```
  1710. */
  1711. Classes = 1,
  1712. /**
  1713. * Signals style declaration.
  1714. *
  1715. * Each pair of values following `Styles` designates a style name and value to include on the
  1716. * element.
  1717. * ## Example:
  1718. *
  1719. * Given:
  1720. * ```html
  1721. * <div style="width:100px; height:200px; color:red">...</div>
  1722. * ```
  1723. *
  1724. * the generated code is:
  1725. * ```ts
  1726. * var _c1 = [AttributeMarker.Styles, 'width', '100px', 'height'. '200px', 'color', 'red'];
  1727. * ```
  1728. */
  1729. Styles = 2,
  1730. /**
  1731. * Signals that the following attribute names were extracted from input or output bindings.
  1732. *
  1733. * For example, given the following HTML:
  1734. *
  1735. * ```html
  1736. * <div moo="car" [foo]="exp" (bar)="doSth()">
  1737. * ```
  1738. *
  1739. * the generated code is:
  1740. *
  1741. * ```ts
  1742. * var _c1 = ['moo', 'car', AttributeMarker.Bindings, 'foo', 'bar'];
  1743. * ```
  1744. */
  1745. Bindings = 3,
  1746. /**
  1747. * Signals that the following attribute names were hoisted from an inline-template declaration.
  1748. *
  1749. * For example, given the following HTML:
  1750. *
  1751. * ```html
  1752. * <div *ngFor="let value of values; trackBy:trackBy" dirA [dirB]="value">
  1753. * ```
  1754. *
  1755. * the generated code for the `template()` instruction would include:
  1756. *
  1757. * ```
  1758. * ['dirA', '', AttributeMarker.Bindings, 'dirB', AttributeMarker.Template, 'ngFor', 'ngForOf',
  1759. * 'ngForTrackBy', 'let-value']
  1760. * ```
  1761. *
  1762. * while the generated code for the `element()` instruction inside the template function would
  1763. * include:
  1764. *
  1765. * ```
  1766. * ['dirA', '', AttributeMarker.Bindings, 'dirB']
  1767. * ```
  1768. */
  1769. Template = 4,
  1770. /**
  1771. * Signals that the following attribute is `ngProjectAs` and its value is a parsed
  1772. * `CssSelector`.
  1773. *
  1774. * For example, given the following HTML:
  1775. *
  1776. * ```html
  1777. * <h1 attr="value" ngProjectAs="[title]">
  1778. * ```
  1779. *
  1780. * the generated code for the `element()` instruction would include:
  1781. *
  1782. * ```ts
  1783. * ['attr', 'value', AttributeMarker.ProjectAs, ['', 'title', '']]
  1784. * ```
  1785. */
  1786. ProjectAs = 5,
  1787. /**
  1788. * Signals that the following attribute will be translated by runtime i18n
  1789. *
  1790. * For example, given the following HTML:
  1791. *
  1792. * ```html
  1793. * <div moo="car" foo="value" i18n-foo [bar]="binding" i18n-bar>
  1794. * ```
  1795. *
  1796. * the generated code is:
  1797. *
  1798. * ```ts
  1799. * var _c1 = ['moo', 'car', AttributeMarker.I18n, 'foo', 'bar'];
  1800. * ```
  1801. */
  1802. I18n = 6
  1803. }
  1804. /**
  1805. * Expresses a single CSS Selector.
  1806. *
  1807. * Beginning of array
  1808. * - First index: element name
  1809. * - Subsequent odd indices: attr keys
  1810. * - Subsequent even indices: attr values
  1811. *
  1812. * After SelectorFlags.CLASS flag
  1813. * - Class name values
  1814. *
  1815. * SelectorFlags.NOT flag
  1816. * - Changes the mode to NOT
  1817. * - Can be combined with other flags to set the element / attr / class mode
  1818. *
  1819. * e.g. SelectorFlags.NOT | SelectorFlags.ELEMENT
  1820. *
  1821. * Example:
  1822. * Original: `div.foo.bar[attr1=val1][attr2]`
  1823. * Parsed: ['div', 'attr1', 'val1', 'attr2', '', SelectorFlags.CLASS, 'foo', 'bar']
  1824. *
  1825. * Original: 'div[attr1]:not(.foo[attr2])
  1826. * Parsed: [
  1827. * 'div', 'attr1', '',
  1828. * SelectorFlags.NOT | SelectorFlags.ATTRIBUTE 'attr2', '', SelectorFlags.CLASS, 'foo'
  1829. * ]
  1830. *
  1831. * See more examples in node_selector_matcher_spec.ts
  1832. */
  1833. type CssSelector = (string | SelectorFlags)[];
  1834. /**
  1835. * A list of CssSelectors.
  1836. *
  1837. * A directive or component can have multiple selectors. This type is used for
  1838. * directive defs so any of the selectors in the list will match that directive.
  1839. *
  1840. * Original: 'form, [ngForm]'
  1841. * Parsed: [['form'], ['', 'ngForm', '']]
  1842. */
  1843. type CssSelectorList = CssSelector[];
  1844. /**
  1845. * List of slots for a projection. A slot can be either based on a parsed CSS selector
  1846. * which will be used to determine nodes which are projected into that slot.
  1847. *
  1848. * When set to "*", the slot is reserved and can be used for multi-slot projection
  1849. * using {@link ViewContainerRef#createComponent}. The last slot that specifies the
  1850. * wildcard selector will retrieve all projectable nodes which do not match any selector.
  1851. */
  1852. type ProjectionSlots = (CssSelectorList | '*')[];
  1853. /** Flags used to build up CssSelectors */
  1854. declare const enum SelectorFlags {
  1855. /** Indicates this is the beginning of a new negative selector */
  1856. NOT = 1,
  1857. /** Mode for matching attributes */
  1858. ATTRIBUTE = 2,
  1859. /** Mode for matching tag names */
  1860. ELEMENT = 4,
  1861. /** Mode for matching class names */
  1862. CLASS = 8
  1863. }
  1864. /**
  1865. * TNodeType corresponds to the {@link TNode} `type` property.
  1866. *
  1867. * NOTE: type IDs are such that we use each bit to denote a type. This is done so that we can easily
  1868. * check if the `TNode` is of more than one type.
  1869. *
  1870. * `if (tNode.type === TNodeType.Text || tNode.type === TNode.Element)`
  1871. * can be written as:
  1872. * `if (tNode.type & (TNodeType.Text | TNodeType.Element))`
  1873. *
  1874. * However any given `TNode` can only be of one type.
  1875. */
  1876. declare const enum TNodeType {
  1877. /**
  1878. * The TNode contains information about a DOM element aka {@link RText}.
  1879. */
  1880. Text = 1,
  1881. /**
  1882. * The TNode contains information about a DOM element aka {@link RElement}.
  1883. */
  1884. Element = 2,
  1885. /**
  1886. * The TNode contains information about an {@link LContainer} for embedded views.
  1887. */
  1888. Container = 4,
  1889. /**
  1890. * The TNode contains information about an `<ng-container>` element {@link RNode}.
  1891. */
  1892. ElementContainer = 8,
  1893. /**
  1894. * The TNode contains information about an `<ng-content>` projection
  1895. */
  1896. Projection = 16,
  1897. /**
  1898. * The TNode contains information about an ICU comment used in `i18n`.
  1899. */
  1900. Icu = 32,
  1901. /**
  1902. * Special node type representing a placeholder for future `TNode` at this location.
  1903. *
  1904. * I18n translation blocks are created before the element nodes which they contain. (I18n blocks
  1905. * can span over many elements.) Because i18n `TNode`s (representing text) are created first they
  1906. * often may need to point to element `TNode`s which are not yet created. In such a case we create
  1907. * a `Placeholder` `TNode`. This allows the i18n to structurally link the `TNode`s together
  1908. * without knowing any information about the future nodes which will be at that location.
  1909. *
  1910. * On `firstCreatePass` When element instruction executes it will try to create a `TNode` at that
  1911. * location. Seeing a `Placeholder` `TNode` already there tells the system that it should reuse
  1912. * existing `TNode` (rather than create a new one) and just update the missing information.
  1913. */
  1914. Placeholder = 64,
  1915. /**
  1916. * The TNode contains information about a `@let` declaration.
  1917. */
  1918. LetDeclaration = 128,
  1919. AnyRNode = 3,// Text | Element
  1920. AnyContainer = 12
  1921. }
  1922. /**
  1923. * Corresponds to the TNode.flags property.
  1924. */
  1925. declare const enum TNodeFlags {
  1926. /** Bit #1 - This bit is set if the node is a host for any directive (including a component) */
  1927. isDirectiveHost = 1,
  1928. /** Bit #2 - This bit is set if the node has been projected */
  1929. isProjected = 2,
  1930. /** Bit #3 - This bit is set if any directive on this node has content queries */
  1931. hasContentQuery = 4,
  1932. /** Bit #4 - This bit is set if the node has any "class" inputs */
  1933. hasClassInput = 8,
  1934. /** Bit #5 - This bit is set if the node has any "style" inputs */
  1935. hasStyleInput = 16,
  1936. /** Bit #6 - This bit is set if the node has been detached by i18n */
  1937. isDetached = 32,
  1938. /**
  1939. * Bit #7 - This bit is set if the node has directives with host bindings.
  1940. *
  1941. * This flags allows us to guard host-binding logic and invoke it only on nodes
  1942. * that actually have directives with host bindings.
  1943. */
  1944. hasHostBindings = 64,
  1945. /**
  1946. * Bit #8 - This bit is set if the node is a located inside skip hydration block.
  1947. */
  1948. inSkipHydrationBlock = 128
  1949. }
  1950. /**
  1951. * Corresponds to the TNode.providerIndexes property.
  1952. */
  1953. declare const enum TNodeProviderIndexes {
  1954. /** The index of the first provider on this node is encoded on the least significant bits. */
  1955. ProvidersStartIndexMask = 1048575,
  1956. /**
  1957. * The count of view providers from the component on this node is
  1958. * encoded on the 20 most significant bits.
  1959. */
  1960. CptViewProvidersCountShift = 20,
  1961. CptViewProvidersCountShifter = 1048576
  1962. }
  1963. /**
  1964. * A combination of:
  1965. * - Attribute names and values.
  1966. * - Special markers acting as flags to alter attributes processing.
  1967. * - Parsed ngProjectAs selectors.
  1968. */
  1969. type TAttributes = (string | AttributeMarker | CssSelector)[];
  1970. /**
  1971. * Constants that are associated with a view. Includes:
  1972. * - Attribute arrays.
  1973. * - Local definition arrays.
  1974. * - Translated messages (i18n).
  1975. */
  1976. type TConstants = (TAttributes | string)[];
  1977. /**
  1978. * Factory function that returns an array of consts. Consts can be represented as a function in
  1979. * case any additional statements are required to define consts in the list. An example is i18n
  1980. * where additional i18n calls are generated, which should be executed when consts are requested
  1981. * for the first time.
  1982. */
  1983. type TConstantsFactory = () => TConstants;
  1984. /**
  1985. * TConstants type that describes how the `consts` field is generated on ComponentDef: it can be
  1986. * either an array or a factory function that returns that array.
  1987. */
  1988. type TConstantsOrFactory = TConstants | TConstantsFactory;
  1989. /**
  1990. * Binding data (flyweight) for a particular node that is shared between all templates
  1991. * of a specific type.
  1992. *
  1993. * If a property is:
  1994. * - PropertyAliases: that property's data was generated and this is it
  1995. * - Null: that property's data was already generated and nothing was found.
  1996. * - Undefined: that property's data has not yet been generated
  1997. *
  1998. * see: https://en.wikipedia.org/wiki/Flyweight_pattern for more on the Flyweight pattern
  1999. */
  2000. interface TNode {
  2001. /** The type of the TNode. See TNodeType. */
  2002. type: TNodeType;
  2003. /**
  2004. * Index of the TNode in TView.data and corresponding native element in LView.
  2005. *
  2006. * This is necessary to get from any TNode to its corresponding native element when
  2007. * traversing the node tree.
  2008. *
  2009. * If index is -1, this is a dynamically created container node or embedded view node.
  2010. */
  2011. index: number;
  2012. /**
  2013. * Insert before existing DOM node index.
  2014. *
  2015. * When DOM nodes are being inserted, normally they are being appended as they are created.
  2016. * Under i18n case, the translated text nodes are created ahead of time as part of the
  2017. * `ɵɵi18nStart` instruction which means that this `TNode` can't just be appended and instead
  2018. * needs to be inserted using `insertBeforeIndex` semantics.
  2019. *
  2020. * Additionally sometimes it is necessary to insert new text nodes as a child of this `TNode`. In
  2021. * such a case the value stores an array of text nodes to insert.
  2022. *
  2023. * Example:
  2024. * ```html
  2025. * <div i18n>
  2026. * Hello <span>World</span>!
  2027. * </div>
  2028. * ```
  2029. * In the above example the `ɵɵi18nStart` instruction can create `Hello `, `World` and `!` text
  2030. * nodes. It can also insert `Hello ` and `!` text node as a child of `<div>`, but it can't
  2031. * insert `World` because the `<span>` node has not yet been created. In such a case the
  2032. * `<span>` `TNode` will have an array which will direct the `<span>` to not only insert
  2033. * itself in front of `!` but also to insert the `World` (created by `ɵɵi18nStart`) into
  2034. * `<span>` itself.
  2035. *
  2036. * Pseudo code:
  2037. * ```ts
  2038. * if (insertBeforeIndex === null) {
  2039. * // append as normal
  2040. * } else if (Array.isArray(insertBeforeIndex)) {
  2041. * // First insert current `TNode` at correct location
  2042. * const currentNode = lView[this.index];
  2043. * parentNode.insertBefore(currentNode, lView[this.insertBeforeIndex[0]]);
  2044. * // Now append all of the children
  2045. * for(let i=1; i<this.insertBeforeIndex; i++) {
  2046. * currentNode.appendChild(lView[this.insertBeforeIndex[i]]);
  2047. * }
  2048. * } else {
  2049. * parentNode.insertBefore(lView[this.index], lView[this.insertBeforeIndex])
  2050. * }
  2051. * ```
  2052. * - null: Append as normal using `parentNode.appendChild`
  2053. * - `number`: Append using
  2054. * `parentNode.insertBefore(lView[this.index], lView[this.insertBeforeIndex])`
  2055. *
  2056. * *Initialization*
  2057. *
  2058. * Because `ɵɵi18nStart` executes before nodes are created, on `TView.firstCreatePass` it is not
  2059. * possible for `ɵɵi18nStart` to set the `insertBeforeIndex` value as the corresponding `TNode`
  2060. * has not yet been created. For this reason the `ɵɵi18nStart` creates a `TNodeType.Placeholder`
  2061. * `TNode` at that location. See `TNodeType.Placeholder` for more information.
  2062. */
  2063. insertBeforeIndex: InsertBeforeIndex;
  2064. /**
  2065. * The index of the closest injector in this node's LView.
  2066. *
  2067. * If the index === -1, there is no injector on this node or any ancestor node in this view.
  2068. *
  2069. * If the index !== -1, it is the index of this node's injector OR the index of a parent
  2070. * injector in the same view. We pass the parent injector index down the node tree of a view so
  2071. * it's possible to find the parent injector without walking a potentially deep node tree.
  2072. * Injector indices are not set across view boundaries because there could be multiple component
  2073. * hosts.
  2074. *
  2075. * If tNode.injectorIndex === tNode.parent.injectorIndex, then the index belongs to a parent
  2076. * injector.
  2077. */
  2078. injectorIndex: number;
  2079. /** Stores starting index of the directives. */
  2080. directiveStart: number;
  2081. /**
  2082. * Stores final exclusive index of the directives.
  2083. *
  2084. * The area right behind the `directiveStart-directiveEnd` range is used to allocate the
  2085. * `HostBindingFunction` `vars` (or null if no bindings.) Therefore `directiveEnd` is used to set
  2086. * `LFrame.bindingRootIndex` before `HostBindingFunction` is executed.
  2087. */
  2088. directiveEnd: number;
  2089. /**
  2090. * Offset from the `directiveStart` at which the component (one at most) of the node is stored.
  2091. * Set to -1 if no components have been applied to the node. Component index can be found using
  2092. * `directiveStart + componentOffset`.
  2093. */
  2094. componentOffset: number;
  2095. /**
  2096. * Stores the last directive which had a styling instruction.
  2097. *
  2098. * Initial value of this is `-1` which means that no `hostBindings` styling instruction has
  2099. * executed. As `hostBindings` instructions execute they set the value to the index of the
  2100. * `DirectiveDef` which contained the last `hostBindings` styling instruction.
  2101. *
  2102. * Valid values are:
  2103. * - `-1` No `hostBindings` instruction has executed.
  2104. * - `directiveStart <= directiveStylingLast < directiveEnd`: Points to the `DirectiveDef` of
  2105. * the last styling instruction which executed in the `hostBindings`.
  2106. *
  2107. * This data is needed so that styling instructions know which static styling data needs to be
  2108. * collected from the `DirectiveDef.hostAttrs`. A styling instruction needs to collect all data
  2109. * since last styling instruction.
  2110. */
  2111. directiveStylingLast: number;
  2112. /**
  2113. * Stores indexes of property bindings. This field is only set in the ngDevMode and holds
  2114. * indexes of property bindings so TestBed can get bound property metadata for a given node.
  2115. */
  2116. propertyBindings: number[] | null;
  2117. /**
  2118. * Stores if Node isComponent, isProjected, hasContentQuery, hasClassInput and hasStyleInput
  2119. * etc.
  2120. */
  2121. flags: TNodeFlags;
  2122. /**
  2123. * This number stores two values using its bits:
  2124. *
  2125. * - the index of the first provider on that node (first 16 bits)
  2126. * - the count of view providers from the component on this node (last 16 bits)
  2127. */
  2128. providerIndexes: TNodeProviderIndexes;
  2129. /**
  2130. * The value name associated with this node.
  2131. * if type:
  2132. * `TNodeType.Text`: text value
  2133. * `TNodeType.Element`: tag name
  2134. * `TNodeType.ICUContainer`: `TIcu`
  2135. */
  2136. value: any;
  2137. /**
  2138. * Attributes associated with an element. We need to store attributes to support various
  2139. * use-cases (attribute injection, content projection with selectors, directives matching).
  2140. * Attributes are stored statically because reading them from the DOM would be way too slow for
  2141. * content projection and queries.
  2142. *
  2143. * Since attrs will always be calculated first, they will never need to be marked undefined by
  2144. * other instructions.
  2145. *
  2146. * For regular attributes a name of an attribute and its value alternate in the array.
  2147. * e.g. ['role', 'checkbox']
  2148. * This array can contain flags that will indicate "special attributes" (attributes with
  2149. * namespaces, attributes extracted from bindings and outputs).
  2150. */
  2151. attrs: TAttributes | null;
  2152. /**
  2153. * Same as `TNode.attrs` but contains merged data across all directive host bindings.
  2154. *
  2155. * We need to keep `attrs` as unmerged so that it can be used for attribute selectors.
  2156. * We merge attrs here so that it can be used in a performant way for initial rendering.
  2157. *
  2158. * The `attrs` are merged in first pass in following order:
  2159. * - Component's `hostAttrs`
  2160. * - Directives' `hostAttrs`
  2161. * - Template `TNode.attrs` associated with the current `TNode`.
  2162. */
  2163. mergedAttrs: TAttributes | null;
  2164. /**
  2165. * A set of local names under which a given element is exported in a template and
  2166. * visible to queries. An entry in this array can be created for different reasons:
  2167. * - an element itself is referenced, ex.: `<div #foo>`
  2168. * - a component is referenced, ex.: `<my-cmpt #foo>`
  2169. * - a directive is referenced, ex.: `<my-cmpt #foo="directiveExportAs">`.
  2170. *
  2171. * A given element might have different local names and those names can be associated
  2172. * with a directive. We store local names at even indexes while odd indexes are reserved
  2173. * for directive index in a view (or `-1` if there is no associated directive).
  2174. *
  2175. * Some examples:
  2176. * - `<div #foo>` => `["foo", -1]`
  2177. * - `<my-cmpt #foo>` => `["foo", myCmptIdx]`
  2178. * - `<my-cmpt #foo #bar="directiveExportAs">` => `["foo", myCmptIdx, "bar", directiveIdx]`
  2179. * - `<div #foo #bar="directiveExportAs">` => `["foo", -1, "bar", directiveIdx]`
  2180. */
  2181. localNames: (string | number)[] | null;
  2182. /** Information about input properties that need to be set once from attribute data. */
  2183. initialInputs: InitialInputData | null;
  2184. /**
  2185. * Input data for all directives on this node. `null` means that there are no directives with
  2186. * inputs on this node.
  2187. */
  2188. inputs: NodeInputBindings | null;
  2189. /**
  2190. * Input data for host directives applied to the node.
  2191. */
  2192. hostDirectiveInputs: HostDirectiveInputs | null;
  2193. /**
  2194. * Output data for all directives on this node. `null` means that there are no directives with
  2195. * outputs on this node.
  2196. */
  2197. outputs: NodeOutputBindings | null;
  2198. /**
  2199. * Input data for host directives applied to the node.
  2200. */
  2201. hostDirectiveOutputs: HostDirectiveOutputs | null;
  2202. /**
  2203. * Mapping between directive classes applied to the node and their indexes.
  2204. */
  2205. directiveToIndex: DirectiveIndexMap | null;
  2206. /**
  2207. * The TView attached to this node.
  2208. *
  2209. * If this TNode corresponds to an LContainer with a template (e.g. structural
  2210. * directive), the template's TView will be stored here.
  2211. *
  2212. * If this TNode corresponds to an element, tView will be `null`.
  2213. */
  2214. tView: TView | null;
  2215. /**
  2216. * The next sibling node. Necessary so we can propagate through the root nodes of a view
  2217. * to insert them or remove them from the DOM.
  2218. */
  2219. next: TNode | null;
  2220. /**
  2221. * The previous sibling node.
  2222. * This simplifies operations when we need a pointer to the previous node.
  2223. */
  2224. prev: TNode | null;
  2225. /**
  2226. * The next projected sibling. Since in Angular content projection works on the node-by-node
  2227. * basis the act of projecting nodes might change nodes relationship at the insertion point
  2228. * (target view). At the same time we need to keep initial relationship between nodes as
  2229. * expressed in content view.
  2230. */
  2231. projectionNext: TNode | null;
  2232. /**
  2233. * First child of the current node.
  2234. *
  2235. * For component nodes, the child will always be a ContentChild (in same view).
  2236. * For embedded view nodes, the child will be in their child view.
  2237. */
  2238. child: TNode | null;
  2239. /**
  2240. * Parent node (in the same view only).
  2241. *
  2242. * We need a reference to a node's parent so we can append the node to its parent's native
  2243. * element at the appropriate time.
  2244. *
  2245. * If the parent would be in a different view (e.g. component host), this property will be null.
  2246. * It's important that we don't try to cross component boundaries when retrieving the parent
  2247. * because the parent will change (e.g. index, attrs) depending on where the component was
  2248. * used (and thus shouldn't be stored on TNode). In these cases, we retrieve the parent through
  2249. * LView.node instead (which will be instance-specific).
  2250. *
  2251. * If this is an inline view node (V), the parent will be its container.
  2252. */
  2253. parent: TElementNode | TContainerNode | null;
  2254. /**
  2255. * List of projected TNodes for a given component host element OR index into the said nodes.
  2256. *
  2257. * For easier discussion assume this example:
  2258. * `<parent>`'s view definition:
  2259. * ```html
  2260. * <child id="c1">content1</child>
  2261. * <child id="c2"><span>content2</span></child>
  2262. * ```
  2263. * `<child>`'s view definition:
  2264. * ```html
  2265. * <ng-content id="cont1"></ng-content>
  2266. * ```
  2267. *
  2268. * If `Array.isArray(projection)` then `TNode` is a host element:
  2269. * - `projection` stores the content nodes which are to be projected.
  2270. * - The nodes represent categories defined by the selector: For example:
  2271. * `<ng-content/><ng-content select="abc"/>` would represent the heads for `<ng-content/>`
  2272. * and `<ng-content select="abc"/>` respectively.
  2273. * - The nodes we store in `projection` are heads only, we used `.next` to get their
  2274. * siblings.
  2275. * - The nodes `.next` is sorted/rewritten as part of the projection setup.
  2276. * - `projection` size is equal to the number of projections `<ng-content>`. The size of
  2277. * `c1` will be `1` because `<child>` has only one `<ng-content>`.
  2278. * - we store `projection` with the host (`c1`, `c2`) rather than the `<ng-content>` (`cont1`)
  2279. * because the same component (`<child>`) can be used in multiple locations (`c1`, `c2`) and
  2280. * as a result have different set of nodes to project.
  2281. * - without `projection` it would be difficult to efficiently traverse nodes to be projected.
  2282. *
  2283. * If `typeof projection == 'number'` then `TNode` is a `<ng-content>` element:
  2284. * - `projection` is an index of the host's `projection`Nodes.
  2285. * - This would return the first head node to project:
  2286. * `getHost(currentTNode).projection[currentTNode.projection]`.
  2287. * - When projecting nodes the parent node retrieved may be a `<ng-content>` node, in which case
  2288. * the process is recursive in nature.
  2289. *
  2290. * If `projection` is of type `RNode[][]` than we have a collection of native nodes passed as
  2291. * projectable nodes during dynamic component creation.
  2292. */
  2293. projection: (TNode | RNode[])[] | number | null;
  2294. /**
  2295. * A collection of all `style` static values for an element (including from host).
  2296. *
  2297. * This field will be populated if and when:
  2298. *
  2299. * - There are one or more initial `style`s on an element (e.g. `<div style="width:200px;">`)
  2300. * - There are one or more initial `style`s on a directive/component host
  2301. * (e.g. `@Directive({host: {style: "width:200px;" } }`)
  2302. */
  2303. styles: string | null;
  2304. /**
  2305. * A collection of all `style` static values for an element excluding host sources.
  2306. *
  2307. * Populated when there are one or more initial `style`s on an element
  2308. * (e.g. `<div style="width:200px;">`)
  2309. * Must be stored separately from `tNode.styles` to facilitate setting directive
  2310. * inputs that shadow the `style` property. If we used `tNode.styles` as is for shadowed inputs,
  2311. * we would feed host styles back into directives as "inputs". If we used `tNode.attrs`, we
  2312. * would have to concatenate the attributes on every template pass. Instead, we process once on
  2313. * first create pass and store here.
  2314. */
  2315. stylesWithoutHost: string | null;
  2316. /**
  2317. * A `KeyValueArray` version of residual `styles`.
  2318. *
  2319. * When there are styling instructions than each instruction stores the static styling
  2320. * which is of lower priority than itself. This means that there may be a higher priority
  2321. * styling than the instruction.
  2322. *
  2323. * Imagine:
  2324. * ```angular-ts
  2325. * <div style="color: highest;" my-dir>
  2326. *
  2327. * @Directive({
  2328. * host: {
  2329. * style: 'color: lowest; ',
  2330. * '[styles.color]': 'exp' // ɵɵstyleProp('color', ctx.exp);
  2331. * }
  2332. * })
  2333. * ```
  2334. *
  2335. * In the above case:
  2336. * - `color: lowest` is stored with `ɵɵstyleProp('color', ctx.exp);` instruction
  2337. * - `color: highest` is the residual and is stored here.
  2338. *
  2339. * - `undefined': not initialized.
  2340. * - `null`: initialized but `styles` is `null`
  2341. * - `KeyValueArray`: parsed version of `styles`.
  2342. */
  2343. residualStyles: KeyValueArray<any> | undefined | null;
  2344. /**
  2345. * A collection of all class static values for an element (including from host).
  2346. *
  2347. * This field will be populated if and when:
  2348. *
  2349. * - There are one or more initial classes on an element (e.g. `<div class="one two three">`)
  2350. * - There are one or more initial classes on an directive/component host
  2351. * (e.g. `@Directive({host: {class: "SOME_CLASS" } }`)
  2352. */
  2353. classes: string | null;
  2354. /**
  2355. * A collection of all class static values for an element excluding host sources.
  2356. *
  2357. * Populated when there are one or more initial classes on an element
  2358. * (e.g. `<div class="SOME_CLASS">`)
  2359. * Must be stored separately from `tNode.classes` to facilitate setting directive
  2360. * inputs that shadow the `class` property. If we used `tNode.classes` as is for shadowed
  2361. * inputs, we would feed host classes back into directives as "inputs". If we used
  2362. * `tNode.attrs`, we would have to concatenate the attributes on every template pass. Instead,
  2363. * we process once on first create pass and store here.
  2364. */
  2365. classesWithoutHost: string | null;
  2366. /**
  2367. * A `KeyValueArray` version of residual `classes`.
  2368. *
  2369. * Same as `TNode.residualStyles` but for classes.
  2370. *
  2371. * - `undefined': not initialized.
  2372. * - `null`: initialized but `classes` is `null`
  2373. * - `KeyValueArray`: parsed version of `classes`.
  2374. */
  2375. residualClasses: KeyValueArray<any> | undefined | null;
  2376. /**
  2377. * Stores the head/tail index of the class bindings.
  2378. *
  2379. * - If no bindings, the head and tail will both be 0.
  2380. * - If there are template bindings, stores the head/tail of the class bindings in the template.
  2381. * - If no template bindings but there are host bindings, the head value will point to the last
  2382. * host binding for "class" (not the head of the linked list), tail will be 0.
  2383. *
  2384. * See: `style_binding_list.ts` for details.
  2385. *
  2386. * This is used by `insertTStylingBinding` to know where the next styling binding should be
  2387. * inserted so that they can be sorted in priority order.
  2388. */
  2389. classBindings: TStylingRange;
  2390. /**
  2391. * Stores the head/tail index of the class bindings.
  2392. *
  2393. * - If no bindings, the head and tail will both be 0.
  2394. * - If there are template bindings, stores the head/tail of the style bindings in the template.
  2395. * - If no template bindings but there are host bindings, the head value will point to the last
  2396. * host binding for "style" (not the head of the linked list), tail will be 0.
  2397. *
  2398. * See: `style_binding_list.ts` for details.
  2399. *
  2400. * This is used by `insertTStylingBinding` to know where the next styling binding should be
  2401. * inserted so that they can be sorted in priority order.
  2402. */
  2403. styleBindings: TStylingRange;
  2404. }
  2405. /**
  2406. * See `TNode.insertBeforeIndex`
  2407. */
  2408. type InsertBeforeIndex = null | number | number[];
  2409. /** Static data for an element */
  2410. interface TElementNode extends TNode {
  2411. /** Index in the data[] array */
  2412. index: number;
  2413. child: TElementNode | TTextNode | TElementContainerNode | TContainerNode | TProjectionNode | null;
  2414. /**
  2415. * Element nodes will have parents unless they are the first node of a component or
  2416. * embedded view (which means their parent is in a different view and must be
  2417. * retrieved using viewData[HOST_NODE]).
  2418. */
  2419. parent: TElementNode | TElementContainerNode | null;
  2420. tView: null;
  2421. /**
  2422. * If this is a component TNode with projection, this will be an array of projected
  2423. * TNodes or native nodes (see TNode.projection for more info). If it's a regular element node
  2424. * or a component without projection, it will be null.
  2425. */
  2426. projection: (TNode | RNode[])[] | null;
  2427. /**
  2428. * Stores TagName
  2429. */
  2430. value: string;
  2431. }
  2432. /** Static data for a text node */
  2433. interface TTextNode extends TNode {
  2434. /** Index in the data[] array */
  2435. index: number;
  2436. child: null;
  2437. /**
  2438. * Text nodes will have parents unless they are the first node of a component or
  2439. * embedded view (which means their parent is in a different view and must be
  2440. * retrieved using LView.node).
  2441. */
  2442. parent: TElementNode | TElementContainerNode | null;
  2443. tView: null;
  2444. projection: null;
  2445. }
  2446. /** Static data for an LContainer */
  2447. interface TContainerNode extends TNode {
  2448. /**
  2449. * Index in the data[] array.
  2450. *
  2451. * If it's -1, this is a dynamically created container node that isn't stored in
  2452. * data[] (e.g. when you inject ViewContainerRef) .
  2453. */
  2454. index: number;
  2455. child: null;
  2456. /**
  2457. * Container nodes will have parents unless:
  2458. *
  2459. * - They are the first node of a component or embedded view
  2460. * - They are dynamically created
  2461. */
  2462. parent: TElementNode | TElementContainerNode | null;
  2463. tView: TView | null;
  2464. projection: null;
  2465. value: null;
  2466. }
  2467. /** Static data for an <ng-container> */
  2468. interface TElementContainerNode extends TNode {
  2469. /** Index in the LView[] array. */
  2470. index: number;
  2471. child: TElementNode | TTextNode | TContainerNode | TElementContainerNode | TProjectionNode | null;
  2472. parent: TElementNode | TElementContainerNode | null;
  2473. tView: null;
  2474. projection: null;
  2475. }
  2476. /** Static data for an LProjectionNode */
  2477. interface TProjectionNode extends TNode {
  2478. /** Index in the data[] array */
  2479. child: null;
  2480. /**
  2481. * Projection nodes will have parents unless they are the first node of a component
  2482. * or embedded view (which means their parent is in a different view and must be
  2483. * retrieved using LView.node).
  2484. */
  2485. parent: TElementNode | TElementContainerNode | null;
  2486. tView: null;
  2487. /** Index of the projection node. (See TNode.projection for more info.) */
  2488. projection: number;
  2489. value: null;
  2490. }
  2491. /**
  2492. * Maps the public names of outputs available on a specific node to the index
  2493. * of the directive instance that defines the output, for example:
  2494. *
  2495. * ```
  2496. * {
  2497. * "publicName": [0, 5]
  2498. * }
  2499. * ```
  2500. */
  2501. type NodeOutputBindings = Record<string, number[]>;
  2502. /**
  2503. * Maps the public names of inputs applied to a specific node to the index of the
  2504. * directive instance to which the input value should be written, for example:
  2505. *
  2506. * ```
  2507. * {
  2508. * "publicName": [0, 5]
  2509. * }
  2510. * ```
  2511. */
  2512. type NodeInputBindings = Record<string, number[]>;
  2513. /**
  2514. * This array contains information about input properties that
  2515. * need to be set once from attribute data. It's ordered by
  2516. * directive index (relative to element) so it's simple to
  2517. * look up a specific directive's initial input data.
  2518. *
  2519. * Within each sub-array:
  2520. *
  2521. * i+0: public name
  2522. * i+1: initial value
  2523. *
  2524. * If a directive on a node does not have any input properties
  2525. * that should be set from attributes, its index is set to null
  2526. * to avoid a sparse array.
  2527. *
  2528. * e.g. [null, ['role-min', 'minified-input', 'button']]
  2529. */
  2530. type InitialInputData = (InitialInputs | null)[];
  2531. /**
  2532. * Used by InitialInputData to store input properties
  2533. * that should be set once from attributes.
  2534. *
  2535. * i+0: attribute name
  2536. * i+1: minified/internal input name
  2537. * i+2: input flags
  2538. * i+3: initial value
  2539. *
  2540. * e.g. ['role-min', 'minified-input', 'button']
  2541. */
  2542. type InitialInputs = string[];
  2543. /**
  2544. * Represents inputs coming from a host directive and exposed on a TNode.
  2545. *
  2546. * - The key is the public name of an input as it is exposed on the specific node.
  2547. * - The value is an array where:
  2548. * - i+0: Index of the host directive that should be written to.
  2549. * - i+1: Public name of the input as it was defined on the host directive before aliasing.
  2550. */
  2551. type HostDirectiveInputs = Record<string, (number | string)[]>;
  2552. /**
  2553. * Represents outputs coming from a host directive and exposed on a TNode.
  2554. *
  2555. * - The key is the public name of an output as it is exposed on the specific node.
  2556. * - The value is an array where:
  2557. * - i+0: Index of the host directive on which the output is defined..
  2558. * - i+1: Public name of the output as it was defined on the host directive before aliasing.
  2559. */
  2560. type HostDirectiveOutputs = Record<string, (number | string)[]>;
  2561. /**
  2562. * Represents a map between a class reference and the index at which its directive is available on
  2563. * a specific TNode. The value can be either:
  2564. * 1. A number means that there's only one selector-matched directive on the node and it
  2565. * doesn't have any host directives.
  2566. * 2. An array means that there's a selector-matched directive and it has host directives.
  2567. * The array is structured as follows:
  2568. * - 0: Index of the selector-matched directive.
  2569. * - 1: Start index of the range within which the host directives are defined.
  2570. * - 2: End of the host directive range.
  2571. *
  2572. * Example:
  2573. * ```
  2574. * Map {
  2575. * [NoHostDirectives]: 5,
  2576. * [HasHostDirectives]: [10, 6, 8],
  2577. * }
  2578. * ```
  2579. */
  2580. type DirectiveIndexMap = Map<Type$1<unknown>, number | [directiveIndex: number, hostDirectivesStart: number, hostDirectivesEnd: number]>;
  2581. /**
  2582. * Type representing a set of TNodes that can have local refs (`#foo`) placed on them.
  2583. */
  2584. type TNodeWithLocalRefs = TContainerNode | TElementNode | TElementContainerNode;
  2585. /**
  2586. * Type for a function that extracts a value for a local refs.
  2587. * Example:
  2588. * - `<div #nativeDivEl>` - `nativeDivEl` should point to the native `<div>` element;
  2589. * - `<ng-template #tplRef>` - `tplRef` should point to the `TemplateRef` instance;
  2590. */
  2591. type LocalRefExtractor = (tNode: TNodeWithLocalRefs, currentView: LView) => any;
  2592. /**
  2593. * Special location which allows easy identification of type. If we have an array which was
  2594. * retrieved from the `LView` and that array has `true` at `TYPE` location, we know it is
  2595. * `LContainer`.
  2596. */
  2597. declare const TYPE = 1;
  2598. /**
  2599. * Below are constants for LContainer indices to help us look up LContainer members
  2600. * without having to remember the specific indices.
  2601. * Uglify will inline these when minifying so there shouldn't be a cost.
  2602. */
  2603. declare const DEHYDRATED_VIEWS = 6;
  2604. declare const NATIVE = 7;
  2605. declare const VIEW_REFS = 8;
  2606. declare const MOVED_VIEWS = 9;
  2607. /**
  2608. * Size of LContainer's header. Represents the index after which all views in the
  2609. * container will be inserted. We need to keep a record of current views so we know
  2610. * which views are already in the DOM (and don't need to be re-added) and so we can
  2611. * remove views from the DOM when they are no longer required.
  2612. */
  2613. declare const CONTAINER_HEADER_OFFSET = 10;
  2614. /**
  2615. * The state associated with a container.
  2616. *
  2617. * This is an array so that its structure is closer to LView. This helps
  2618. * when traversing the view tree (which is a mix of containers and component
  2619. * views), so we can jump to viewOrContainer[NEXT] in the same way regardless
  2620. * of type.
  2621. */
  2622. interface LContainer extends Array<any> {
  2623. /**
  2624. * The host element of this LContainer.
  2625. *
  2626. * The host could be an LView if this container is on a component node.
  2627. * In that case, the component LView is its HOST.
  2628. */
  2629. readonly [HOST]: RElement | RComment | LView;
  2630. /**
  2631. * This is a type field which allows us to differentiate `LContainer` from `StylingContext` in an
  2632. * efficient way. The value is always set to `true`
  2633. */
  2634. [TYPE]: true;
  2635. /** Flags for this container. See LContainerFlags for more info. */
  2636. [FLAGS]: LContainerFlags;
  2637. /**
  2638. * Access to the parent view is necessary so we can propagate back
  2639. * up from inside a container to parent[NEXT].
  2640. */
  2641. [PARENT]: LView;
  2642. /**
  2643. * This allows us to jump from a container to a sibling container or component
  2644. * view with the same parent, so we can remove listeners efficiently.
  2645. */
  2646. [NEXT]: LView | LContainer | null;
  2647. /**
  2648. * A collection of views created based on the underlying `<ng-template>` element but inserted into
  2649. * a different `LContainer`. We need to track views created from a given declaration point since
  2650. * queries collect matches from the embedded view declaration point and _not_ the insertion point.
  2651. */
  2652. [MOVED_VIEWS]: LView[] | null;
  2653. /**
  2654. * Pointer to the `TNode` which represents the host of the container.
  2655. */
  2656. [T_HOST]: TNode;
  2657. /** The comment element that serves as an anchor for this LContainer. */
  2658. [NATIVE]: RComment;
  2659. /**
  2660. * Array of `ViewRef`s used by any `ViewContainerRef`s that point to this container.
  2661. *
  2662. * This is lazily initialized by `ViewContainerRef` when the first view is inserted.
  2663. *
  2664. * NOTE: This is stored as `any[]` because render3 should really not be aware of `ViewRef` and
  2665. * doing so creates circular dependency.
  2666. */
  2667. [VIEW_REFS]: unknown[] | null;
  2668. /**
  2669. * Array of dehydrated views within this container.
  2670. *
  2671. * This information is used during the hydration process on the client.
  2672. * The hydration logic tries to find a matching dehydrated view, "claim" it
  2673. * and use this information to do further matching. After that, this "claimed"
  2674. * view is removed from the list. The remaining "unclaimed" views are
  2675. * "garbage-collected" later on, i.e. removed from the DOM once the hydration
  2676. * logic finishes.
  2677. */
  2678. [DEHYDRATED_VIEWS]: DehydratedContainerView[] | null;
  2679. }
  2680. /** Flags associated with an LContainer (saved in LContainer[FLAGS]) */
  2681. declare const enum LContainerFlags {
  2682. None = 0,
  2683. /**
  2684. * Flag to signify that this `LContainer` may have transplanted views which need to be change
  2685. * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`.
  2686. *
  2687. * This flag, once set, is never unset for the `LContainer`.
  2688. */
  2689. HasTransplantedViews = 2
  2690. }
  2691. /**
  2692. * Injection flags for DI.
  2693. *
  2694. * @publicApi
  2695. * @deprecated use an options object for [`inject`](api/core/inject) instead.
  2696. */
  2697. declare enum InjectFlags {
  2698. /** Check self and check parent injector if needed */
  2699. Default = 0,
  2700. /**
  2701. * Specifies that an injector should retrieve a dependency from any injector until reaching the
  2702. * host element of the current component. (Only used with Element Injector)
  2703. */
  2704. Host = 1,
  2705. /** Don't ascend to ancestors of the node requesting injection. */
  2706. Self = 2,
  2707. /** Skip the node that is requesting injection. */
  2708. SkipSelf = 4,
  2709. /** Inject `defaultValue` instead if token not found. */
  2710. Optional = 8
  2711. }
  2712. /**
  2713. * This enum is an exact copy of the `InjectFlags` enum above, but the difference is that this is a
  2714. * const enum, so actual enum values would be inlined in generated code. The `InjectFlags` enum can
  2715. * be turned into a const enum when ViewEngine is removed (see TODO at the `InjectFlags` enum
  2716. * above). The benefit of inlining is that we can use these flags at the top level without affecting
  2717. * tree-shaking (see "no-toplevel-property-access" tslint rule for more info).
  2718. * Keep this enum in sync with `InjectFlags` enum above.
  2719. */
  2720. declare const enum InternalInjectFlags {
  2721. /** Check self and check parent injector if needed */
  2722. Default = 0,
  2723. /**
  2724. * Specifies that an injector should retrieve a dependency from any injector until reaching the
  2725. * host element of the current component. (Only used with Element Injector)
  2726. */
  2727. Host = 1,
  2728. /** Don't ascend to ancestors of the node requesting injection. */
  2729. Self = 2,
  2730. /** Skip the node that is requesting injection. */
  2731. SkipSelf = 4,
  2732. /** Inject `defaultValue` instead if token not found. */
  2733. Optional = 8,
  2734. /**
  2735. * This token is being injected into a pipe.
  2736. *
  2737. * This flag is intentionally not in the public facing `InjectFlags` because it is only added by
  2738. * the compiler and is not a developer applicable flag.
  2739. */
  2740. ForPipe = 16
  2741. }
  2742. /**
  2743. * Type of the options argument to [`inject`](api/core/inject).
  2744. *
  2745. * @publicApi
  2746. */
  2747. interface InjectOptions {
  2748. /**
  2749. * Use optional injection, and return `null` if the requested token is not found.
  2750. */
  2751. optional?: boolean;
  2752. /**
  2753. * Start injection at the parent of the current injector.
  2754. */
  2755. skipSelf?: boolean;
  2756. /**
  2757. * Only query the current injector for the token, and don't fall back to the parent injector if
  2758. * it's not found.
  2759. */
  2760. self?: boolean;
  2761. /**
  2762. * Stop injection at the host component's injector. Only relevant when injecting from an element
  2763. * injector, and a no-op for environment injectors.
  2764. */
  2765. host?: boolean;
  2766. }
  2767. /**
  2768. * @description
  2769. *
  2770. * Token that can be used to retrieve an instance from an injector or through a query.
  2771. *
  2772. * @publicApi
  2773. */
  2774. type ProviderToken<T> = Type$1<T> | AbstractType<T> | InjectionToken<T>;
  2775. /**
  2776. * Concrete injectors implement this interface. Injectors are configured
  2777. * with [providers](guide/di/dependency-injection-providers) that associate
  2778. * dependencies of various types with [injection tokens](guide/di/dependency-injection-providers).
  2779. *
  2780. * @see [DI Providers](guide/di/dependency-injection-providers).
  2781. * @see {@link StaticProvider}
  2782. *
  2783. * @usageNotes
  2784. *
  2785. * The following example creates a service injector instance.
  2786. *
  2787. * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
  2788. *
  2789. * ### Usage example
  2790. *
  2791. * {@example core/di/ts/injector_spec.ts region='Injector'}
  2792. *
  2793. * `Injector` returns itself when given `Injector` as a token:
  2794. *
  2795. * {@example core/di/ts/injector_spec.ts region='injectInjector'}
  2796. *
  2797. * @publicApi
  2798. */
  2799. declare abstract class Injector {
  2800. static THROW_IF_NOT_FOUND: {};
  2801. static NULL: Injector;
  2802. /**
  2803. * Internal note on the `options?: InjectOptions|InjectFlags` override of the `get`
  2804. * method: consider dropping the `InjectFlags` part in one of the major versions.
  2805. * It can **not** be done in minor/patch, since it's breaking for custom injectors
  2806. * that only implement the old `InjectorFlags` interface.
  2807. */
  2808. /**
  2809. * Retrieves an instance from the injector based on the provided token.
  2810. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  2811. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  2812. */
  2813. abstract get<T>(token: ProviderToken<T>, notFoundValue: undefined, options: InjectOptions & {
  2814. optional?: false;
  2815. }): T;
  2816. /**
  2817. * Retrieves an instance from the injector based on the provided token.
  2818. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  2819. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  2820. */
  2821. abstract get<T>(token: ProviderToken<T>, notFoundValue: null | undefined, options: InjectOptions): T | null;
  2822. /**
  2823. * Retrieves an instance from the injector based on the provided token.
  2824. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  2825. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  2826. */
  2827. abstract get<T>(token: ProviderToken<T>, notFoundValue?: T, options?: InjectOptions | InjectFlags): T;
  2828. /**
  2829. * Retrieves an instance from the injector based on the provided token.
  2830. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  2831. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  2832. * @deprecated use object-based flags (`InjectOptions`) instead.
  2833. */
  2834. abstract get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): T;
  2835. /**
  2836. * @deprecated from v4.0.0 use ProviderToken<T>
  2837. * @suppress {duplicate}
  2838. */
  2839. abstract get(token: any, notFoundValue?: any): any;
  2840. /**
  2841. * @deprecated from v5 use the new signature Injector.create(options)
  2842. */
  2843. static create(providers: StaticProvider[], parent?: Injector): Injector;
  2844. /**
  2845. * Creates a new injector instance that provides one or more dependencies,
  2846. * according to a given type or types of `StaticProvider`.
  2847. *
  2848. * @param options An object with the following properties:
  2849. * * `providers`: An array of providers of the [StaticProvider type](api/core/StaticProvider).
  2850. * * `parent`: (optional) A parent injector.
  2851. * * `name`: (optional) A developer-defined identifying name for the new injector.
  2852. *
  2853. * @returns The new injector instance.
  2854. *
  2855. */
  2856. static create(options: {
  2857. providers: Array<Provider | StaticProvider>;
  2858. parent?: Injector;
  2859. name?: string;
  2860. }): Injector;
  2861. /** @nocollapse */
  2862. static ɵprov: unknown;
  2863. }
  2864. /**
  2865. * Information about how a type or `InjectionToken` interfaces with the DI system.
  2866. *
  2867. * At a minimum, this includes a `factory` which defines how to create the given type `T`, possibly
  2868. * requesting injection of other types if necessary.
  2869. *
  2870. * Optionally, a `providedIn` parameter specifies that the given type belongs to a particular
  2871. * `Injector`, `NgModule`, or a special scope (e.g. `'root'`). A value of `null` indicates
  2872. * that the injectable does not belong to any scope.
  2873. *
  2874. * @codeGenApi
  2875. * @publicApi The ViewEngine compiler emits code with this type for injectables. This code is
  2876. * deployed to npm, and should be treated as public api.
  2877. */
  2878. interface ɵɵInjectableDeclaration<T> {
  2879. /**
  2880. * Specifies that the given type belongs to a particular injector:
  2881. * - `InjectorType` such as `NgModule`,
  2882. * - `'root'` the root injector
  2883. * - `'any'` all injectors.
  2884. * - `null`, does not belong to any injector. Must be explicitly listed in the injector
  2885. * `providers`.
  2886. */
  2887. providedIn: InjectorType<any> | 'root' | 'platform' | 'any' | 'environment' | null;
  2888. /**
  2889. * The token to which this definition belongs.
  2890. *
  2891. * Note that this may not be the same as the type that the `factory` will create.
  2892. */
  2893. token: unknown;
  2894. /**
  2895. * Factory method to execute to create an instance of the injectable.
  2896. */
  2897. factory: (t?: Type$1<any>) => T;
  2898. /**
  2899. * In a case of no explicit injector, a location where the instance of the injectable is stored.
  2900. */
  2901. value: T | undefined;
  2902. }
  2903. /**
  2904. * Information about the providers to be included in an `Injector` as well as how the given type
  2905. * which carries the information should be created by the DI system.
  2906. *
  2907. * An `InjectorDef` can import other types which have `InjectorDefs`, forming a deep nested
  2908. * structure of providers with a defined priority (identically to how `NgModule`s also have
  2909. * an import/dependency structure).
  2910. *
  2911. * NOTE: This is a private type and should not be exported
  2912. *
  2913. * @codeGenApi
  2914. */
  2915. interface ɵɵInjectorDef<T> {
  2916. providers: (Type$1<any> | ValueProvider | ExistingProvider | FactoryProvider | ConstructorProvider | StaticClassProvider | ClassProvider | EnvironmentProviders | any[])[];
  2917. imports: (InjectorType<any> | InjectorTypeWithProviders<any>)[];
  2918. }
  2919. /**
  2920. * A `Type` which has a `ɵprov: ɵɵInjectableDeclaration` static field.
  2921. *
  2922. * `InjectableType`s contain their own Dependency Injection metadata and are usable in an
  2923. * `InjectorDef`-based `StaticInjector`.
  2924. *
  2925. * @publicApi
  2926. */
  2927. interface InjectableType<T> extends Type$1<T> {
  2928. /**
  2929. * Opaque type whose structure is highly version dependent. Do not rely on any properties.
  2930. */
  2931. ɵprov: unknown;
  2932. }
  2933. /**
  2934. * A type which has an `InjectorDef` static field.
  2935. *
  2936. * `InjectorTypes` can be used to configure a `StaticInjector`.
  2937. *
  2938. * This is an opaque type whose structure is highly version dependent. Do not rely on any
  2939. * properties.
  2940. *
  2941. * @publicApi
  2942. */
  2943. interface InjectorType<T> extends Type$1<T> {
  2944. ɵfac?: unknown;
  2945. ɵinj: unknown;
  2946. }
  2947. /**
  2948. * Describes the `InjectorDef` equivalent of a `ModuleWithProviders`, an `InjectorType` with an
  2949. * associated array of providers.
  2950. *
  2951. * Objects of this type can be listed in the imports section of an `InjectorDef`.
  2952. *
  2953. * NOTE: This is a private type and should not be exported
  2954. */
  2955. interface InjectorTypeWithProviders<T> {
  2956. ngModule: InjectorType<T>;
  2957. providers?: (Type$1<any> | ValueProvider | ExistingProvider | FactoryProvider | ConstructorProvider | StaticClassProvider | ClassProvider | EnvironmentProviders | any[])[];
  2958. }
  2959. /**
  2960. * Construct an injectable definition which defines how a token will be constructed by the DI
  2961. * system, and in which injectors (if any) it will be available.
  2962. *
  2963. * This should be assigned to a static `ɵprov` field on a type, which will then be an
  2964. * `InjectableType`.
  2965. *
  2966. * Options:
  2967. * * `providedIn` determines which injectors will include the injectable, by either associating it
  2968. * with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be
  2969. * provided in the `'root'` injector, which will be the application-level injector in most apps.
  2970. * * `factory` gives the zero argument function which will create an instance of the injectable.
  2971. * The factory can call [`inject`](api/core/inject) to access the `Injector` and request injection
  2972. * of dependencies.
  2973. *
  2974. * @codeGenApi
  2975. * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to npm.
  2976. */
  2977. declare function ɵɵdefineInjectable<T>(opts: {
  2978. token: unknown;
  2979. providedIn?: Type$1<any> | 'root' | 'platform' | 'any' | 'environment' | null;
  2980. factory: () => T;
  2981. }): unknown;
  2982. /**
  2983. * @deprecated in v8, delete after v10. This API should be used only by generated code, and that
  2984. * code should now use ɵɵdefineInjectable instead.
  2985. * @publicApi
  2986. */
  2987. declare const defineInjectable: typeof ɵɵdefineInjectable;
  2988. /**
  2989. * Construct an `InjectorDef` which configures an injector.
  2990. *
  2991. * This should be assigned to a static injector def (`ɵinj`) field on a type, which will then be an
  2992. * `InjectorType`.
  2993. *
  2994. * Options:
  2995. *
  2996. * * `providers`: an optional array of providers to add to the injector. Each provider must
  2997. * either have a factory or point to a type which has a `ɵprov` static property (the
  2998. * type must be an `InjectableType`).
  2999. * * `imports`: an optional array of imports of other `InjectorType`s or `InjectorTypeWithModule`s
  3000. * whose providers will also be added to the injector. Locally provided types will override
  3001. * providers from imports.
  3002. *
  3003. * @codeGenApi
  3004. */
  3005. declare function ɵɵdefineInjector(options: {
  3006. providers?: any[];
  3007. imports?: any[];
  3008. }): unknown;
  3009. /**
  3010. * Read the injectable def (`ɵprov`) for `type` in a way which is immune to accidentally reading
  3011. * inherited value.
  3012. *
  3013. * @param type A type which may have its own (non-inherited) `ɵprov`.
  3014. */
  3015. declare function getInjectableDef<T>(type: any): ɵɵInjectableDeclaration<T> | null;
  3016. declare function isInjectable(type: any): boolean;
  3017. declare const NG_PROV_DEF: string;
  3018. declare const NG_INJ_DEF: string;
  3019. /**
  3020. * Wrap an array of `Provider`s into `EnvironmentProviders`, preventing them from being accidentally
  3021. * referenced in `@Component` in a component injector.
  3022. *
  3023. * @publicApi
  3024. */
  3025. declare function makeEnvironmentProviders(providers: (Provider | EnvironmentProviders)[]): EnvironmentProviders;
  3026. /**
  3027. * @description
  3028. * This function is used to provide initialization functions that will be executed upon construction
  3029. * of an environment injector.
  3030. *
  3031. * Note that the provided initializer is run in the injection context.
  3032. *
  3033. * Previously, this was achieved using the `ENVIRONMENT_INITIALIZER` token which is now deprecated.
  3034. *
  3035. * @see {@link ENVIRONMENT_INITIALIZER}
  3036. *
  3037. * @usageNotes
  3038. * The following example illustrates how to configure an initialization function using
  3039. * `provideEnvironmentInitializer()`
  3040. * ```ts
  3041. * createEnvironmentInjector(
  3042. * [
  3043. * provideEnvironmentInitializer(() => {
  3044. * console.log('environment initialized');
  3045. * }),
  3046. * ],
  3047. * parentInjector
  3048. * );
  3049. * ```
  3050. *
  3051. * @publicApi
  3052. */
  3053. declare function provideEnvironmentInitializer(initializerFn: () => void): EnvironmentProviders;
  3054. /**
  3055. * A source of providers for the `importProvidersFrom` function.
  3056. *
  3057. * @publicApi
  3058. */
  3059. type ImportProvidersSource = Type$1<unknown> | ModuleWithProviders<unknown> | Array<ImportProvidersSource>;
  3060. /**
  3061. * Collects providers from all NgModules and standalone components, including transitively imported
  3062. * ones.
  3063. *
  3064. * Providers extracted via `importProvidersFrom` are only usable in an application injector or
  3065. * another environment injector (such as a route injector). They should not be used in component
  3066. * providers.
  3067. *
  3068. * More information about standalone components can be found in [this
  3069. * guide](guide/components/importing).
  3070. *
  3071. * @usageNotes
  3072. * The results of the `importProvidersFrom` call can be used in the `bootstrapApplication` call:
  3073. *
  3074. * ```ts
  3075. * await bootstrapApplication(RootComponent, {
  3076. * providers: [
  3077. * importProvidersFrom(NgModuleOne, NgModuleTwo)
  3078. * ]
  3079. * });
  3080. * ```
  3081. *
  3082. * You can also use the `importProvidersFrom` results in the `providers` field of a route, when a
  3083. * standalone component is used:
  3084. *
  3085. * ```ts
  3086. * export const ROUTES: Route[] = [
  3087. * {
  3088. * path: 'foo',
  3089. * providers: [
  3090. * importProvidersFrom(NgModuleOne, NgModuleTwo)
  3091. * ],
  3092. * component: YourStandaloneComponent
  3093. * }
  3094. * ];
  3095. * ```
  3096. *
  3097. * @returns Collected providers from the specified list of types.
  3098. * @publicApi
  3099. */
  3100. declare function importProvidersFrom(...sources: ImportProvidersSource[]): EnvironmentProviders;
  3101. /**
  3102. * Internal type for a single provider in a deep provider array.
  3103. */
  3104. type SingleProvider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | StaticClassProvider;
  3105. type InjectorScope = 'root' | 'platform' | 'environment';
  3106. /**
  3107. * An internal token whose presence in an injector indicates that the injector should treat itself
  3108. * as a root scoped injector when processing requests for unknown tokens which may indicate
  3109. * they are provided in the root scope.
  3110. */
  3111. declare const INJECTOR_SCOPE: InjectionToken<InjectorScope | null>;
  3112. /**
  3113. * An `Injector` that's part of the environment injector hierarchy, which exists outside of the
  3114. * component tree.
  3115. */
  3116. declare abstract class EnvironmentInjector implements Injector {
  3117. /**
  3118. * Retrieves an instance from the injector based on the provided token.
  3119. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  3120. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  3121. */
  3122. abstract get<T>(token: ProviderToken<T>, notFoundValue: undefined, options: InjectOptions & {
  3123. optional?: false;
  3124. }): T;
  3125. /**
  3126. * Retrieves an instance from the injector based on the provided token.
  3127. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  3128. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  3129. */
  3130. abstract get<T>(token: ProviderToken<T>, notFoundValue: null | undefined, options: InjectOptions): T | null;
  3131. /**
  3132. * Retrieves an instance from the injector based on the provided token.
  3133. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  3134. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  3135. */
  3136. abstract get<T>(token: ProviderToken<T>, notFoundValue?: T, options?: InjectOptions): T;
  3137. /**
  3138. * Retrieves an instance from the injector based on the provided token.
  3139. * @returns The instance from the injector if defined, otherwise the `notFoundValue`.
  3140. * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.
  3141. * @deprecated use object-based flags (`InjectOptions`) instead.
  3142. */
  3143. abstract get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): T;
  3144. /**
  3145. * @deprecated from v4.0.0 use ProviderToken<T>
  3146. * @suppress {duplicate}
  3147. */
  3148. abstract get(token: any, notFoundValue?: any): any;
  3149. /**
  3150. * Runs the given function in the context of this `EnvironmentInjector`.
  3151. *
  3152. * Within the function's stack frame, [`inject`](api/core/inject) can be used to inject
  3153. * dependencies from this injector. Note that `inject` is only usable synchronously, and cannot be
  3154. * used in any asynchronous callbacks or after any `await` points.
  3155. *
  3156. * @param fn the closure to be run in the context of this injector
  3157. * @returns the return value of the function, if any
  3158. * @deprecated use the standalone function `runInInjectionContext` instead
  3159. */
  3160. abstract runInContext<ReturnT>(fn: () => ReturnT): ReturnT;
  3161. abstract destroy(): void;
  3162. }
  3163. declare class R3Injector extends EnvironmentInjector implements Injector$1 {
  3164. readonly parent: Injector;
  3165. readonly source: string | null;
  3166. readonly scopes: Set<InjectorScope>;
  3167. /**
  3168. * Map of tokens to records which contain the instances of those tokens.
  3169. * - `null` value implies that we don't have the record. Used by tree-shakable injectors
  3170. * to prevent further searches.
  3171. */
  3172. private records;
  3173. /**
  3174. * Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.
  3175. */
  3176. private _ngOnDestroyHooks;
  3177. private _onDestroyHooks;
  3178. /**
  3179. * Flag indicating that this injector was previously destroyed.
  3180. */
  3181. get destroyed(): boolean;
  3182. private _destroyed;
  3183. private injectorDefTypes;
  3184. constructor(providers: Array<Provider | EnvironmentProviders>, parent: Injector, source: string | null, scopes: Set<InjectorScope>);
  3185. retrieve<T>(token: InjectionToken$1<T>, options?: unknown): T | NotFound;
  3186. /**
  3187. * Destroy the injector and release references to every instance or provider associated with it.
  3188. *
  3189. * Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a
  3190. * hook was found.
  3191. */
  3192. destroy(): void;
  3193. onDestroy(callback: () => void): () => void;
  3194. runInContext<ReturnT>(fn: () => ReturnT): ReturnT;
  3195. get<T>(token: ProviderToken<T>, notFoundValue?: any, flags?: InjectFlags | InjectOptions): T;
  3196. toString(): string;
  3197. /**
  3198. * Process a `SingleProvider` and add it.
  3199. */
  3200. private processProvider;
  3201. private hydrate;
  3202. private injectableDefInScope;
  3203. private removeOnDestroy;
  3204. }
  3205. /**
  3206. * A schema definition associated with a component or an NgModule.
  3207. *
  3208. * @see {@link NgModule}
  3209. * @see {@link CUSTOM_ELEMENTS_SCHEMA}
  3210. * @see {@link NO_ERRORS_SCHEMA}
  3211. *
  3212. * @param name The name of a defined schema.
  3213. *
  3214. * @publicApi
  3215. */
  3216. interface SchemaMetadata {
  3217. name: string;
  3218. }
  3219. /**
  3220. * Defines a schema that allows an NgModule to contain the following:
  3221. * - Non-Angular elements named with dash case (`-`).
  3222. * - Element properties named with dash case (`-`).
  3223. * Dash case is the naming convention for custom elements.
  3224. *
  3225. * @publicApi
  3226. */
  3227. declare const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata;
  3228. /**
  3229. * Defines a schema that allows any property on any element.
  3230. *
  3231. * This schema allows you to ignore the errors related to any unknown elements or properties in a
  3232. * template. The usage of this schema is generally discouraged because it prevents useful validation
  3233. * and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.
  3234. *
  3235. * @publicApi
  3236. */
  3237. declare const NO_ERRORS_SCHEMA: SchemaMetadata;
  3238. /**
  3239. * Defines the CSS styles encapsulation policies for the {@link /api/core/Component Component} decorator's
  3240. * `encapsulation` option.
  3241. *
  3242. * See {@link Component#encapsulation encapsulation}.
  3243. *
  3244. * @usageNotes
  3245. * ### Example
  3246. *
  3247. * {@example core/ts/metadata/encapsulation.ts region='longform'}
  3248. *
  3249. * @publicApi
  3250. */
  3251. declare enum ViewEncapsulation$1 {
  3252. /**
  3253. * Emulates a native Shadow DOM encapsulation behavior by adding a specific attribute to the
  3254. * component's host element and applying the same attribute to all the CSS selectors provided
  3255. * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls}.
  3256. *
  3257. * This is the default option.
  3258. */
  3259. Emulated = 0,
  3260. /**
  3261. * Doesn't provide any sort of CSS style encapsulation, meaning that all the styles provided
  3262. * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls} are applicable
  3263. * to any HTML element of the application regardless of their host Component.
  3264. */
  3265. None = 2,
  3266. /**
  3267. * Uses the browser's native Shadow DOM API to encapsulate CSS styles, meaning that it creates
  3268. * a ShadowRoot for the component's host element which is then used to encapsulate
  3269. * all the Component's styling.
  3270. */
  3271. ShadowDom = 3
  3272. }
  3273. /**
  3274. * Definition of what a factory function should look like.
  3275. */
  3276. type FactoryFn<T> = {
  3277. /**
  3278. * Subclasses without an explicit constructor call through to the factory of their base
  3279. * definition, providing it with their own constructor to instantiate.
  3280. */
  3281. <U extends T>(t?: Type$1<U>): U;
  3282. /**
  3283. * If no constructor to instantiate is provided, an instance of type T itself is created.
  3284. */
  3285. (t?: undefined): T;
  3286. };
  3287. /** Flags describing an input for a directive. */
  3288. declare enum InputFlags {
  3289. None = 0,
  3290. SignalBased = 1,
  3291. HasDecoratorInputTransform = 2
  3292. }
  3293. /**
  3294. * Definition of what a template rendering function should look like for a component.
  3295. */
  3296. type ComponentTemplate<T> = {
  3297. <U extends T>(rf: RenderFlags, ctx: T | U): void;
  3298. };
  3299. /**
  3300. * Definition of what a view queries function should look like.
  3301. */
  3302. type ViewQueriesFunction<T> = <U extends T>(rf: RenderFlags, ctx: U) => void;
  3303. /**
  3304. * Definition of what a content queries function should look like.
  3305. */
  3306. type ContentQueriesFunction<T> = <U extends T>(rf: RenderFlags, ctx: U, directiveIndex: number) => void;
  3307. interface ClassDebugInfo {
  3308. className: string;
  3309. filePath?: string;
  3310. lineNumber?: number;
  3311. forbidOrphanRendering?: boolean;
  3312. }
  3313. /**
  3314. * Flags passed into template functions to determine which blocks (i.e. creation, update)
  3315. * should be executed.
  3316. *
  3317. * Typically, a template runs both the creation block and the update block on initialization and
  3318. * subsequent runs only execute the update block. However, dynamically created views require that
  3319. * the creation block be executed separately from the update block (for backwards compat).
  3320. */
  3321. declare const enum RenderFlags {
  3322. Create = 1,
  3323. Update = 2
  3324. }
  3325. /**
  3326. * A subclass of `Type` which has a static `ɵcmp`:`ComponentDef` field making it
  3327. * consumable for rendering.
  3328. */
  3329. interface ComponentType<T> extends Type$1<T> {
  3330. ɵcmp: unknown;
  3331. }
  3332. /**
  3333. * A subclass of `Type` which has a static `ɵdir`:`DirectiveDef` field making it
  3334. * consumable for rendering.
  3335. */
  3336. interface DirectiveType<T> extends Type$1<T> {
  3337. ɵdir: unknown;
  3338. ɵfac: unknown;
  3339. }
  3340. /**
  3341. * A subclass of `Type` which has a static `ɵpipe`:`PipeDef` field making it
  3342. * consumable for rendering.
  3343. */
  3344. interface PipeType<T> extends Type$1<T> {
  3345. ɵpipe: unknown;
  3346. }
  3347. /**
  3348. * Runtime link information for Directives.
  3349. *
  3350. * This is an internal data structure used by the render to link
  3351. * directives into templates.
  3352. *
  3353. * NOTE: Always use `defineDirective` function to create this object,
  3354. * never create the object directly since the shape of this object
  3355. * can change between versions.
  3356. *
  3357. * @param Selector type metadata specifying the selector of the directive or component
  3358. *
  3359. * See: {@link defineDirective}
  3360. */
  3361. interface DirectiveDef<T> {
  3362. /**
  3363. * A dictionary mapping the inputs' public name to their minified property names
  3364. * (along with flags if there are any).
  3365. */
  3366. readonly inputs: Record<string, [
  3367. minifiedName: string,
  3368. flags: InputFlags,
  3369. transform: InputTransformFunction | null
  3370. ]>;
  3371. /**
  3372. * Contains the raw input information produced by the compiler. Can be
  3373. * used to do further processing after the `inputs` have been inverted.
  3374. */
  3375. readonly inputConfig: {
  3376. [P in keyof T]?: string | [InputFlags, string, string?, InputTransformFunction?];
  3377. };
  3378. /**
  3379. * @deprecated This is only here because `NgOnChanges` incorrectly uses declared name instead of
  3380. * public or minified name.
  3381. */
  3382. readonly declaredInputs: Record<string, string>;
  3383. /**
  3384. * A dictionary mapping the outputs' minified property names to their public API names, which
  3385. * are their aliases if any, or their original unminified property names
  3386. * (as in `@Output('alias') propertyName: any;`).
  3387. */
  3388. readonly outputs: Record<string, string>;
  3389. /**
  3390. * Function to create and refresh content queries associated with a given directive.
  3391. */
  3392. contentQueries: ContentQueriesFunction<T> | null;
  3393. /**
  3394. * Query-related instructions for a directive. Note that while directives don't have a
  3395. * view and as such view queries won't necessarily do anything, there might be
  3396. * components that extend the directive.
  3397. */
  3398. viewQuery: ViewQueriesFunction<T> | null;
  3399. /**
  3400. * Refreshes host bindings on the associated directive.
  3401. */
  3402. readonly hostBindings: HostBindingsFunction<T> | null;
  3403. /**
  3404. * The number of bindings in this directive `hostBindings` (including pure fn bindings).
  3405. *
  3406. * Used to calculate the length of the component's LView array, so we
  3407. * can pre-fill the array and set the host binding start index.
  3408. */
  3409. readonly hostVars: number;
  3410. /**
  3411. * Assign static attribute values to a host element.
  3412. *
  3413. * This property will assign static attribute values as well as class and style
  3414. * values to a host element. Since attribute values can consist of different types of values, the
  3415. * `hostAttrs` array must include the values in the following format:
  3416. *
  3417. * attrs = [
  3418. * // static attributes (like `title`, `name`, `id`...)
  3419. * attr1, value1, attr2, value,
  3420. *
  3421. * // a single namespace value (like `x:id`)
  3422. * NAMESPACE_MARKER, namespaceUri1, name1, value1,
  3423. *
  3424. * // another single namespace value (like `x:name`)
  3425. * NAMESPACE_MARKER, namespaceUri2, name2, value2,
  3426. *
  3427. * // a series of CSS classes that will be applied to the element (no spaces)
  3428. * CLASSES_MARKER, class1, class2, class3,
  3429. *
  3430. * // a series of CSS styles (property + value) that will be applied to the element
  3431. * STYLES_MARKER, prop1, value1, prop2, value2
  3432. * ]
  3433. *
  3434. * All non-class and non-style attributes must be defined at the start of the list
  3435. * first before all class and style values are set. When there is a change in value
  3436. * type (like when classes and styles are introduced) a marker must be used to separate
  3437. * the entries. The marker values themselves are set via entries found in the
  3438. * [AttributeMarker] enum.
  3439. */
  3440. readonly hostAttrs: TAttributes | null;
  3441. /** Token representing the directive. Used by DI. */
  3442. readonly type: Type$1<T>;
  3443. /** Function that resolves providers and publishes them into the DI system. */
  3444. providersResolver: (<U extends T>(def: DirectiveDef<U>, processProvidersFn?: ProcessProvidersFunction) => void) | null;
  3445. /** The selectors that will be used to match nodes to this directive. */
  3446. readonly selectors: CssSelectorList;
  3447. /**
  3448. * Name under which the directive is exported (for use with local references in template)
  3449. */
  3450. readonly exportAs: string[] | null;
  3451. /**
  3452. * Whether this directive (or component) is standalone.
  3453. */
  3454. readonly standalone: boolean;
  3455. /**
  3456. * Whether this directive (or component) uses the signals authoring experience.
  3457. */
  3458. readonly signals: boolean;
  3459. /**
  3460. * Factory function used to create a new directive instance. Will be null initially.
  3461. * Populated when the factory is first requested by directive instantiation logic.
  3462. */
  3463. readonly factory: FactoryFn<T> | null;
  3464. /**
  3465. * The features applied to this directive
  3466. */
  3467. readonly features: DirectiveDefFeature[] | null;
  3468. /**
  3469. * Info related to debugging/troubleshooting for this component. This info is only available in
  3470. * dev mode.
  3471. */
  3472. debugInfo: ClassDebugInfo | null;
  3473. /**
  3474. * Function that will add the host directives to the list of matches during directive matching.
  3475. * Patched onto the definition by the `HostDirectivesFeature`.
  3476. * @param currentDef Definition that has been matched.
  3477. * @param matchedDefs List of all matches for a specified node. Will be mutated to include the
  3478. * host directives.
  3479. * @param hostDirectiveDefs Mapping of directive definitions to their host directive
  3480. * configuration. Host directives will be added to the map as they're being matched to the node.
  3481. */
  3482. findHostDirectiveDefs: ((currentDef: DirectiveDef<unknown>, matchedDefs: DirectiveDef<unknown>[], hostDirectiveDefs: HostDirectiveDefs) => void) | null;
  3483. /**
  3484. * Additional directives to be applied whenever the directive has been matched.
  3485. *
  3486. * `HostDirectiveConfig` objects represent a host directive that can be resolved eagerly and were
  3487. * already pre-processed when the definition was created. A function needs to be resolved lazily
  3488. * during directive matching, because it's a forward reference.
  3489. *
  3490. * **Note:** we can't `HostDirectiveConfig` in the array, because there's no way to distinguish if
  3491. * a function in the array is a `Type` or a `() => HostDirectiveConfig[]`.
  3492. */
  3493. hostDirectives: (HostDirectiveDef | (() => HostDirectiveConfig[]))[] | null;
  3494. setInput: (<U extends T>(this: DirectiveDef<U>, instance: U, inputSignalNode: null | InputSignalNode<unknown, unknown>, value: any, publicName: string, privateName: string) => void) | null;
  3495. }
  3496. /**
  3497. * Runtime link information for Components.
  3498. *
  3499. * This is an internal data structure used by the render to link
  3500. * components into templates.
  3501. *
  3502. * NOTE: Always use `defineComponent` function to create this object,
  3503. * never create the object directly since the shape of this object
  3504. * can change between versions.
  3505. *
  3506. * See: {@link defineComponent}
  3507. */
  3508. interface ComponentDef<T> extends DirectiveDef<T> {
  3509. /**
  3510. * Unique ID for the component. Used in view encapsulation and
  3511. * to keep track of the injector in standalone components.
  3512. */
  3513. readonly id: string;
  3514. /**
  3515. * The View template of the component.
  3516. */
  3517. readonly template: ComponentTemplate<T>;
  3518. /** Constants associated with the component's view. */
  3519. readonly consts: TConstantsOrFactory | null;
  3520. /**
  3521. * An array of `ngContent[selector]` values that were found in the template.
  3522. */
  3523. readonly ngContentSelectors?: string[];
  3524. /**
  3525. * A set of styles that the component needs to be present for component to render correctly.
  3526. */
  3527. readonly styles: string[];
  3528. /**
  3529. * The number of nodes, local refs, and pipes in this component template.
  3530. *
  3531. * Used to calculate the length of the component's LView array, so we
  3532. * can pre-fill the array and set the binding start index.
  3533. */
  3534. readonly decls: number;
  3535. /**
  3536. * The number of bindings in this component template (including pure fn bindings).
  3537. *
  3538. * Used to calculate the length of the component's LView array, so we
  3539. * can pre-fill the array and set the host binding start index.
  3540. */
  3541. readonly vars: number;
  3542. /**
  3543. * Query-related instructions for a component.
  3544. */
  3545. viewQuery: ViewQueriesFunction<T> | null;
  3546. /**
  3547. * The view encapsulation type, which determines how styles are applied to
  3548. * DOM elements. One of
  3549. * - `Emulated` (default): Emulate native scoping of styles.
  3550. * - `Native`: Use the native encapsulation mechanism of the renderer.
  3551. * - `ShadowDom`: Use modern [ShadowDOM](https://w3c.github.io/webcomponents/spec/shadow/) and
  3552. * create a ShadowRoot for component's host element.
  3553. * - `None`: Do not provide any template or style encapsulation.
  3554. */
  3555. readonly encapsulation: ViewEncapsulation$1;
  3556. /**
  3557. * Defines arbitrary developer-defined data to be stored on a renderer instance.
  3558. * This is useful for renderers that delegate to other renderers.
  3559. */
  3560. readonly data: {
  3561. [kind: string]: any;
  3562. animation?: any[];
  3563. };
  3564. /** Whether or not this component's ChangeDetectionStrategy is OnPush */
  3565. readonly onPush: boolean;
  3566. /** Whether or not this component is signal-based. */
  3567. readonly signals: boolean;
  3568. /**
  3569. * Registry of directives and components that may be found in this view.
  3570. *
  3571. * The property is either an array of `DirectiveDef`s or a function which returns the array of
  3572. * `DirectiveDef`s. The function is necessary to be able to support forward declarations.
  3573. */
  3574. directiveDefs: DirectiveDefListOrFactory | null;
  3575. /**
  3576. * Registry of pipes that may be found in this view.
  3577. *
  3578. * The property is either an array of `PipeDefs`s or a function which returns the array of
  3579. * `PipeDefs`s. The function is necessary to be able to support forward declarations.
  3580. */
  3581. pipeDefs: PipeDefListOrFactory | null;
  3582. /**
  3583. * Unfiltered list of all dependencies of a component, or `null` if none.
  3584. */
  3585. dependencies: TypeOrFactory<DependencyTypeList> | null;
  3586. /**
  3587. * The set of schemas that declare elements to be allowed in the component's template.
  3588. */
  3589. schemas: SchemaMetadata[] | null;
  3590. /**
  3591. * Ivy runtime uses this place to store the computed tView for the component. This gets filled on
  3592. * the first run of component.
  3593. */
  3594. tView: TView | null;
  3595. /**
  3596. * A function used by the framework to create standalone injectors.
  3597. */
  3598. getStandaloneInjector: ((parentInjector: EnvironmentInjector) => EnvironmentInjector | null) | null;
  3599. /**
  3600. * A function used by the framework to create the list of external runtime style URLs.
  3601. */
  3602. getExternalStyles: ((encapsulationId?: string) => string[]) | null;
  3603. /**
  3604. * Used to store the result of `noSideEffects` function so that it is not removed by closure
  3605. * compiler. The property should never be read.
  3606. */
  3607. readonly _?: unknown;
  3608. }
  3609. /**
  3610. * Runtime link information for Pipes.
  3611. *
  3612. * This is an internal data structure used by the renderer to link
  3613. * pipes into templates.
  3614. *
  3615. * NOTE: Always use `definePipe` function to create this object,
  3616. * never create the object directly since the shape of this object
  3617. * can change between versions.
  3618. *
  3619. * See: {@link definePipe}
  3620. */
  3621. interface PipeDef<T> {
  3622. /** Token representing the pipe. */
  3623. type: Type$1<T>;
  3624. /**
  3625. * Pipe name.
  3626. *
  3627. * Used to resolve pipe in templates.
  3628. */
  3629. readonly name: string;
  3630. /**
  3631. * Factory function used to create a new pipe instance. Will be null initially.
  3632. * Populated when the factory is first requested by pipe instantiation logic.
  3633. */
  3634. factory: FactoryFn<T> | null;
  3635. /**
  3636. * Whether or not the pipe is pure.
  3637. *
  3638. * Pure pipes result only depends on the pipe input and not on internal
  3639. * state of the pipe.
  3640. */
  3641. readonly pure: boolean;
  3642. /**
  3643. * Whether this pipe is standalone.
  3644. */
  3645. readonly standalone: boolean;
  3646. onDestroy: (() => void) | null;
  3647. }
  3648. interface DirectiveDefFeature {
  3649. <T>(directiveDef: DirectiveDef<T>): void;
  3650. /**
  3651. * Marks a feature as something that {@link InheritDefinitionFeature} will execute
  3652. * during inheritance.
  3653. *
  3654. * NOTE: DO NOT SET IN ROOT OF MODULE! Doing so will result in tree-shakers/bundlers
  3655. * identifying the change as a side effect, and the feature will be included in
  3656. * every bundle.
  3657. */
  3658. ngInherit?: true;
  3659. }
  3660. /** Runtime information used to configure a host directive. */
  3661. interface HostDirectiveDef<T = unknown> {
  3662. /** Class representing the host directive. */
  3663. directive: Type$1<T>;
  3664. /** Directive inputs that have been exposed. */
  3665. inputs: HostDirectiveBindingMap;
  3666. /** Directive outputs that have been exposed. */
  3667. outputs: HostDirectiveBindingMap;
  3668. }
  3669. /**
  3670. * Mapping between the public aliases of directive bindings and the underlying inputs/outputs that
  3671. * they represent. Also serves as an allowlist of the inputs/outputs from the host directive that
  3672. * the author has decided to expose.
  3673. */
  3674. type HostDirectiveBindingMap = {
  3675. [publicName: string]: string;
  3676. };
  3677. /**
  3678. * Mapping between a directive that was used as a host directive
  3679. * and the configuration that was used to define it as such.
  3680. */
  3681. type HostDirectiveDefs = Map<DirectiveDef<unknown>, HostDirectiveDef>;
  3682. /** Value that can be used to configure a host directive. */
  3683. type HostDirectiveConfig = Type$1<unknown> | {
  3684. directive: Type$1<unknown>;
  3685. inputs?: string[];
  3686. outputs?: string[];
  3687. };
  3688. interface ComponentDefFeature {
  3689. <T>(componentDef: ComponentDef<T>): void;
  3690. /**
  3691. * Marks a feature as something that {@link InheritDefinitionFeature} will execute
  3692. * during inheritance.
  3693. *
  3694. * NOTE: DO NOT SET IN ROOT OF MODULE! Doing so will result in tree-shakers/bundlers
  3695. * identifying the change as a side effect, and the feature will be included in
  3696. * every bundle.
  3697. */
  3698. ngInherit?: true;
  3699. }
  3700. /** Function that can be used to transform incoming input values. */
  3701. type InputTransformFunction = (value: any) => any;
  3702. /**
  3703. * Type used for directiveDefs on component definition.
  3704. *
  3705. * The function is necessary to be able to support forward declarations.
  3706. */
  3707. type DirectiveDefListOrFactory = (() => DirectiveDefList) | DirectiveDefList;
  3708. type DirectiveDefList = (DirectiveDef<any> | ComponentDef<any>)[];
  3709. type DependencyType = DirectiveType<any> | ComponentType<any> | PipeType<any> | Type$1<any>;
  3710. type DependencyTypeList = Array<DependencyType>;
  3711. type TypeOrFactory<T> = T | (() => T);
  3712. type HostBindingsFunction<T> = <U extends T>(rf: RenderFlags, ctx: U) => void;
  3713. /**
  3714. * Type used for PipeDefs on component definition.
  3715. *
  3716. * The function is necessary to be able to support forward declarations.
  3717. */
  3718. type PipeDefListOrFactory = (() => PipeDefList) | PipeDefList;
  3719. type PipeDefList = PipeDef<any>[];
  3720. /**
  3721. * NgModule scope info as provided by AoT compiler
  3722. *
  3723. * In full compilation Ivy resolved all the "module with providers" and forward refs the whole array
  3724. * if at least one element is forward refed. So we end up with type `Type<any>[]|(() =>
  3725. * Type<any>[])`.
  3726. *
  3727. * In local mode the compiler passes the raw info as they are to the runtime functions as it is not
  3728. * possible to resolve them any further due to limited info at compile time. So we end up with type
  3729. * `RawScopeInfoFromDecorator[]`.
  3730. */
  3731. interface NgModuleScopeInfoFromDecorator {
  3732. /** List of components, directives, and pipes declared by this module. */
  3733. declarations?: Type$1<any>[] | (() => Type$1<any>[]) | RawScopeInfoFromDecorator[];
  3734. /** List of modules or `ModuleWithProviders` or standalone components imported by this module. */
  3735. imports?: Type$1<any>[] | (() => Type$1<any>[]) | RawScopeInfoFromDecorator[];
  3736. /**
  3737. * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this
  3738. * module.
  3739. */
  3740. exports?: Type$1<any>[] | (() => Type$1<any>[]) | RawScopeInfoFromDecorator[];
  3741. /**
  3742. * The set of components that are bootstrapped when this module is bootstrapped. This field is
  3743. * only available in local compilation mode. In full compilation mode bootstrap info is passed
  3744. * directly to the module def runtime after statically analyzed and resolved.
  3745. */
  3746. bootstrap?: Type$1<any>[] | (() => Type$1<any>[]) | RawScopeInfoFromDecorator[];
  3747. }
  3748. /**
  3749. * The array element type passed to:
  3750. * - NgModule's annotation imports/exports/declarations fields
  3751. * - standalone component annotation imports field
  3752. */
  3753. type RawScopeInfoFromDecorator = Type$1<any> | ModuleWithProviders<any> | (() => Type$1<any>) | (() => ModuleWithProviders<any>) | any[];
  3754. /**
  3755. * Basic set of data structures used for identifying a defer block
  3756. * and triggering defer blocks
  3757. */
  3758. interface DehydratedDeferBlock {
  3759. lView: LView;
  3760. tNode: TNode;
  3761. lContainer: LContainer;
  3762. }
  3763. /**
  3764. * Describes the shape of a function generated by the compiler
  3765. * to download dependencies that can be defer-loaded.
  3766. */
  3767. type DependencyResolverFn = () => Array<Promise<DependencyType>>;
  3768. /**
  3769. * Describes the state of defer block dependency loading.
  3770. */
  3771. declare enum DeferDependenciesLoadingState {
  3772. /** Initial state, dependency loading is not yet triggered */
  3773. NOT_STARTED = 0,
  3774. /** Dependency loading is in progress */
  3775. IN_PROGRESS = 1,
  3776. /** Dependency loading has completed successfully */
  3777. COMPLETE = 2,
  3778. /** Dependency loading has failed */
  3779. FAILED = 3
  3780. }
  3781. /** Configuration object for a loading block as it is stored in the component constants. */
  3782. type DeferredLoadingBlockConfig = [minimumTime: number | null, afterTime: number | null];
  3783. /** Configuration object for a placeholder block as it is stored in the component constants. */
  3784. type DeferredPlaceholderBlockConfig = [minimumTime: number | null];
  3785. /**
  3786. * Describes the data shared across all instances of a defer block.
  3787. */
  3788. interface TDeferBlockDetails {
  3789. /**
  3790. * Index in an LView and TData arrays where a template for the primary content
  3791. * can be found.
  3792. */
  3793. primaryTmplIndex: number;
  3794. /**
  3795. * Index in an LView and TData arrays where a template for the loading block can be found.
  3796. */
  3797. loadingTmplIndex: number | null;
  3798. /**
  3799. * Extra configuration parameters (such as `after` and `minimum`) for the loading block.
  3800. */
  3801. loadingBlockConfig: DeferredLoadingBlockConfig | null;
  3802. /**
  3803. * Index in an LView and TData arrays where a template for the placeholder block can be found.
  3804. */
  3805. placeholderTmplIndex: number | null;
  3806. /**
  3807. * Extra configuration parameters (such as `after` and `minimum`) for the placeholder block.
  3808. */
  3809. placeholderBlockConfig: DeferredPlaceholderBlockConfig | null;
  3810. /**
  3811. * Index in an LView and TData arrays where a template for the error block can be found.
  3812. */
  3813. errorTmplIndex: number | null;
  3814. /**
  3815. * Compiler-generated function that loads all dependencies for a defer block.
  3816. */
  3817. dependencyResolverFn: DependencyResolverFn | null;
  3818. /**
  3819. * Keeps track of the current loading state of defer block dependencies.
  3820. */
  3821. loadingState: DeferDependenciesLoadingState;
  3822. /**
  3823. * Dependency loading Promise. This Promise is helpful for cases when there
  3824. * are multiple instances of a defer block (e.g. if it was used inside of an *ngFor),
  3825. * which all await the same set of dependencies.
  3826. */
  3827. loadingPromise: Promise<unknown> | null;
  3828. /**
  3829. * List of providers collected from all NgModules that were imported by
  3830. * standalone components used within this defer block.
  3831. */
  3832. providers: Provider[] | null;
  3833. /**
  3834. * List of hydrate triggers for a given block
  3835. */
  3836. hydrateTriggers: Map<DeferBlockTrigger, HydrateTriggerDetails | null> | null;
  3837. /**
  3838. * Defer block flags, which should be used for all
  3839. * instances of a given defer block (the flags that should be
  3840. * placed into the `TDeferDetails` at runtime).
  3841. */
  3842. flags: TDeferDetailsFlags;
  3843. /**
  3844. * Tracks debugging information about the deferred block.
  3845. */
  3846. debug: {
  3847. /** Text representations of the block's triggers. */
  3848. triggers?: Set<string>;
  3849. } | null;
  3850. }
  3851. /**
  3852. * Specifies defer block flags, which should be used for all
  3853. * instances of a given defer block (the flags that should be
  3854. * placed into the `TDeferDetails` at runtime).
  3855. */
  3856. declare const enum TDeferDetailsFlags {
  3857. Default = 0,
  3858. /**
  3859. * Whether or not the defer block has hydrate triggers.
  3860. */
  3861. HasHydrateTriggers = 1
  3862. }
  3863. /**
  3864. * Describes the current state of this defer block instance.
  3865. *
  3866. * @publicApi
  3867. */
  3868. declare enum DeferBlockState {
  3869. /** The placeholder block content is rendered */
  3870. Placeholder = 0,
  3871. /** The loading block content is rendered */
  3872. Loading = 1,
  3873. /** The main content block content is rendered */
  3874. Complete = 2,
  3875. /** The error block content is rendered */
  3876. Error = 3
  3877. }
  3878. /**
  3879. * Represents defer trigger types.
  3880. */
  3881. declare const enum DeferBlockTrigger {
  3882. Idle = 0,
  3883. Immediate = 1,
  3884. Viewport = 2,
  3885. Interaction = 3,
  3886. Hover = 4,
  3887. Timer = 5,
  3888. When = 6,
  3889. Never = 7
  3890. }
  3891. /** * Describes specified delay (in ms) in the `hydrate on timer()` trigger. */
  3892. interface HydrateTimerTriggerDetails {
  3893. delay: number;
  3894. }
  3895. /** * Describes all possible hydration trigger details specified in a template. */
  3896. type HydrateTriggerDetails = HydrateTimerTriggerDetails;
  3897. /**
  3898. * Internal structure used for configuration of defer block behavior.
  3899. * */
  3900. interface DeferBlockConfig {
  3901. behavior: DeferBlockBehavior;
  3902. }
  3903. /**
  3904. * Options for configuring defer blocks behavior.
  3905. * @publicApi
  3906. */
  3907. declare enum DeferBlockBehavior {
  3908. /**
  3909. * Manual triggering mode for defer blocks. Provides control over when defer blocks render
  3910. * and which state they render.
  3911. */
  3912. Manual = 0,
  3913. /**
  3914. * Playthrough mode for defer blocks. This mode behaves like defer blocks would in a browser.
  3915. * This is the default behavior in test environments.
  3916. */
  3917. Playthrough = 1
  3918. }
  3919. /**
  3920. * **INTERNAL**, avoid referencing it in application code.
  3921. *
  3922. * Describes a helper class that allows to intercept a call to retrieve current
  3923. * dependency loading function and replace it with a different implementation.
  3924. * This interceptor class is needed to allow testing blocks in different states
  3925. * by simulating loading response.
  3926. */
  3927. interface DeferBlockDependencyInterceptor {
  3928. /**
  3929. * Invoked for each defer block when dependency loading function is accessed.
  3930. */
  3931. intercept(dependencyFn: DependencyResolverFn | null): DependencyResolverFn | null;
  3932. /**
  3933. * Allows to configure an interceptor function.
  3934. */
  3935. setInterceptor(interceptorFn: (current: DependencyResolverFn) => DependencyResolverFn): void;
  3936. }
  3937. /**
  3938. * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property
  3939. * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly
  3940. * handled.
  3941. *
  3942. * See DomSanitizer for more details on security in Angular applications.
  3943. *
  3944. * @publicApi
  3945. */
  3946. declare enum SecurityContext {
  3947. NONE = 0,
  3948. HTML = 1,
  3949. STYLE = 2,
  3950. SCRIPT = 3,
  3951. URL = 4,
  3952. RESOURCE_URL = 5
  3953. }
  3954. /**
  3955. * Sanitizer is used by the views to sanitize potentially dangerous values.
  3956. *
  3957. * @publicApi
  3958. */
  3959. declare abstract class Sanitizer {
  3960. abstract sanitize(context: SecurityContext, value: {} | string | null): string | null;
  3961. /** @nocollapse */
  3962. static ɵprov: unknown;
  3963. }
  3964. /** Actions that are supported by the tracing framework. */
  3965. declare enum TracingAction {
  3966. CHANGE_DETECTION = 0,
  3967. AFTER_NEXT_RENDER = 1
  3968. }
  3969. /** A single tracing snapshot. */
  3970. interface TracingSnapshot {
  3971. run<T>(action: TracingAction, fn: () => T): T;
  3972. /** Disposes of the tracing snapshot. Must be run exactly once per TracingSnapshot. */
  3973. dispose(): void;
  3974. }
  3975. /**
  3976. * Injection token for a `TracingService`, optionally provided.
  3977. */
  3978. declare const TracingService: InjectionToken<TracingService<TracingSnapshot>>;
  3979. /**
  3980. * Tracing mechanism which can associate causes (snapshots) with runs of
  3981. * subsequent operations.
  3982. *
  3983. * Not defined by Angular directly, but defined in contexts where tracing is
  3984. * desired.
  3985. */
  3986. interface TracingService<T extends TracingSnapshot> {
  3987. /**
  3988. * Take a snapshot of the current context which will be stored by Angular and
  3989. * used when additional work is performed that was scheduled in this context.
  3990. *
  3991. * @param linkedSnapshot Optional snapshot to use link to the current context.
  3992. * The caller is no longer responsible for calling dispose on the linkedSnapshot.
  3993. *
  3994. * @return The tracing snapshot. The caller is responsible for diposing of the
  3995. * snapshot.
  3996. */
  3997. snapshot(linkedSnapshot: T | null): T;
  3998. /**
  3999. * Wrap an event listener bound by the framework for tracing.
  4000. * @param element Element on which the event is bound.
  4001. * @param eventName Name of the event.
  4002. * @param handler Event handler.
  4003. * @return A new event handler to be bound instead of the original one.
  4004. */
  4005. wrapEventListener?<T extends Function>(element: HTMLElement, eventName: string, handler: T): T;
  4006. }
  4007. /**
  4008. * The phase to run an `afterRender` or `afterNextRender` callback in.
  4009. *
  4010. * Callbacks in the same phase run in the order they are registered. Phases run in the
  4011. * following order after each render:
  4012. *
  4013. * 1. `AfterRenderPhase.EarlyRead`
  4014. * 2. `AfterRenderPhase.Write`
  4015. * 3. `AfterRenderPhase.MixedReadWrite`
  4016. * 4. `AfterRenderPhase.Read`
  4017. *
  4018. * Angular is unable to verify or enforce that phases are used correctly, and instead
  4019. * relies on each developer to follow the guidelines documented for each value and
  4020. * carefully choose the appropriate one, refactoring their code if necessary. By doing
  4021. * so, Angular is better able to minimize the performance degradation associated with
  4022. * manual DOM access, ensuring the best experience for the end users of your application
  4023. * or library.
  4024. *
  4025. * @deprecated Specify the phase for your callback to run in by passing a spec-object as the first
  4026. * parameter to `afterRender` or `afterNextRender` instead of a function.
  4027. */
  4028. declare enum AfterRenderPhase {
  4029. /**
  4030. * Use `AfterRenderPhase.EarlyRead` for callbacks that only need to **read** from the
  4031. * DOM before a subsequent `AfterRenderPhase.Write` callback, for example to perform
  4032. * custom layout that the browser doesn't natively support. Prefer the
  4033. * `AfterRenderPhase.Read` phase if reading can wait until after the write phase.
  4034. * **Never** write to the DOM in this phase.
  4035. *
  4036. * <div class="docs-alert docs-alert-important">
  4037. *
  4038. * Using this value can degrade performance.
  4039. * Instead, prefer using built-in browser functionality when possible.
  4040. *
  4041. * </div>
  4042. */
  4043. EarlyRead = 0,
  4044. /**
  4045. * Use `AfterRenderPhase.Write` for callbacks that only **write** to the DOM. **Never**
  4046. * read from the DOM in this phase.
  4047. */
  4048. Write = 1,
  4049. /**
  4050. * Use `AfterRenderPhase.MixedReadWrite` for callbacks that read from or write to the
  4051. * DOM, that haven't been refactored to use a different phase. **Never** use this phase if
  4052. * it is possible to divide the work among the other phases instead.
  4053. *
  4054. * <div class="docs-alert docs-alert-critical">
  4055. *
  4056. * Using this value can **significantly** degrade performance.
  4057. * Instead, prefer dividing work into the appropriate phase callbacks.
  4058. *
  4059. * </div>
  4060. */
  4061. MixedReadWrite = 2,
  4062. /**
  4063. * Use `AfterRenderPhase.Read` for callbacks that only **read** from the DOM. **Never**
  4064. * write to the DOM in this phase.
  4065. */
  4066. Read = 3
  4067. }
  4068. /**
  4069. * A callback that runs after render.
  4070. *
  4071. * @developerPreview
  4072. */
  4073. interface AfterRenderRef {
  4074. /**
  4075. * Shut down the callback, preventing it from being called again.
  4076. */
  4077. destroy(): void;
  4078. }
  4079. declare class AfterRenderManager {
  4080. impl: AfterRenderImpl | null;
  4081. execute(): void;
  4082. /** @nocollapse */
  4083. static ɵprov: unknown;
  4084. }
  4085. declare class AfterRenderImpl {
  4086. private readonly ngZone;
  4087. private readonly scheduler;
  4088. private readonly errorHandler;
  4089. /** Current set of active sequences. */
  4090. private readonly sequences;
  4091. /** Tracks registrations made during the current set of executions. */
  4092. private readonly deferredRegistrations;
  4093. /** Whether the `AfterRenderManager` is currently executing hooks. */
  4094. executing: boolean;
  4095. constructor();
  4096. /**
  4097. * Run the sequence of phases of hooks, once through. As a result of executing some hooks, more
  4098. * might be scheduled.
  4099. */
  4100. execute(): void;
  4101. register(sequence: AfterRenderSequence): void;
  4102. addSequence(sequence: AfterRenderSequence): void;
  4103. unregister(sequence: AfterRenderSequence): void;
  4104. protected maybeTrace<T>(fn: () => T, snapshot: TracingSnapshot | null): T;
  4105. /** @nocollapse */
  4106. static ɵprov: unknown;
  4107. }
  4108. type AfterRenderHook = (value?: unknown) => unknown;
  4109. type AfterRenderHooks = [
  4110. AfterRenderHook | undefined,
  4111. AfterRenderHook | undefined,
  4112. AfterRenderHook | undefined,
  4113. AfterRenderHook | undefined
  4114. ];
  4115. declare class AfterRenderSequence implements AfterRenderRef {
  4116. readonly impl: AfterRenderImpl;
  4117. readonly hooks: AfterRenderHooks;
  4118. readonly view: LView | undefined;
  4119. once: boolean;
  4120. snapshot: TracingSnapshot | null;
  4121. /**
  4122. * Whether this sequence errored or was destroyed during this execution, and hooks should no
  4123. * longer run for it.
  4124. */
  4125. erroredOrDestroyed: boolean;
  4126. /**
  4127. * The value returned by the last hook execution (if any), ready to be pipelined into the next
  4128. * one.
  4129. */
  4130. pipelinedValue: unknown;
  4131. private unregisterOnDestroy;
  4132. constructor(impl: AfterRenderImpl, hooks: AfterRenderHooks, view: LView | undefined, once: boolean, destroyRef: DestroyRef | null, snapshot?: TracingSnapshot | null);
  4133. afterRun(): void;
  4134. destroy(): void;
  4135. }
  4136. interface ReactiveLViewConsumer extends ReactiveNode {
  4137. lView: LView | null;
  4138. }
  4139. /**
  4140. * Abstraction that encompasses any kind of effect that can be scheduled.
  4141. */
  4142. interface SchedulableEffect {
  4143. run(): void;
  4144. zone: {
  4145. run<T>(fn: () => T): T;
  4146. } | null;
  4147. }
  4148. /**
  4149. * A scheduler which manages the execution of effects.
  4150. */
  4151. declare abstract class EffectScheduler {
  4152. /**
  4153. * Schedule the given effect to be executed at a later time.
  4154. *
  4155. * It is an error to attempt to execute any effects synchronously during a scheduling operation.
  4156. */
  4157. abstract schedule(e: SchedulableEffect): void;
  4158. /**
  4159. * Run any scheduled effects.
  4160. */
  4161. abstract flush(): void;
  4162. /** Remove a scheduled effect */
  4163. abstract remove(e: SchedulableEffect): void;
  4164. /** @nocollapse */
  4165. static ɵprov: unknown;
  4166. }
  4167. /**
  4168. * A wrapper around `ZoneAwareQueueingScheduler` that schedules flushing via the microtask queue
  4169. * when.
  4170. */
  4171. declare class ZoneAwareEffectScheduler implements EffectScheduler {
  4172. private queuedEffectCount;
  4173. private queues;
  4174. schedule(handle: SchedulableEffect): void;
  4175. remove(handle: SchedulableEffect): void;
  4176. private enqueue;
  4177. /**
  4178. * Run all scheduled effects.
  4179. *
  4180. * Execution order of effects within the same zone is guaranteed to be FIFO, but there is no
  4181. * ordering guarantee between effects scheduled in different zones.
  4182. */
  4183. flush(): void;
  4184. private flushQueue;
  4185. }
  4186. /**
  4187. * A global reactive effect, which can be manually destroyed.
  4188. *
  4189. * @developerPreview
  4190. */
  4191. interface EffectRef {
  4192. /**
  4193. * Shut down the effect, removing it from any upcoming scheduled executions.
  4194. */
  4195. destroy(): void;
  4196. }
  4197. /**
  4198. * Options passed to the `effect` function.
  4199. *
  4200. * @developerPreview
  4201. */
  4202. interface CreateEffectOptions {
  4203. /**
  4204. * The `Injector` in which to create the effect.
  4205. *
  4206. * If this is not provided, the current [injection context](guide/di/dependency-injection-context)
  4207. * will be used instead (via `inject`).
  4208. */
  4209. injector?: Injector;
  4210. /**
  4211. * Whether the `effect` should require manual cleanup.
  4212. *
  4213. * If this is `false` (the default) the effect will automatically register itself to be cleaned up
  4214. * with the current `DestroyRef`.
  4215. */
  4216. manualCleanup?: boolean;
  4217. /**
  4218. * Always create a root effect (which is scheduled as a microtask) regardless of whether `effect`
  4219. * is called within a component.
  4220. */
  4221. forceRoot?: true;
  4222. /**
  4223. * @deprecated no longer required, signal writes are allowed by default.
  4224. */
  4225. allowSignalWrites?: boolean;
  4226. /**
  4227. * A debug name for the effect. Used in Angular DevTools to identify the effect.
  4228. */
  4229. debugName?: string;
  4230. }
  4231. /**
  4232. * An effect can, optionally, register a cleanup function. If registered, the cleanup is executed
  4233. * before the next effect run. The cleanup function makes it possible to "cancel" any work that the
  4234. * previous effect run might have started.
  4235. *
  4236. * @developerPreview
  4237. */
  4238. type EffectCleanupFn = () => void;
  4239. /**
  4240. * A callback passed to the effect function that makes it possible to register cleanup logic.
  4241. *
  4242. * @developerPreview
  4243. */
  4244. type EffectCleanupRegisterFn = (cleanupFn: EffectCleanupFn) => void;
  4245. /**
  4246. * Registers an "effect" that will be scheduled & executed whenever the signals that it reads
  4247. * changes.
  4248. *
  4249. * Angular has two different kinds of effect: component effects and root effects. Component effects
  4250. * are created when `effect()` is called from a component, directive, or within a service of a
  4251. * component/directive. Root effects are created when `effect()` is called from outside the
  4252. * component tree, such as in a root service, or when the `forceRoot` option is provided.
  4253. *
  4254. * The two effect types differ in their timing. Component effects run as a component lifecycle
  4255. * event during Angular's synchronization (change detection) process, and can safely read input
  4256. * signals or create/destroy views that depend on component state. Root effects run as microtasks
  4257. * and have no connection to the component tree or change detection.
  4258. *
  4259. * `effect()` must be run in injection context, unless the `injector` option is manually specified.
  4260. *
  4261. * @developerPreview
  4262. */
  4263. declare function effect(effectFn: (onCleanup: EffectCleanupRegisterFn) => void, options?: CreateEffectOptions): EffectRef;
  4264. interface EffectNode extends ReactiveNode, SchedulableEffect {
  4265. hasRun: boolean;
  4266. cleanupFns: EffectCleanupFn[] | undefined;
  4267. injector: Injector;
  4268. notifier: ChangeDetectionScheduler;
  4269. onDestroyFn: () => void;
  4270. fn: (cleanupFn: EffectCleanupRegisterFn) => void;
  4271. run(): void;
  4272. destroy(): void;
  4273. maybeCleanup(): void;
  4274. }
  4275. interface ViewEffectNode extends EffectNode {
  4276. view: LView;
  4277. }
  4278. /**
  4279. * An unmodifiable list of items that Angular keeps up to date when the state
  4280. * of the application changes.
  4281. *
  4282. * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}
  4283. * provide.
  4284. *
  4285. * Implements an iterable interface, therefore it can be used in both ES6
  4286. * javascript `for (var i of items)` loops as well as in Angular templates with
  4287. * `*ngFor="let i of myList"`.
  4288. *
  4289. * Changes can be observed by subscribing to the changes `Observable`.
  4290. *
  4291. * NOTE: In the future this class will implement an `Observable` interface.
  4292. *
  4293. * @usageNotes
  4294. * ### Example
  4295. * ```ts
  4296. * @Component({...})
  4297. * class Container {
  4298. * @ViewChildren(Item) items:QueryList<Item>;
  4299. * }
  4300. * ```
  4301. *
  4302. * @publicApi
  4303. */
  4304. declare class QueryList<T> implements Iterable<T> {
  4305. private _emitDistinctChangesOnly;
  4306. readonly dirty = true;
  4307. private _onDirty?;
  4308. private _results;
  4309. private _changesDetected;
  4310. private _changes;
  4311. readonly length: number;
  4312. readonly first: T;
  4313. readonly last: T;
  4314. /**
  4315. * Returns `Observable` of `QueryList` notifying the subscriber of changes.
  4316. */
  4317. get changes(): Observable<any>;
  4318. /**
  4319. * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change
  4320. * has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in
  4321. * the same result)
  4322. */
  4323. constructor(_emitDistinctChangesOnly?: boolean);
  4324. /**
  4325. * Returns the QueryList entry at `index`.
  4326. */
  4327. get(index: number): T | undefined;
  4328. /**
  4329. * See
  4330. * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
  4331. */
  4332. map<U>(fn: (item: T, index: number, array: T[]) => U): U[];
  4333. /**
  4334. * See
  4335. * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
  4336. */
  4337. filter<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S): S[];
  4338. filter(predicate: (value: T, index: number, array: readonly T[]) => unknown): T[];
  4339. /**
  4340. * See
  4341. * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
  4342. */
  4343. find(fn: (item: T, index: number, array: T[]) => boolean): T | undefined;
  4344. /**
  4345. * See
  4346. * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
  4347. */
  4348. reduce<U>(fn: (prevValue: U, curValue: T, curIndex: number, array: T[]) => U, init: U): U;
  4349. /**
  4350. * See
  4351. * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
  4352. */
  4353. forEach(fn: (item: T, index: number, array: T[]) => void): void;
  4354. /**
  4355. * See
  4356. * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
  4357. */
  4358. some(fn: (value: T, index: number, array: T[]) => boolean): boolean;
  4359. /**
  4360. * Returns a copy of the internal results list as an Array.
  4361. */
  4362. toArray(): T[];
  4363. toString(): string;
  4364. /**
  4365. * Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that
  4366. * on change detection, it will not notify of changes to the queries, unless a new change
  4367. * occurs.
  4368. *
  4369. * @param resultsTree The query results to store
  4370. * @param identityAccessor Optional function for extracting stable object identity from a value
  4371. * in the array. This function is executed for each element of the query result list while
  4372. * comparing current query list with the new one (provided as a first argument of the `reset`
  4373. * function) to detect if the lists are different. If the function is not provided, elements
  4374. * are compared as is (without any pre-processing).
  4375. */
  4376. reset(resultsTree: Array<T | any[]>, identityAccessor?: (value: T) => unknown): void;
  4377. /**
  4378. * Triggers a change event by emitting on the `changes` {@link EventEmitter}.
  4379. */
  4380. notifyOnChanges(): void;
  4381. /** internal */
  4382. setDirty(): void;
  4383. /** internal */
  4384. destroy(): void;
  4385. [Symbol.iterator]: () => Iterator<T>;
  4386. }
  4387. /**
  4388. * An object representing query metadata extracted from query annotations.
  4389. */
  4390. interface TQueryMetadata {
  4391. predicate: ProviderToken<unknown> | string[];
  4392. read: any;
  4393. flags: QueryFlags;
  4394. }
  4395. /**
  4396. * A set of flags to be used with Queries.
  4397. *
  4398. * NOTE: Ensure changes here are reflected in `packages/compiler/src/render3/view/compiler.ts`
  4399. */
  4400. declare const enum QueryFlags {
  4401. /**
  4402. * No flags
  4403. */
  4404. none = 0,
  4405. /**
  4406. * Whether or not the query should descend into children.
  4407. */
  4408. descendants = 1,
  4409. /**
  4410. * The query can be computed statically and hence can be assigned eagerly.
  4411. *
  4412. * NOTE: Backwards compatibility with ViewEngine.
  4413. */
  4414. isStatic = 2,
  4415. /**
  4416. * If the `QueryList` should fire change event only if actual change to query was computed (vs old
  4417. * behavior where the change was fired whenever the query was recomputed, even if the recomputed
  4418. * query resulted in the same list.)
  4419. */
  4420. emitDistinctChangesOnly = 4
  4421. }
  4422. /**
  4423. * TQuery objects represent all the query-related data that remain the same from one view instance
  4424. * to another and can be determined on the very first template pass. Most notably TQuery holds all
  4425. * the matches for a given view.
  4426. */
  4427. interface TQuery {
  4428. /**
  4429. * Query metadata extracted from query annotations.
  4430. */
  4431. metadata: TQueryMetadata;
  4432. /**
  4433. * Index of a query in a declaration view in case of queries propagated to en embedded view, -1
  4434. * for queries declared in a given view. We are storing this index so we can find a parent query
  4435. * to clone for an embedded view (when an embedded view is created).
  4436. */
  4437. indexInDeclarationView: number;
  4438. /**
  4439. * Matches collected on the first template pass. Each match is a pair of:
  4440. * - TNode index;
  4441. * - match index;
  4442. *
  4443. * A TNode index can be either:
  4444. * - a positive number (the most common case) to indicate a matching TNode;
  4445. * - a negative number to indicate that a given query is crossing a <ng-template> element and
  4446. * results from views created based on TemplateRef should be inserted at this place.
  4447. *
  4448. * A match index is a number used to find an actual value (for a given node) when query results
  4449. * are materialized. This index can have one of the following values:
  4450. * - -2 - indicates that we need to read a special token (TemplateRef, ViewContainerRef etc.);
  4451. * - -1 - indicates that we need to read a default value based on the node type (TemplateRef for
  4452. * ng-template and ElementRef for other elements);
  4453. * - a positive number - index of an injectable to be read from the element injector.
  4454. */
  4455. matches: number[] | null;
  4456. /**
  4457. * A flag indicating if a given query crosses an <ng-template> element. This flag exists for
  4458. * performance reasons: we can notice that queries not crossing any <ng-template> elements will
  4459. * have matches from a given view only (and adapt processing accordingly).
  4460. */
  4461. crossesNgTemplate: boolean;
  4462. /**
  4463. * A method call when a given query is crossing an element (or element container). This is where a
  4464. * given TNode is matched against a query predicate.
  4465. * @param tView
  4466. * @param tNode
  4467. */
  4468. elementStart(tView: TView, tNode: TNode): void;
  4469. /**
  4470. * A method called when processing the elementEnd instruction - this is mostly useful to determine
  4471. * if a given content query should match any nodes past this point.
  4472. * @param tNode
  4473. */
  4474. elementEnd(tNode: TNode): void;
  4475. /**
  4476. * A method called when processing the template instruction. This is where a
  4477. * given TContainerNode is matched against a query predicate.
  4478. * @param tView
  4479. * @param tNode
  4480. */
  4481. template(tView: TView, tNode: TNode): void;
  4482. /**
  4483. * A query-related method called when an embedded TView is created based on the content of a
  4484. * <ng-template> element. We call this method to determine if a given query should be propagated
  4485. * to the embedded view and if so - return a cloned TQuery for this embedded view.
  4486. * @param tNode
  4487. * @param childQueryIndex
  4488. */
  4489. embeddedTView(tNode: TNode, childQueryIndex: number): TQuery | null;
  4490. }
  4491. /**
  4492. * TQueries represent a collection of individual TQuery objects tracked in a given view. Most of the
  4493. * methods on this interface are simple proxy methods to the corresponding functionality on TQuery.
  4494. */
  4495. interface TQueries {
  4496. /**
  4497. * Adds a new TQuery to a collection of queries tracked in a given view.
  4498. * @param tQuery
  4499. */
  4500. track(tQuery: TQuery): void;
  4501. /**
  4502. * Returns a TQuery instance for at the given index in the queries array.
  4503. * @param index
  4504. */
  4505. getByIndex(index: number): TQuery;
  4506. /**
  4507. * Returns the number of queries tracked in a given view.
  4508. */
  4509. length: number;
  4510. /**
  4511. * A proxy method that iterates over all the TQueries in a given TView and calls the corresponding
  4512. * `elementStart` on each and every TQuery.
  4513. * @param tView
  4514. * @param tNode
  4515. */
  4516. elementStart(tView: TView, tNode: TNode): void;
  4517. /**
  4518. * A proxy method that iterates over all the TQueries in a given TView and calls the corresponding
  4519. * `elementEnd` on each and every TQuery.
  4520. * @param tNode
  4521. */
  4522. elementEnd(tNode: TNode): void;
  4523. /**
  4524. * A proxy method that iterates over all the TQueries in a given TView and calls the corresponding
  4525. * `template` on each and every TQuery.
  4526. * @param tView
  4527. * @param tNode
  4528. */
  4529. template(tView: TView, tNode: TNode): void;
  4530. /**
  4531. * A proxy method that iterates over all the TQueries in a given TView and calls the corresponding
  4532. * `embeddedTView` on each and every TQuery.
  4533. * @param tNode
  4534. */
  4535. embeddedTView(tNode: TNode): TQueries | null;
  4536. }
  4537. /**
  4538. * An interface that represents query-related information specific to a view instance. Most notably
  4539. * it contains:
  4540. * - materialized query matches;
  4541. * - a pointer to a QueryList where materialized query results should be reported.
  4542. */
  4543. interface LQuery<T> {
  4544. /**
  4545. * Materialized query matches for a given view only (!). Results are initialized lazily so the
  4546. * array of matches is set to `null` initially.
  4547. */
  4548. matches: (T | null)[] | null;
  4549. /**
  4550. * A QueryList where materialized query results should be reported.
  4551. */
  4552. queryList: QueryList<T>;
  4553. /**
  4554. * Clones an LQuery for an embedded view. A cloned query shares the same `QueryList` but has a
  4555. * separate collection of materialized matches.
  4556. */
  4557. clone(): LQuery<T>;
  4558. /**
  4559. * Called when an embedded view, impacting results of this query, is inserted or removed.
  4560. */
  4561. setDirty(): void;
  4562. }
  4563. /**
  4564. * lQueries represent a collection of individual LQuery objects tracked in a given view.
  4565. */
  4566. interface LQueries {
  4567. /**
  4568. * A collection of queries tracked in a given view.
  4569. */
  4570. queries: LQuery<any>[];
  4571. /**
  4572. * A method called when a new embedded view is created. As a result a set of LQueries applicable
  4573. * for a new embedded view is instantiated (cloned) from the declaration view.
  4574. * @param tView
  4575. */
  4576. createEmbeddedView(tView: TView): LQueries | null;
  4577. /**
  4578. * A method called when an embedded view is inserted into a container. As a result all impacted
  4579. * `LQuery` objects (and associated `QueryList`) are marked as dirty.
  4580. * @param tView
  4581. */
  4582. insertView(tView: TView): void;
  4583. /**
  4584. * A method called when an embedded view is detached from a container. As a result all impacted
  4585. * `LQuery` objects (and associated `QueryList`) are marked as dirty.
  4586. * @param tView
  4587. */
  4588. detachView(tView: TView): void;
  4589. /**
  4590. * A method called when a view finishes its creation pass. As a result all impacted
  4591. * `LQuery` objects (and associated `QueryList`) are marked as dirty. This additional dirty
  4592. * marking gives us a precise point in time where we can collect results for a given view in an
  4593. * atomic way.
  4594. * @param tView
  4595. */
  4596. finishViewCreation(tView: TView): void;
  4597. }
  4598. /**
  4599. * Used by `RendererFactory2` to associate custom rendering data and styles
  4600. * with a rendering implementation.
  4601. * @publicApi
  4602. */
  4603. interface RendererType2 {
  4604. /**
  4605. * A unique identifying string for the new renderer, used when creating
  4606. * unique styles for encapsulation.
  4607. */
  4608. id: string;
  4609. /**
  4610. * The view encapsulation type, which determines how styles are applied to
  4611. * DOM elements. One of
  4612. * - `Emulated` (default): Emulate native scoping of styles.
  4613. * - `Native`: Use the native encapsulation mechanism of the renderer.
  4614. * - `ShadowDom`: Use modern [Shadow
  4615. * DOM](https://w3c.github.io/webcomponents/spec/shadow/) and
  4616. * create a ShadowRoot for component's host element.
  4617. * - `None`: Do not provide any template or style encapsulation.
  4618. */
  4619. encapsulation: ViewEncapsulation$1;
  4620. /**
  4621. * Defines CSS styles to be stored on a renderer instance.
  4622. */
  4623. styles: string[];
  4624. /**
  4625. * Defines arbitrary developer-defined data to be stored on a renderer instance.
  4626. * This is useful for renderers that delegate to other renderers.
  4627. */
  4628. data: {
  4629. [kind: string]: any;
  4630. };
  4631. /**
  4632. * A function used by the framework to create the list of external runtime style URLs.
  4633. */
  4634. getExternalStyles?: ((encapsulationId?: string) => string[]) | null;
  4635. }
  4636. /**
  4637. * Flags for renderer-specific style modifiers.
  4638. * @publicApi
  4639. */
  4640. declare enum RendererStyleFlags2 {
  4641. /**
  4642. * Marks a style as important.
  4643. */
  4644. Important = 1,
  4645. /**
  4646. * Marks a style as using dash case naming (this-is-dash-case).
  4647. */
  4648. DashCase = 2
  4649. }
  4650. /**
  4651. * Creates and initializes a custom renderer that implements the `Renderer2` base class.
  4652. *
  4653. * @publicApi
  4654. */
  4655. declare abstract class RendererFactory2 {
  4656. /**
  4657. * Creates and initializes a custom renderer for a host DOM element.
  4658. * @param hostElement The element to render.
  4659. * @param type The base class to implement.
  4660. * @returns The new custom renderer instance.
  4661. */
  4662. abstract createRenderer(hostElement: any, type: RendererType2 | null): Renderer2;
  4663. /**
  4664. * A callback invoked when rendering has begun.
  4665. */
  4666. abstract begin?(): void;
  4667. /**
  4668. * A callback invoked when rendering has completed.
  4669. */
  4670. abstract end?(): void;
  4671. /**
  4672. * Use with animations test-only mode. Notifies the test when rendering has completed.
  4673. * @returns The asynchronous result of the developer-defined function.
  4674. */
  4675. abstract whenRenderingDone?(): Promise<any>;
  4676. }
  4677. /**
  4678. * Extend this base class to implement custom rendering. By default, Angular
  4679. * renders a template into DOM. You can use custom rendering to intercept
  4680. * rendering calls, or to render to something other than DOM.
  4681. *
  4682. * <div class="docs-alert docs-alert-important">
  4683. * <p>
  4684. * Please be aware that usage of `Renderer2`, in context of accessing DOM elements, provides no
  4685. * extra security which makes it equivalent to
  4686. * {@link /best-practices/security#direct-use-of-the-dom-apis-and-explicit-sanitization-calls Security vulnerabilities}.
  4687. * </p>
  4688. * </div>
  4689. *
  4690. * Create your custom renderer using `RendererFactory2`.
  4691. *
  4692. * Use a custom renderer to bypass Angular's templating and
  4693. * make custom UI changes that can't be expressed declaratively.
  4694. * For example if you need to set a property or an attribute whose name is
  4695. * not statically known, use the `setProperty()` or
  4696. * `setAttribute()` method.
  4697. *
  4698. * @publicApi
  4699. */
  4700. declare abstract class Renderer2 {
  4701. /**
  4702. * Use to store arbitrary developer-defined data on a renderer instance,
  4703. * as an object containing key-value pairs.
  4704. * This is useful for renderers that delegate to other renderers.
  4705. */
  4706. abstract get data(): {
  4707. [key: string]: any;
  4708. };
  4709. /**
  4710. * Implement this callback to destroy the renderer or the host element.
  4711. */
  4712. abstract destroy(): void;
  4713. /**
  4714. * Implement this callback to create an instance of the host element.
  4715. * @param name An identifying name for the new element, unique within the namespace.
  4716. * @param namespace The namespace for the new element.
  4717. * @returns The new element.
  4718. */
  4719. abstract createElement(name: string, namespace?: string | null): any;
  4720. /**
  4721. * Implement this callback to add a comment to the DOM of the host element.
  4722. * @param value The comment text.
  4723. * @returns The modified element.
  4724. */
  4725. abstract createComment(value: string): any;
  4726. /**
  4727. * Implement this callback to add text to the DOM of the host element.
  4728. * @param value The text string.
  4729. * @returns The modified element.
  4730. */
  4731. abstract createText(value: string): any;
  4732. /**
  4733. * If null or undefined, the view engine won't call it.
  4734. * This is used as a performance optimization for production mode.
  4735. */
  4736. destroyNode: ((node: any) => void) | null;
  4737. /**
  4738. * Appends a child to a given parent node in the host element DOM.
  4739. * @param parent The parent node.
  4740. * @param newChild The new child node.
  4741. */
  4742. abstract appendChild(parent: any, newChild: any): void;
  4743. /**
  4744. * Implement this callback to insert a child node at a given position in a parent node
  4745. * in the host element DOM.
  4746. * @param parent The parent node.
  4747. * @param newChild The new child nodes.
  4748. * @param refChild The existing child node before which `newChild` is inserted.
  4749. * @param isMove Optional argument which signifies if the current `insertBefore` is a result of a
  4750. * move. Animation uses this information to trigger move animations. In the past the Animation
  4751. * would always assume that any `insertBefore` is a move. This is not strictly true because
  4752. * with runtime i18n it is possible to invoke `insertBefore` as a result of i18n and it should
  4753. * not trigger an animation move.
  4754. */
  4755. abstract insertBefore(parent: any, newChild: any, refChild: any, isMove?: boolean): void;
  4756. /**
  4757. * Implement this callback to remove a child node from the host element's DOM.
  4758. * @param parent The parent node.
  4759. * @param oldChild The child node to remove.
  4760. * @param isHostElement Optionally signal to the renderer whether this element is a host element
  4761. * or not
  4762. */
  4763. abstract removeChild(parent: any, oldChild: any, isHostElement?: boolean): void;
  4764. /**
  4765. * Implement this callback to prepare an element to be bootstrapped
  4766. * as a root element, and return the element instance.
  4767. * @param selectorOrNode The DOM element.
  4768. * @param preserveContent Whether the contents of the root element
  4769. * should be preserved, or cleared upon bootstrap (default behavior).
  4770. * Use with `ViewEncapsulation.ShadowDom` to allow simple native
  4771. * content projection via `<slot>` elements.
  4772. * @returns The root element.
  4773. */
  4774. abstract selectRootElement(selectorOrNode: string | any, preserveContent?: boolean): any;
  4775. /**
  4776. * Implement this callback to get the parent of a given node
  4777. * in the host element's DOM.
  4778. * @param node The child node to query.
  4779. * @returns The parent node, or null if there is no parent.
  4780. * This is because the check is synchronous,
  4781. * and the caller can't rely on checking for null.
  4782. */
  4783. abstract parentNode(node: any): any;
  4784. /**
  4785. * Implement this callback to get the next sibling node of a given node
  4786. * in the host element's DOM.
  4787. * @returns The sibling node, or null if there is no sibling.
  4788. * This is because the check is synchronous,
  4789. * and the caller can't rely on checking for null.
  4790. */
  4791. abstract nextSibling(node: any): any;
  4792. /**
  4793. * Implement this callback to set an attribute value for an element in the DOM.
  4794. * @param el The element.
  4795. * @param name The attribute name.
  4796. * @param value The new value.
  4797. * @param namespace The namespace.
  4798. */
  4799. abstract setAttribute(el: any, name: string, value: string, namespace?: string | null): void;
  4800. /**
  4801. * Implement this callback to remove an attribute from an element in the DOM.
  4802. * @param el The element.
  4803. * @param name The attribute name.
  4804. * @param namespace The namespace.
  4805. */
  4806. abstract removeAttribute(el: any, name: string, namespace?: string | null): void;
  4807. /**
  4808. * Implement this callback to add a class to an element in the DOM.
  4809. * @param el The element.
  4810. * @param name The class name.
  4811. */
  4812. abstract addClass(el: any, name: string): void;
  4813. /**
  4814. * Implement this callback to remove a class from an element in the DOM.
  4815. * @param el The element.
  4816. * @param name The class name.
  4817. */
  4818. abstract removeClass(el: any, name: string): void;
  4819. /**
  4820. * Implement this callback to set a CSS style for an element in the DOM.
  4821. * @param el The element.
  4822. * @param style The name of the style.
  4823. * @param value The new value.
  4824. * @param flags Flags for style variations. No flags are set by default.
  4825. */
  4826. abstract setStyle(el: any, style: string, value: any, flags?: RendererStyleFlags2): void;
  4827. /**
  4828. * Implement this callback to remove the value from a CSS style for an element in the DOM.
  4829. * @param el The element.
  4830. * @param style The name of the style.
  4831. * @param flags Flags for style variations to remove, if set. ???
  4832. */
  4833. abstract removeStyle(el: any, style: string, flags?: RendererStyleFlags2): void;
  4834. /**
  4835. * Implement this callback to set the value of a property of an element in the DOM.
  4836. * @param el The element.
  4837. * @param name The property name.
  4838. * @param value The new value.
  4839. */
  4840. abstract setProperty(el: any, name: string, value: any): void;
  4841. /**
  4842. * Implement this callback to set the value of a node in the host element.
  4843. * @param node The node.
  4844. * @param value The new value.
  4845. */
  4846. abstract setValue(node: any, value: string): void;
  4847. /**
  4848. * Implement this callback to start an event listener.
  4849. * @param target The context in which to listen for events. Can be
  4850. * the entire window or document, the body of the document, or a specific
  4851. * DOM element.
  4852. * @param eventName The event to listen for.
  4853. * @param callback A handler function to invoke when the event occurs.
  4854. * @param options Options that configure how the event listener is bound.
  4855. * @returns An "unlisten" function for disposing of this handler.
  4856. */
  4857. abstract listen(target: 'window' | 'document' | 'body' | any, eventName: string, callback: (event: any) => boolean | void, options?: ListenerOptions): () => void;
  4858. }
  4859. /**
  4860. * This enum is meant to be used by `ɵtype` properties of the different renderers implemented
  4861. * by the framework
  4862. *
  4863. * We choose to not add `ɵtype` to `Renderer2` to no expose it to the public API.
  4864. */
  4865. declare const enum AnimationRendererType {
  4866. Regular = 0,
  4867. Delegated = 1
  4868. }
  4869. /**
  4870. * Options that can be used to configure an event listener.
  4871. * @publicApi
  4872. */
  4873. interface ListenerOptions {
  4874. capture?: boolean;
  4875. once?: boolean;
  4876. passive?: boolean;
  4877. }
  4878. /**
  4879. * The goal here is to make sure that the browser DOM API is the Renderer.
  4880. * We do this by defining a subset of DOM API to be the renderer and then
  4881. * use that at runtime for rendering.
  4882. *
  4883. * At runtime we can then use the DOM api directly, in server or web-worker
  4884. * it will be easy to implement such API.
  4885. */
  4886. type GlobalTargetName = 'document' | 'window' | 'body';
  4887. type GlobalTargetResolver = (element: any) => EventTarget;
  4888. /**
  4889. * Procedural style of API needed to create elements and text nodes.
  4890. *
  4891. * In non-native browser environments (e.g. platforms such as web-workers), this is the
  4892. * facade that enables element manipulation. In practice, this is implemented by `Renderer2`.
  4893. */
  4894. interface Renderer {
  4895. destroy(): void;
  4896. createComment(value: string): RComment;
  4897. createElement(name: string, namespace?: string | null): RElement;
  4898. createText(value: string): RText;
  4899. /**
  4900. * This property is allowed to be null / undefined,
  4901. * in which case the view engine won't call it.
  4902. * This is used as a performance optimization for production mode.
  4903. */
  4904. destroyNode?: ((node: RNode) => void) | null;
  4905. appendChild(parent: RElement, newChild: RNode): void;
  4906. insertBefore(parent: RNode, newChild: RNode, refChild: RNode | null, isMove?: boolean): void;
  4907. removeChild(parent: RElement | null, oldChild: RNode, isHostElement?: boolean): void;
  4908. selectRootElement(selectorOrNode: string | any, preserveContent?: boolean): RElement;
  4909. parentNode(node: RNode): RElement | null;
  4910. nextSibling(node: RNode): RNode | null;
  4911. setAttribute(el: RElement, name: string, value: string | TrustedHTML | TrustedScript | TrustedScriptURL, namespace?: string | null): void;
  4912. removeAttribute(el: RElement, name: string, namespace?: string | null): void;
  4913. addClass(el: RElement, name: string): void;
  4914. removeClass(el: RElement, name: string): void;
  4915. setStyle(el: RElement, style: string, value: any, flags?: RendererStyleFlags2): void;
  4916. removeStyle(el: RElement, style: string, flags?: RendererStyleFlags2): void;
  4917. setProperty(el: RElement, name: string, value: any): void;
  4918. setValue(node: RText | RComment, value: string): void;
  4919. listen(target: GlobalTargetName | RNode, eventName: string, callback: (event: any) => boolean | void, options?: ListenerOptions): () => void;
  4920. }
  4921. interface RendererFactory {
  4922. createRenderer(hostElement: RElement | null, rendererType: RendererType2 | null): Renderer;
  4923. begin?(): void;
  4924. end?(): void;
  4925. }
  4926. declare const HOST = 0;
  4927. declare const TVIEW = 1;
  4928. declare const FLAGS = 2;
  4929. declare const PARENT = 3;
  4930. declare const NEXT = 4;
  4931. declare const T_HOST = 5;
  4932. declare const HYDRATION = 6;
  4933. declare const CLEANUP = 7;
  4934. declare const CONTEXT = 8;
  4935. declare const INJECTOR$1 = 9;
  4936. declare const ENVIRONMENT = 10;
  4937. declare const RENDERER = 11;
  4938. declare const CHILD_HEAD = 12;
  4939. declare const CHILD_TAIL = 13;
  4940. declare const DECLARATION_VIEW = 14;
  4941. declare const DECLARATION_COMPONENT_VIEW = 15;
  4942. declare const DECLARATION_LCONTAINER = 16;
  4943. declare const PREORDER_HOOK_FLAGS = 17;
  4944. declare const QUERIES = 18;
  4945. declare const ID = 19;
  4946. declare const EMBEDDED_VIEW_INJECTOR = 20;
  4947. declare const ON_DESTROY_HOOKS = 21;
  4948. declare const EFFECTS_TO_SCHEDULE = 22;
  4949. declare const EFFECTS = 23;
  4950. declare const REACTIVE_TEMPLATE_CONSUMER = 24;
  4951. declare const AFTER_RENDER_SEQUENCES_TO_ADD = 25;
  4952. interface OpaqueViewState {
  4953. '__brand__': 'Brand for OpaqueViewState that nothing will match';
  4954. }
  4955. /**
  4956. * `LView` stores all of the information needed to process the instructions as
  4957. * they are invoked from the template. Each embedded view and component view has its
  4958. * own `LView`. When processing a particular view, we set the `viewData` to that
  4959. * `LView`. When that view is done processing, the `viewData` is set back to
  4960. * whatever the original `viewData` was before (the parent `LView`).
  4961. *
  4962. * Keeping separate state for each view facilities view insertion / deletion, so we
  4963. * don't have to edit the data array based on which views are present.
  4964. */
  4965. interface LView<T = unknown> extends Array<any> {
  4966. /**
  4967. * The node into which this `LView` is inserted.
  4968. */
  4969. [HOST]: RElement | null;
  4970. /**
  4971. * The static data for this view. We need a reference to this so we can easily walk up the
  4972. * node tree in DI and get the TView.data array associated with a node (where the
  4973. * directive defs are stored).
  4974. */
  4975. readonly [TVIEW]: TView;
  4976. /** Flags for this view. See LViewFlags for more info. */
  4977. [FLAGS]: LViewFlags;
  4978. /**
  4979. * This may store an {@link LView} or {@link LContainer}.
  4980. *
  4981. * `LView` - The parent view. This is needed when we exit the view and must restore the previous
  4982. * LView. Without this, the render method would have to keep a stack of
  4983. * views as it is recursively rendering templates.
  4984. *
  4985. * `LContainer` - The current view is part of a container, and is an embedded view.
  4986. */
  4987. [PARENT]: LView | LContainer | null;
  4988. /**
  4989. *
  4990. * The next sibling LView or LContainer.
  4991. *
  4992. * Allows us to propagate between sibling view states that aren't in the same
  4993. * container. Embedded views already have a node.next, but it is only set for
  4994. * views in the same container. We need a way to link component views and views
  4995. * across containers as well.
  4996. */
  4997. [NEXT]: LView | LContainer | null;
  4998. /** Queries active for this view - nodes from a view are reported to those queries. */
  4999. [QUERIES]: LQueries | null;
  5000. /**
  5001. * Store the `TNode` of the location where the current `LView` is inserted into.
  5002. *
  5003. * Given:
  5004. * ```html
  5005. * <div>
  5006. * <ng-template><span></span></ng-template>
  5007. * </div>
  5008. * ```
  5009. *
  5010. * We end up with two `TView`s.
  5011. * - `parent` `TView` which contains `<div><!-- anchor --></div>`
  5012. * - `child` `TView` which contains `<span></span>`
  5013. *
  5014. * Typically the `child` is inserted into the declaration location of the `parent`, but it can be
  5015. * inserted anywhere. Because it can be inserted anywhere it is not possible to store the
  5016. * insertion information in the `TView` and instead we must store it in the `LView[T_HOST]`.
  5017. *
  5018. * So to determine where is our insertion parent we would execute:
  5019. * ```ts
  5020. * const parentLView = lView[PARENT];
  5021. * const parentTNode = lView[T_HOST];
  5022. * const insertionParent = parentLView[parentTNode.index];
  5023. * ```
  5024. *
  5025. *
  5026. * If `null`, this is the root view of an application (root component is in this view) and it has
  5027. * no parents.
  5028. */
  5029. [T_HOST]: TNode | null;
  5030. /**
  5031. * When a view is destroyed, listeners need to be released and outputs need to be
  5032. * unsubscribed. This context array stores both listener functions wrapped with
  5033. * their context and output subscription instances for a particular view.
  5034. *
  5035. * These change per LView instance, so they cannot be stored on TView. Instead,
  5036. * TView.cleanup saves an index to the necessary context in this array.
  5037. *
  5038. * After `LView` is created it is possible to attach additional instance specific functions at the
  5039. * end of the `lView[CLEANUP]` because we know that no more `T` level cleanup functions will be
  5040. * added here.
  5041. */
  5042. [CLEANUP]: any[] | null;
  5043. /**
  5044. * - For dynamic views, this is the context with which to render the template (e.g.
  5045. * `NgForContext`), or `{}` if not defined explicitly.
  5046. * - For root view of the root component it's a reference to the component instance itself.
  5047. * - For components, the context is a reference to the component instance itself.
  5048. * - For inline views, the context is null.
  5049. */
  5050. [CONTEXT]: T;
  5051. /** A Module Injector to be used as fall back after Element Injectors are consulted. */
  5052. readonly [INJECTOR$1]: Injector;
  5053. /**
  5054. * Contextual data that is shared across multiple instances of `LView` in the same application.
  5055. */
  5056. [ENVIRONMENT]: LViewEnvironment;
  5057. /** Renderer to be used for this view. */
  5058. [RENDERER]: Renderer;
  5059. /**
  5060. * Reference to the first LView or LContainer beneath this LView in
  5061. * the hierarchy.
  5062. *
  5063. * Necessary to store this so views can traverse through their nested views
  5064. * to remove listeners and call onDestroy callbacks.
  5065. */
  5066. [CHILD_HEAD]: LView | LContainer | null;
  5067. /**
  5068. * The last LView or LContainer beneath this LView in the hierarchy.
  5069. *
  5070. * The tail allows us to quickly add a new state to the end of the view list
  5071. * without having to propagate starting from the first child.
  5072. */
  5073. [CHILD_TAIL]: LView | LContainer | null;
  5074. /**
  5075. * View where this view's template was declared.
  5076. *
  5077. * The template for a dynamically created view may be declared in a different view than
  5078. * it is inserted. We already track the "insertion view" (view where the template was
  5079. * inserted) in LView[PARENT], but we also need access to the "declaration view"
  5080. * (view where the template was declared). Otherwise, we wouldn't be able to call the
  5081. * view's template function with the proper contexts. Context should be inherited from
  5082. * the declaration view tree, not the insertion view tree.
  5083. *
  5084. * Example (AppComponent template):
  5085. *
  5086. * <ng-template #foo></ng-template> <-- declared here -->
  5087. * <some-comp [tpl]="foo"></some-comp> <-- inserted inside this component -->
  5088. *
  5089. * The <ng-template> above is declared in the AppComponent template, but it will be passed into
  5090. * SomeComp and inserted there. In this case, the declaration view would be the AppComponent,
  5091. * but the insertion view would be SomeComp. When we are removing views, we would want to
  5092. * traverse through the insertion view to clean up listeners. When we are calling the
  5093. * template function during change detection, we need the declaration view to get inherited
  5094. * context.
  5095. */
  5096. [DECLARATION_VIEW]: LView | null;
  5097. /**
  5098. * Points to the declaration component view, used to track transplanted `LView`s.
  5099. *
  5100. * See: `DECLARATION_VIEW` which points to the actual `LView` where it was declared, whereas
  5101. * `DECLARATION_COMPONENT_VIEW` points to the component which may not be same as
  5102. * `DECLARATION_VIEW`.
  5103. *
  5104. * Example:
  5105. * ```html
  5106. * <#VIEW #myComp>
  5107. * <div *ngIf="true">
  5108. * <ng-template #myTmpl>...</ng-template>
  5109. * </div>
  5110. * </#VIEW>
  5111. * ```
  5112. * In the above case `DECLARATION_VIEW` for `myTmpl` points to the `LView` of `ngIf` whereas
  5113. * `DECLARATION_COMPONENT_VIEW` points to `LView` of the `myComp` which owns the template.
  5114. *
  5115. * The reason for this is that all embedded views are always check-always whereas the component
  5116. * view can be check-always or on-push. When we have a transplanted view it is important to
  5117. * determine if we have transplanted a view from check-always declaration to on-push insertion
  5118. * point. In such a case the transplanted view needs to be added to the `LContainer` in the
  5119. * declared `LView` and CD during the declared view CD (in addition to the CD at the insertion
  5120. * point.) (Any transplanted views which are intra Component are of no interest because the CD
  5121. * strategy of declaration and insertion will always be the same, because it is the same
  5122. * component.)
  5123. *
  5124. * Queries already track moved views in `LView[DECLARATION_LCONTAINER]` and
  5125. * `LContainer[MOVED_VIEWS]`. However the queries also track `LView`s which moved within the same
  5126. * component `LView`. Transplanted views are a subset of moved views, and we use
  5127. * `DECLARATION_COMPONENT_VIEW` to differentiate them. As in this example.
  5128. *
  5129. * Example showing intra component `LView` movement.
  5130. * ```html
  5131. * <#VIEW #myComp>
  5132. * <div *ngIf="condition; then thenBlock else elseBlock"></div>
  5133. * <ng-template #thenBlock>Content to render when condition is true.</ng-template>
  5134. * <ng-template #elseBlock>Content to render when condition is false.</ng-template>
  5135. * </#VIEW>
  5136. * ```
  5137. * The `thenBlock` and `elseBlock` is moved but not transplanted.
  5138. *
  5139. * Example showing inter component `LView` movement (transplanted view).
  5140. * ```html
  5141. * <#VIEW #myComp>
  5142. * <ng-template #myTmpl>...</ng-template>
  5143. * <insertion-component [template]="myTmpl"></insertion-component>
  5144. * </#VIEW>
  5145. * ```
  5146. * In the above example `myTmpl` is passed into a different component. If `insertion-component`
  5147. * instantiates `myTmpl` and `insertion-component` is on-push then the `LContainer` needs to be
  5148. * marked as containing transplanted views and those views need to be CD as part of the
  5149. * declaration CD.
  5150. *
  5151. *
  5152. * When change detection runs, it iterates over `[MOVED_VIEWS]` and CDs any child `LView`s where
  5153. * the `DECLARATION_COMPONENT_VIEW` of the current component and the child `LView` does not match
  5154. * (it has been transplanted across components.)
  5155. *
  5156. * Note: `[DECLARATION_COMPONENT_VIEW]` points to itself if the LView is a component view (the
  5157. * simplest / most common case).
  5158. *
  5159. * see also:
  5160. * - https://hackmd.io/@mhevery/rJUJsvv9H write up of the problem
  5161. * - `LContainer[HAS_TRANSPLANTED_VIEWS]` which marks which `LContainer` has transplanted views.
  5162. * - `LContainer[TRANSPLANT_HEAD]` and `LContainer[TRANSPLANT_TAIL]` storage for transplanted
  5163. * - `LView[DECLARATION_LCONTAINER]` similar problem for queries
  5164. * - `LContainer[MOVED_VIEWS]` similar problem for queries
  5165. */
  5166. [DECLARATION_COMPONENT_VIEW]: LView;
  5167. /**
  5168. * A declaration point of embedded views (ones instantiated based on the content of a
  5169. * <ng-template>), null for other types of views.
  5170. *
  5171. * We need to track all embedded views created from a given declaration point so we can prepare
  5172. * query matches in a proper order (query matches are ordered based on their declaration point and
  5173. * _not_ the insertion point).
  5174. */
  5175. [DECLARATION_LCONTAINER]: LContainer | null;
  5176. /**
  5177. * More flags for this view. See PreOrderHookFlags for more info.
  5178. */
  5179. [PREORDER_HOOK_FLAGS]: PreOrderHookFlags;
  5180. /** Unique ID of the view. Used for `__ngContext__` lookups in the `LView` registry. */
  5181. [ID]: number;
  5182. /**
  5183. * A container related to hydration annotation information that's associated with this LView.
  5184. */
  5185. [HYDRATION]: DehydratedView | null;
  5186. /**
  5187. * Optional injector assigned to embedded views that takes
  5188. * precedence over the element and module injectors.
  5189. */
  5190. readonly [EMBEDDED_VIEW_INJECTOR]: Injector | null;
  5191. /**
  5192. * Effect scheduling operations that need to run during this views's update pass.
  5193. */
  5194. [EFFECTS_TO_SCHEDULE]: Array<() => void> | null;
  5195. [EFFECTS]: Set<ViewEffectNode> | null;
  5196. /**
  5197. * A collection of callbacks functions that are executed when a given LView is destroyed. Those
  5198. * are user defined, LView-specific destroy callbacks that don't have any corresponding TView
  5199. * entries.
  5200. */
  5201. [ON_DESTROY_HOOKS]: Array<() => void> | null;
  5202. /**
  5203. * The `Consumer` for this `LView`'s template so that signal reads can be tracked.
  5204. *
  5205. * This is initially `null` and gets assigned a consumer after template execution
  5206. * if any signals were read.
  5207. */
  5208. [REACTIVE_TEMPLATE_CONSUMER]: ReactiveLViewConsumer | null;
  5209. [AFTER_RENDER_SEQUENCES_TO_ADD]: AfterRenderSequence[] | null;
  5210. }
  5211. /**
  5212. * Contextual data that is shared across multiple instances of `LView` in the same application.
  5213. */
  5214. interface LViewEnvironment {
  5215. /** Factory to be used for creating Renderer. */
  5216. rendererFactory: RendererFactory;
  5217. /** An optional custom sanitizer. */
  5218. sanitizer: Sanitizer | null;
  5219. /** Scheduler for change detection to notify when application state changes. */
  5220. changeDetectionScheduler: ChangeDetectionScheduler | null;
  5221. }
  5222. /** Flags associated with an LView (saved in LView[FLAGS]) */
  5223. declare const enum LViewFlags {
  5224. /** The state of the init phase on the first 2 bits */
  5225. InitPhaseStateIncrementer = 1,
  5226. InitPhaseStateMask = 3,
  5227. /**
  5228. * Whether or not the view is in creationMode.
  5229. *
  5230. * This must be stored in the view rather than using `data` as a marker so that
  5231. * we can properly support embedded views. Otherwise, when exiting a child view
  5232. * back into the parent view, `data` will be defined and `creationMode` will be
  5233. * improperly reported as false.
  5234. */
  5235. CreationMode = 4,
  5236. /**
  5237. * Whether or not this LView instance is on its first processing pass.
  5238. *
  5239. * An LView instance is considered to be on its "first pass" until it
  5240. * has completed one creation mode run and one update mode run. At this
  5241. * time, the flag is turned off.
  5242. */
  5243. FirstLViewPass = 8,
  5244. /** Whether this view has default change detection strategy (checks always) or onPush */
  5245. CheckAlways = 16,
  5246. /** Whether there are any i18n blocks inside this LView. */
  5247. HasI18n = 32,
  5248. /** Whether or not this view is currently dirty (needing check) */
  5249. Dirty = 64,
  5250. /** Whether or not this view is currently attached to change detection tree. */
  5251. Attached = 128,
  5252. /** Whether or not this view is destroyed. */
  5253. Destroyed = 256,
  5254. /** Whether or not this view is the root view */
  5255. IsRoot = 512,
  5256. /**
  5257. * Whether this moved LView needs to be refreshed. Similar to the Dirty flag, but used for
  5258. * transplanted and signal views where the parent/ancestor views are not marked dirty as well.
  5259. * i.e. "Refresh just this view". Used in conjunction with the HAS_CHILD_VIEWS_TO_REFRESH
  5260. * flag.
  5261. */
  5262. RefreshView = 1024,
  5263. /** Indicates that the view **or any of its ancestors** have an embedded view injector. */
  5264. HasEmbeddedViewInjector = 2048,
  5265. /** Indicates that the view was created with `signals: true`. */
  5266. SignalView = 4096,
  5267. /**
  5268. * Indicates that this LView has a view underneath it that needs to be refreshed during change
  5269. * detection. This flag indicates that even if this view is not dirty itself, we still need to
  5270. * traverse its children during change detection.
  5271. */
  5272. HasChildViewsToRefresh = 8192,
  5273. /**
  5274. * This is the count of the bits the 1 was shifted above (base 10)
  5275. */
  5276. IndexWithinInitPhaseShift = 14,
  5277. /**
  5278. * Index of the current init phase on last 21 bits
  5279. */
  5280. IndexWithinInitPhaseIncrementer = 16384,
  5281. IndexWithinInitPhaseReset = 16383
  5282. }
  5283. /** More flags associated with an LView (saved in LView[PREORDER_HOOK_FLAGS]) */
  5284. declare const enum PreOrderHookFlags {
  5285. /**
  5286. The index of the next pre-order hook to be called in the hooks array, on the first 16
  5287. bits
  5288. */
  5289. IndexOfTheNextPreOrderHookMaskMask = 65535,
  5290. /**
  5291. * The number of init hooks that have already been called, on the last 16 bits
  5292. */
  5293. NumberOfInitHooksCalledIncrementer = 65536,
  5294. NumberOfInitHooksCalledShift = 16,
  5295. NumberOfInitHooksCalledMask = 4294901760
  5296. }
  5297. /**
  5298. * Stores a set of OpCodes to process `HostBindingsFunction` associated with a current view.
  5299. *
  5300. * In order to invoke `HostBindingsFunction` we need:
  5301. * 1. 'elementIdx`: Index to the element associated with the `HostBindingsFunction`.
  5302. * 2. 'directiveIdx`: Index to the directive associated with the `HostBindingsFunction`. (This will
  5303. * become the context for the `HostBindingsFunction` invocation.)
  5304. * 3. `bindingRootIdx`: Location where the bindings for the `HostBindingsFunction` start. Internally
  5305. * `HostBindingsFunction` binding indexes start from `0` so we need to add `bindingRootIdx` to
  5306. * it.
  5307. * 4. `HostBindingsFunction`: A host binding function to execute.
  5308. *
  5309. * The above information needs to be encoded into the `HostBindingOpCodes` in an efficient manner.
  5310. *
  5311. * 1. `elementIdx` is encoded into the `HostBindingOpCodes` as `~elementIdx` (so a negative number);
  5312. * 2. `directiveIdx`
  5313. * 3. `bindingRootIdx`
  5314. * 4. `HostBindingsFunction` is passed in as is.
  5315. *
  5316. * The `HostBindingOpCodes` array contains:
  5317. * - negative number to select the element index.
  5318. * - followed by 1 or more of:
  5319. * - a number to select the directive index
  5320. * - a number to select the bindingRoot index
  5321. * - and a function to invoke.
  5322. *
  5323. * ## Example
  5324. *
  5325. * ```ts
  5326. * const hostBindingOpCodes = [
  5327. * ~30, // Select element 30
  5328. * 40, 45, MyDir.ɵdir.hostBindings // Invoke host bindings on MyDir on element 30;
  5329. * // directiveIdx = 40; bindingRootIdx = 45;
  5330. * 50, 55, OtherDir.ɵdir.hostBindings // Invoke host bindings on OtherDire on element 30
  5331. * // directiveIdx = 50; bindingRootIdx = 55;
  5332. * ]
  5333. * ```
  5334. *
  5335. * ## Pseudocode
  5336. * ```ts
  5337. * const hostBindingOpCodes = tView.hostBindingOpCodes;
  5338. * if (hostBindingOpCodes === null) return;
  5339. * for (let i = 0; i < hostBindingOpCodes.length; i++) {
  5340. * const opCode = hostBindingOpCodes[i] as number;
  5341. * if (opCode < 0) {
  5342. * // Negative numbers are element indexes.
  5343. * setSelectedIndex(~opCode);
  5344. * } else {
  5345. * // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.
  5346. * const directiveIdx = opCode;
  5347. * const bindingRootIndx = hostBindingOpCodes[++i] as number;
  5348. * const hostBindingFn = hostBindingOpCodes[++i] as HostBindingsFunction<any>;
  5349. * setBindingRootForHostBindings(bindingRootIndx, directiveIdx);
  5350. * const context = lView[directiveIdx];
  5351. * hostBindingFn(RenderFlags.Update, context);
  5352. * }
  5353. * }
  5354. * ```
  5355. *
  5356. */
  5357. interface HostBindingOpCodes extends Array<number | HostBindingsFunction<any>> {
  5358. __brand__: 'HostBindingOpCodes';
  5359. debug?: string[];
  5360. }
  5361. /**
  5362. * Explicitly marks `TView` as a specific type in `ngDevMode`
  5363. *
  5364. * It is useful to know conceptually what time of `TView` we are dealing with when
  5365. * debugging an application (even if the runtime does not need it.) For this reason
  5366. * we store this information in the `ngDevMode` `TView` and than use it for
  5367. * better debugging experience.
  5368. */
  5369. declare const enum TViewType {
  5370. /**
  5371. * Root `TView` is the used to bootstrap components into. It is used in conjunction with
  5372. * `LView` which takes an existing DOM node not owned by Angular and wraps it in `TView`/`LView`
  5373. * so that other components can be loaded into it.
  5374. */
  5375. Root = 0,
  5376. /**
  5377. * `TView` associated with a Component. This would be the `TView` directly associated with the
  5378. * component view (as opposed an `Embedded` `TView` which would be a child of `Component` `TView`)
  5379. */
  5380. Component = 1,
  5381. /**
  5382. * `TView` associated with a template. Such as `*ngIf`, `<ng-template>` etc... A `Component`
  5383. * can have zero or more `Embedded` `TView`s.
  5384. */
  5385. Embedded = 2
  5386. }
  5387. /**
  5388. * The static data for an LView (shared between all templates of a
  5389. * given type).
  5390. *
  5391. * Stored on the `ComponentDef.tView`.
  5392. */
  5393. interface TView {
  5394. /**
  5395. * Type of `TView` (`Root`|`Component`|`Embedded`).
  5396. */
  5397. type: TViewType;
  5398. /**
  5399. * This is a blueprint used to generate LView instances for this TView. Copying this
  5400. * blueprint is faster than creating a new LView from scratch.
  5401. */
  5402. blueprint: LView;
  5403. /**
  5404. * The template function used to refresh the view of dynamically created views
  5405. * and components. Will be null for inline views.
  5406. */
  5407. template: ComponentTemplate<{}> | null;
  5408. /**
  5409. * A function containing query-related instructions.
  5410. */
  5411. viewQuery: ViewQueriesFunction<{}> | null;
  5412. /**
  5413. * A `TNode` representing the declaration location of this `TView` (not part of this TView).
  5414. */
  5415. declTNode: TNode | null;
  5416. /** Whether or not this template has been processed in creation mode. */
  5417. firstCreatePass: boolean;
  5418. /**
  5419. * Whether or not this template has been processed in update mode (e.g. change detected)
  5420. *
  5421. * `firstUpdatePass` is used by styling to set up `TData` to contain metadata about the styling
  5422. * instructions. (Mainly to build up a linked list of styling priority order.)
  5423. *
  5424. * Typically this function gets cleared after first execution. If exception is thrown then this
  5425. * flag can remain turned un until there is first successful (no exception) pass. This means that
  5426. * individual styling instructions keep track of if they have already been added to the linked
  5427. * list to prevent double adding.
  5428. */
  5429. firstUpdatePass: boolean;
  5430. /** Static data equivalent of LView.data[]. Contains TNodes, PipeDefInternal or TI18n. */
  5431. data: TData;
  5432. /**
  5433. * The binding start index is the index at which the data array
  5434. * starts to store bindings only. Saving this value ensures that we
  5435. * will begin reading bindings at the correct point in the array when
  5436. * we are in update mode.
  5437. *
  5438. * -1 means that it has not been initialized.
  5439. */
  5440. bindingStartIndex: number;
  5441. /**
  5442. * The index where the "expando" section of `LView` begins. The expando
  5443. * section contains injectors, directive instances, and host binding values.
  5444. * Unlike the "decls" and "vars" sections of `LView`, the length of this
  5445. * section cannot be calculated at compile-time because directives are matched
  5446. * at runtime to preserve locality.
  5447. *
  5448. * We store this start index so we know where to start checking host bindings
  5449. * in `setHostBindings`.
  5450. */
  5451. expandoStartIndex: number;
  5452. /**
  5453. * Whether or not there are any static view queries tracked on this view.
  5454. *
  5455. * We store this so we know whether or not we should do a view query
  5456. * refresh after creation mode to collect static query results.
  5457. */
  5458. staticViewQueries: boolean;
  5459. /**
  5460. * Whether or not there are any static content queries tracked on this view.
  5461. *
  5462. * We store this so we know whether or not we should do a content query
  5463. * refresh after creation mode to collect static query results.
  5464. */
  5465. staticContentQueries: boolean;
  5466. /**
  5467. * A reference to the first child node located in the view.
  5468. */
  5469. firstChild: TNode | null;
  5470. /**
  5471. * Stores the OpCodes to be replayed during change-detection to process the `HostBindings`
  5472. *
  5473. * See `HostBindingOpCodes` for encoding details.
  5474. */
  5475. hostBindingOpCodes: HostBindingOpCodes | null;
  5476. /**
  5477. * Full registry of directives and components that may be found in this view.
  5478. *
  5479. * It's necessary to keep a copy of the full def list on the TView so it's possible
  5480. * to render template functions without a host component.
  5481. */
  5482. directiveRegistry: DirectiveDefList | null;
  5483. /**
  5484. * Full registry of pipes that may be found in this view.
  5485. *
  5486. * The property is either an array of `PipeDefs`s or a function which returns the array of
  5487. * `PipeDefs`s. The function is necessary to be able to support forward declarations.
  5488. *
  5489. * It's necessary to keep a copy of the full def list on the TView so it's possible
  5490. * to render template functions without a host component.
  5491. */
  5492. pipeRegistry: PipeDefList | null;
  5493. /**
  5494. * Array of ngOnInit, ngOnChanges and ngDoCheck hooks that should be executed for this view in
  5495. * creation mode.
  5496. *
  5497. * This array has a flat structure and contains TNode indices, directive indices (where an
  5498. * instance can be found in `LView`) and hook functions. TNode index is followed by the directive
  5499. * index and a hook function. If there are multiple hooks for a given TNode, the TNode index is
  5500. * not repeated and the next lifecycle hook information is stored right after the previous hook
  5501. * function. This is done so that at runtime the system can efficiently iterate over all of the
  5502. * functions to invoke without having to make any decisions/lookups.
  5503. */
  5504. preOrderHooks: HookData | null;
  5505. /**
  5506. * Array of ngOnChanges and ngDoCheck hooks that should be executed for this view in update mode.
  5507. *
  5508. * This array has the same structure as the `preOrderHooks` one.
  5509. */
  5510. preOrderCheckHooks: HookData | null;
  5511. /**
  5512. * Array of ngAfterContentInit and ngAfterContentChecked hooks that should be executed
  5513. * for this view in creation mode.
  5514. *
  5515. * Even indices: Directive index
  5516. * Odd indices: Hook function
  5517. */
  5518. contentHooks: HookData | null;
  5519. /**
  5520. * Array of ngAfterContentChecked hooks that should be executed for this view in update
  5521. * mode.
  5522. *
  5523. * Even indices: Directive index
  5524. * Odd indices: Hook function
  5525. */
  5526. contentCheckHooks: HookData | null;
  5527. /**
  5528. * Array of ngAfterViewInit and ngAfterViewChecked hooks that should be executed for
  5529. * this view in creation mode.
  5530. *
  5531. * Even indices: Directive index
  5532. * Odd indices: Hook function
  5533. */
  5534. viewHooks: HookData | null;
  5535. /**
  5536. * Array of ngAfterViewChecked hooks that should be executed for this view in
  5537. * update mode.
  5538. *
  5539. * Even indices: Directive index
  5540. * Odd indices: Hook function
  5541. */
  5542. viewCheckHooks: HookData | null;
  5543. /**
  5544. * Array of ngOnDestroy hooks that should be executed when this view is destroyed.
  5545. *
  5546. * Even indices: Directive index
  5547. * Odd indices: Hook function
  5548. */
  5549. destroyHooks: DestroyHookData | null;
  5550. /**
  5551. * When a view is destroyed, listeners need to be released and outputs need to be
  5552. * unsubscribed. This cleanup array stores both listener data (in chunks of 4)
  5553. * and output data (in chunks of 2) for a particular view. Combining the arrays
  5554. * saves on memory (70 bytes per array) and on a few bytes of code size (for two
  5555. * separate for loops).
  5556. *
  5557. * If it's a native DOM listener or output subscription being stored:
  5558. * 1st index is: event name `name = tView.cleanup[i+0]`
  5559. * 2nd index is: index of native element or a function that retrieves global target (window,
  5560. * document or body) reference based on the native element:
  5561. * `typeof idxOrTargetGetter === 'function'`: global target getter function
  5562. * `typeof idxOrTargetGetter === 'number'`: index of native element
  5563. *
  5564. * 3rd index is: index of listener function `listener = lView[CLEANUP][tView.cleanup[i+2]]`
  5565. * 4th index is: `useCaptureOrIndx = tView.cleanup[i+3]`
  5566. * `typeof useCaptureOrIndx == 'boolean' : useCapture boolean
  5567. * `typeof useCaptureOrIndx == 'number':
  5568. * `useCaptureOrIndx >= 0` `removeListener = LView[CLEANUP][useCaptureOrIndx]`
  5569. * `useCaptureOrIndx < 0` `subscription = LView[CLEANUP][-useCaptureOrIndx]`
  5570. *
  5571. * If it's an output subscription or query list destroy hook:
  5572. * 1st index is: output unsubscribe function / query list destroy function
  5573. * 2nd index is: index of function context in LView.cleanupInstances[]
  5574. * `tView.cleanup[i+0].call(lView[CLEANUP][tView.cleanup[i+1]])`
  5575. */
  5576. cleanup: any[] | null;
  5577. /**
  5578. * A list of element indices for child components that will need to be
  5579. * refreshed when the current view has finished its check. These indices have
  5580. * already been adjusted for the HEADER_OFFSET.
  5581. *
  5582. */
  5583. components: number[] | null;
  5584. /**
  5585. * A collection of queries tracked in a given view.
  5586. */
  5587. queries: TQueries | null;
  5588. /**
  5589. * An array of indices pointing to directives with content queries alongside with the
  5590. * corresponding query index. Each entry in this array is a tuple of:
  5591. * - index of the first content query index declared by a given directive;
  5592. * - index of a directive.
  5593. *
  5594. * We are storing those indexes so we can refresh content queries as part of a view refresh
  5595. * process.
  5596. */
  5597. contentQueries: number[] | null;
  5598. /**
  5599. * Set of schemas that declare elements to be allowed inside the view.
  5600. */
  5601. schemas: SchemaMetadata[] | null;
  5602. /**
  5603. * Array of constants for the view. Includes attribute arrays, local definition arrays etc.
  5604. * Used for directive matching, attribute bindings, local definitions and more.
  5605. */
  5606. consts: TConstants | null;
  5607. /**
  5608. * Indicates that there was an error before we managed to complete the first create pass of the
  5609. * view. This means that the view is likely corrupted and we should try to recover it.
  5610. */
  5611. incompleteFirstPass: boolean;
  5612. /**
  5613. * Unique id of this TView for hydration purposes:
  5614. * - TViewType.Embedded: a unique id generated during serialization on the server
  5615. * - TViewType.Component: an id generated based on component properties
  5616. * (see `getComponentId` function for details)
  5617. */
  5618. ssrId: string | null;
  5619. }
  5620. /** Single hook callback function. */
  5621. type HookFn = () => void;
  5622. /**
  5623. * Information necessary to call a hook. E.g. the callback that
  5624. * needs to invoked and the index at which to find its context.
  5625. */
  5626. type HookEntry = number | HookFn;
  5627. /**
  5628. * Array of hooks that should be executed for a view and their directive indices.
  5629. *
  5630. * For each node of the view, the following data is stored:
  5631. * 1) Node index (optional)
  5632. * 2) A series of number/function pairs where:
  5633. * - even indices are directive indices
  5634. * - odd indices are hook functions
  5635. *
  5636. * Special cases:
  5637. * - a negative directive index flags an init hook (ngOnInit, ngAfterContentInit, ngAfterViewInit)
  5638. */
  5639. type HookData = HookEntry[];
  5640. /**
  5641. * Array of destroy hooks that should be executed for a view and their directive indices.
  5642. *
  5643. * The array is set up as a series of number/function or number/(number|function)[]:
  5644. * - Even indices represent the context with which hooks should be called.
  5645. * - Odd indices are the hook functions themselves. If a value at an odd index is an array,
  5646. * it represents the destroy hooks of a `multi` provider where:
  5647. * - Even indices represent the index of the provider for which we've registered a destroy hook,
  5648. * inside of the `multi` provider array.
  5649. * - Odd indices are the destroy hook functions.
  5650. * For example:
  5651. * LView: `[0, 1, 2, AService, 4, [BService, CService, DService]]`
  5652. * destroyHooks: `[3, AService.ngOnDestroy, 5, [0, BService.ngOnDestroy, 2, DService.ngOnDestroy]]`
  5653. *
  5654. * In the example above `AService` is a type provider with an `ngOnDestroy`, whereas `BService`,
  5655. * `CService` and `DService` are part of a `multi` provider where only `BService` and `DService`
  5656. * have an `ngOnDestroy` hook.
  5657. */
  5658. type DestroyHookData = (HookEntry | HookData)[];
  5659. /**
  5660. * Static data that corresponds to the instance-specific data array on an LView.
  5661. *
  5662. * Each node's static data is stored in tData at the same index that it's stored
  5663. * in the data array. Any nodes that do not have static data store a null value in
  5664. * tData to avoid a sparse array.
  5665. *
  5666. * Each pipe's definition is stored here at the same index as its pipe instance in
  5667. * the data array.
  5668. *
  5669. * Each host property's name is stored here at the same index as its value in the
  5670. * data array.
  5671. *
  5672. * Each property binding name is stored here at the same index as its value in
  5673. * the data array. If the binding is an interpolation, the static string values
  5674. * are stored parallel to the dynamic values. Example:
  5675. *
  5676. * id="prefix {{ v0 }} a {{ v1 }} b {{ v2 }} suffix"
  5677. *
  5678. * LView | TView.data
  5679. *------------------------
  5680. * v0 value | 'a'
  5681. * v1 value | 'b'
  5682. * v2 value | id � prefix � suffix
  5683. *
  5684. * Injector bloom filters are also stored here.
  5685. */
  5686. type TData = (TNode | PipeDef<any> | DirectiveDef<any> | ComponentDef<any> | number | TStylingRange | TStylingKey | ProviderToken<any> | TI18n | I18nUpdateOpCodes | TIcu | null | string | TDeferBlockDetails)[];
  5687. /**
  5688. * `DestroyRef` lets you set callbacks to run for any cleanup or destruction behavior.
  5689. * The scope of this destruction depends on where `DestroyRef` is injected. If `DestroyRef`
  5690. * is injected in a component or directive, the callbacks run when that component or
  5691. * directive is destroyed. Otherwise the callbacks run when a corresponding injector is destroyed.
  5692. *
  5693. * @publicApi
  5694. */
  5695. declare abstract class DestroyRef {
  5696. /**
  5697. * Registers a destroy callback in a given lifecycle scope. Returns a cleanup function that can
  5698. * be invoked to unregister the callback.
  5699. *
  5700. * @usageNotes
  5701. * ### Example
  5702. * ```ts
  5703. * const destroyRef = inject(DestroyRef);
  5704. *
  5705. * // register a destroy callback
  5706. * const unregisterFn = destroyRef.onDestroy(() => doSomethingOnDestroy());
  5707. *
  5708. * // stop the destroy callback from executing if needed
  5709. * unregisterFn();
  5710. * ```
  5711. */
  5712. abstract onDestroy(callback: () => void): () => void;
  5713. }
  5714. /**
  5715. * An `OutputEmitterRef` is created by the `output()` function and can be
  5716. * used to emit values to consumers of your directive or component.
  5717. *
  5718. * Consumers of your directive/component can bind to the output and
  5719. * subscribe to changes via the bound event syntax. For example:
  5720. *
  5721. * ```html
  5722. * <my-comp (valueChange)="processNewValue($event)" />
  5723. * ```
  5724. *
  5725. * @publicAPI
  5726. */
  5727. declare class OutputEmitterRef<T> implements OutputRef<T> {
  5728. private destroyed;
  5729. private listeners;
  5730. private errorHandler;
  5731. constructor();
  5732. subscribe(callback: (value: T) => void): OutputRefSubscription;
  5733. /** Emits a new value to the output. */
  5734. emit(value: T): void;
  5735. }
  5736. /** Gets the owning `DestroyRef` for the given output. */
  5737. declare function getOutputDestroyRef(ref: OutputRef<unknown>): DestroyRef | undefined;
  5738. /**
  5739. * Options for declaring an output.
  5740. *
  5741. * @publicAPI
  5742. */
  5743. interface OutputOptions {
  5744. alias?: string;
  5745. }
  5746. /**
  5747. * The `output` function allows declaration of Angular outputs in
  5748. * directives and components.
  5749. *
  5750. * You can use outputs to emit values to parent directives and component.
  5751. * Parents can subscribe to changes via:
  5752. *
  5753. * - template event bindings. For example, `(myOutput)="doSomething($event)"`
  5754. * - programmatic subscription by using `OutputRef#subscribe`.
  5755. *
  5756. * @usageNotes
  5757. *
  5758. * To use `output()`, import the function from `@angular/core`.
  5759. *
  5760. * ```ts
  5761. * import {output} from '@angular/core';
  5762. * ```
  5763. *
  5764. * Inside your component, introduce a new class member and initialize
  5765. * it with a call to `output`.
  5766. *
  5767. * ```ts
  5768. * @Directive({
  5769. * ...
  5770. * })
  5771. * export class MyDir {
  5772. * nameChange = output<string>(); // OutputEmitterRef<string>
  5773. * onClick = output(); // OutputEmitterRef<void>
  5774. * }
  5775. * ```
  5776. *
  5777. * You can emit values to consumers of your directive, by using
  5778. * the `emit` method from `OutputEmitterRef`.
  5779. *
  5780. * ```ts
  5781. * updateName(newName: string): void {
  5782. * this.nameChange.emit(newName);
  5783. * }
  5784. * ```
  5785. * @initializerApiFunction {"showTypesInSignaturePreview": true}
  5786. * @publicAPI
  5787. */
  5788. declare function output<T = void>(opts?: OutputOptions): OutputEmitterRef<T>;
  5789. /**
  5790. * Type of the `viewChild` function. The viewChild function creates a singular view query.
  5791. *
  5792. * It is a special function that also provides access to required query results via the `.required`
  5793. * property.
  5794. *
  5795. * @publicAPI
  5796. * @docsPrivate Ignored because `viewChild` is the canonical API entry.
  5797. */
  5798. interface ViewChildFunction {
  5799. /**
  5800. * Initializes a view child query. Consider using `viewChild.required` for queries that should
  5801. * always match.
  5802. *
  5803. * @publicAPI
  5804. */
  5805. <LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  5806. read: ProviderToken<ReadT>;
  5807. debugName?: string;
  5808. }): Signal<ReadT | undefined>;
  5809. <LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  5810. debugName?: string;
  5811. }): Signal<LocatorT | undefined>;
  5812. /**
  5813. * Initializes a view child query that is expected to always match an element.
  5814. *
  5815. * @publicAPI
  5816. */
  5817. required: {
  5818. <LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  5819. debugName?: string;
  5820. }): Signal<LocatorT>;
  5821. <LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  5822. read: ProviderToken<ReadT>;
  5823. debugName?: string;
  5824. }): Signal<ReadT>;
  5825. };
  5826. }
  5827. /**
  5828. * Initializes a view child query.
  5829. *
  5830. * Consider using `viewChild.required` for queries that should always match.
  5831. *
  5832. * @usageNotes
  5833. * Create a child query in your component by declaring a
  5834. * class field and initializing it with the `viewChild()` function.
  5835. *
  5836. * ```angular-ts
  5837. * @Component({template: '<div #el></div><my-component #cmp />'})
  5838. * export class TestComponent {
  5839. * divEl = viewChild<ElementRef>('el'); // Signal<ElementRef|undefined>
  5840. * divElRequired = viewChild.required<ElementRef>('el'); // Signal<ElementRef>
  5841. * cmp = viewChild(MyComponent); // Signal<MyComponent|undefined>
  5842. * cmpRequired = viewChild.required(MyComponent); // Signal<MyComponent>
  5843. * }
  5844. * ```
  5845. *
  5846. * @publicAPI
  5847. * @initializerApiFunction
  5848. */
  5849. declare const viewChild: ViewChildFunction;
  5850. declare function viewChildren<LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  5851. debugName?: string;
  5852. }): Signal<ReadonlyArray<LocatorT>>;
  5853. declare function viewChildren<LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  5854. read: ProviderToken<ReadT>;
  5855. debugName?: string;
  5856. }): Signal<ReadonlyArray<ReadT>>;
  5857. /**
  5858. * Type of the `contentChild` function.
  5859. *
  5860. * The contentChild function creates a singular content query. It is a special function that also
  5861. * provides access to required query results via the `.required` property.
  5862. *
  5863. * @publicAPI
  5864. * @docsPrivate Ignored because `contentChild` is the canonical API entry.
  5865. */
  5866. interface ContentChildFunction {
  5867. /**
  5868. * Initializes a content child query.
  5869. *
  5870. * Consider using `contentChild.required` for queries that should always match.
  5871. * @publicAPI
  5872. */
  5873. <LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  5874. descendants?: boolean;
  5875. read?: undefined;
  5876. debugName?: string;
  5877. }): Signal<LocatorT | undefined>;
  5878. <LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  5879. descendants?: boolean;
  5880. read: ProviderToken<ReadT>;
  5881. debugName?: string;
  5882. }): Signal<ReadT | undefined>;
  5883. /**
  5884. * Initializes a content child query that is always expected to match.
  5885. */
  5886. required: {
  5887. <LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  5888. descendants?: boolean;
  5889. read?: undefined;
  5890. debugName?: string;
  5891. }): Signal<LocatorT>;
  5892. <LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  5893. descendants?: boolean;
  5894. read: ProviderToken<ReadT>;
  5895. debugName?: string;
  5896. }): Signal<ReadT>;
  5897. };
  5898. }
  5899. /**
  5900. * Initializes a content child query. Consider using `contentChild.required` for queries that should
  5901. * always match.
  5902. *
  5903. * @usageNotes
  5904. * Create a child query in your component by declaring a
  5905. * class field and initializing it with the `contentChild()` function.
  5906. *
  5907. * ```ts
  5908. * @Component({...})
  5909. * export class TestComponent {
  5910. * headerEl = contentChild<ElementRef>('h'); // Signal<ElementRef|undefined>
  5911. * headerElElRequired = contentChild.required<ElementRef>('h'); // Signal<ElementRef>
  5912. * header = contentChild(MyHeader); // Signal<MyHeader|undefined>
  5913. * headerRequired = contentChild.required(MyHeader); // Signal<MyHeader>
  5914. * }
  5915. * ```
  5916. *
  5917. * @initializerApiFunction
  5918. * @publicAPI
  5919. */
  5920. declare const contentChild: ContentChildFunction;
  5921. declare function contentChildren<LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  5922. descendants?: boolean;
  5923. read?: undefined;
  5924. debugName?: string;
  5925. }): Signal<ReadonlyArray<LocatorT>>;
  5926. declare function contentChildren<LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  5927. descendants?: boolean;
  5928. read: ProviderToken<ReadT>;
  5929. debugName?: string;
  5930. }): Signal<ReadonlyArray<ReadT>>;
  5931. /**
  5932. * Type of the Attribute decorator / constructor function.
  5933. *
  5934. * @publicApi
  5935. */
  5936. interface AttributeDecorator {
  5937. /**
  5938. * Parameter decorator for a directive constructor that designates
  5939. * a host-element attribute whose value is injected as a constant string literal.
  5940. *
  5941. * @usageNotes
  5942. *
  5943. * Suppose we have an `<input>` element and want to know its `type`.
  5944. *
  5945. * ```html
  5946. * <input type="text">
  5947. * ```
  5948. *
  5949. * The following example uses the decorator to inject the string literal `text` in a directive.
  5950. *
  5951. * {@example core/ts/metadata/metadata.ts region='attributeMetadata'}
  5952. *
  5953. * The following example uses the decorator in a component constructor.
  5954. *
  5955. * {@example core/ts/metadata/metadata.ts region='attributeFactory'}
  5956. *
  5957. */
  5958. (name: string): any;
  5959. new (name: string): Attribute;
  5960. }
  5961. /**
  5962. * Type of the Attribute metadata.
  5963. *
  5964. * @publicApi
  5965. */
  5966. interface Attribute {
  5967. /**
  5968. * The name of the attribute whose value can be injected.
  5969. */
  5970. attributeName: string;
  5971. }
  5972. /**
  5973. * Attribute decorator and metadata.
  5974. *
  5975. * @Annotation
  5976. * @publicApi
  5977. */
  5978. declare const Attribute: AttributeDecorator;
  5979. /**
  5980. * Represents a basic change from a previous to a new value for a single
  5981. * property on a directive instance. Passed as a value in a
  5982. * {@link SimpleChanges} object to the `ngOnChanges` hook.
  5983. *
  5984. * @see {@link OnChanges}
  5985. *
  5986. * @publicApi
  5987. */
  5988. declare class SimpleChange {
  5989. previousValue: any;
  5990. currentValue: any;
  5991. firstChange: boolean;
  5992. constructor(previousValue: any, currentValue: any, firstChange: boolean);
  5993. /**
  5994. * Check whether the new value is the first value assigned.
  5995. */
  5996. isFirstChange(): boolean;
  5997. }
  5998. /**
  5999. * A hashtable of changes represented by {@link SimpleChange} objects stored
  6000. * at the declared property name they belong to on a Directive or Component. This is
  6001. * the type passed to the `ngOnChanges` hook.
  6002. *
  6003. * @see {@link OnChanges}
  6004. *
  6005. * @publicApi
  6006. */
  6007. interface SimpleChanges {
  6008. [propName: string]: SimpleChange;
  6009. }
  6010. /**
  6011. * @description
  6012. * A lifecycle hook that is called when any data-bound property of a directive changes.
  6013. * Define an `ngOnChanges()` method to handle the changes.
  6014. *
  6015. * @see {@link DoCheck}
  6016. * @see {@link OnInit}
  6017. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6018. *
  6019. * @usageNotes
  6020. * The following snippet shows how a component can implement this interface to
  6021. * define an on-changes handler for an input property.
  6022. *
  6023. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnChanges'}
  6024. *
  6025. * @publicApi
  6026. */
  6027. interface OnChanges {
  6028. /**
  6029. * A callback method that is invoked immediately after the
  6030. * default change detector has checked data-bound properties
  6031. * if at least one has changed, and before the view and content
  6032. * children are checked.
  6033. * @param changes The changed properties.
  6034. */
  6035. ngOnChanges(changes: SimpleChanges): void;
  6036. }
  6037. /**
  6038. * @description
  6039. * A lifecycle hook that is called after Angular has initialized
  6040. * all data-bound properties of a directive.
  6041. * Define an `ngOnInit()` method to handle any additional initialization tasks.
  6042. *
  6043. * @see {@link AfterContentInit}
  6044. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6045. *
  6046. * @usageNotes
  6047. * The following snippet shows how a component can implement this interface to
  6048. * define its own initialization method.
  6049. *
  6050. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnInit'}
  6051. *
  6052. * @publicApi
  6053. */
  6054. interface OnInit {
  6055. /**
  6056. * A callback method that is invoked immediately after the
  6057. * default change detector has checked the directive's
  6058. * data-bound properties for the first time,
  6059. * and before any of the view or content children have been checked.
  6060. * It is invoked only once when the directive is instantiated.
  6061. */
  6062. ngOnInit(): void;
  6063. }
  6064. /**
  6065. * A lifecycle hook that invokes a custom change-detection function for a directive,
  6066. * in addition to the check performed by the default change-detector.
  6067. *
  6068. * The default change-detection algorithm looks for differences by comparing
  6069. * bound-property values by reference across change detection runs. You can use this
  6070. * hook to check for and respond to changes by some other means.
  6071. *
  6072. * When the default change detector detects changes, it invokes `ngOnChanges()` if supplied,
  6073. * regardless of whether you perform additional change detection.
  6074. * Typically, you should not use both `DoCheck` and `OnChanges` to respond to
  6075. * changes on the same input.
  6076. *
  6077. * @see {@link OnChanges}
  6078. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6079. *
  6080. * @usageNotes
  6081. * The following snippet shows how a component can implement this interface
  6082. * to invoke it own change-detection cycle.
  6083. *
  6084. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='DoCheck'}
  6085. *
  6086. * For a more complete example and discussion, see
  6087. * [Defining custom change detection](guide/components/lifecycle#defining-custom-change-detection).
  6088. *
  6089. * @publicApi
  6090. */
  6091. interface DoCheck {
  6092. /**
  6093. * A callback method that performs change-detection, invoked
  6094. * after the default change-detector runs.
  6095. * See `KeyValueDiffers` and `IterableDiffers` for implementing
  6096. * custom change checking for collections.
  6097. *
  6098. */
  6099. ngDoCheck(): void;
  6100. }
  6101. /**
  6102. * A lifecycle hook that is called when a directive, pipe, or service is destroyed.
  6103. * Use for any custom cleanup that needs to occur when the
  6104. * instance is destroyed.
  6105. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6106. *
  6107. * @usageNotes
  6108. * The following snippet shows how a component can implement this interface
  6109. * to define its own custom clean-up method.
  6110. *
  6111. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnDestroy'}
  6112. *
  6113. * @publicApi
  6114. */
  6115. interface OnDestroy {
  6116. /**
  6117. * A callback method that performs custom clean-up, invoked immediately
  6118. * before a directive, pipe, or service instance is destroyed.
  6119. */
  6120. ngOnDestroy(): void;
  6121. }
  6122. /**
  6123. * @description
  6124. * A lifecycle hook that is called after Angular has fully initialized
  6125. * all content of a directive. It will run only once when the projected content is initialized.
  6126. * Define an `ngAfterContentInit()` method to handle any additional initialization tasks.
  6127. *
  6128. * @see {@link OnInit}
  6129. * @see {@link AfterViewInit}
  6130. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6131. *
  6132. * @usageNotes
  6133. * The following snippet shows how a component can implement this interface to
  6134. * define its own content initialization method.
  6135. *
  6136. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterContentInit'}
  6137. *
  6138. * @publicApi
  6139. */
  6140. interface AfterContentInit {
  6141. /**
  6142. * A callback method that is invoked immediately after
  6143. * Angular has completed initialization of all of the directive's
  6144. * content.
  6145. * It is invoked only once when the directive is instantiated.
  6146. */
  6147. ngAfterContentInit(): void;
  6148. }
  6149. /**
  6150. * @description
  6151. * A lifecycle hook that is called after the default change detector has
  6152. * completed checking all content of a directive. It will run after the content
  6153. * has been checked and most of the time it's during a change detection cycle.
  6154. *
  6155. * @see {@link AfterViewChecked}
  6156. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6157. *
  6158. * @usageNotes
  6159. * The following snippet shows how a component can implement this interface to
  6160. * define its own after-check functionality.
  6161. *
  6162. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterContentChecked'}
  6163. *
  6164. * @publicApi
  6165. */
  6166. interface AfterContentChecked {
  6167. /**
  6168. * A callback method that is invoked immediately after the
  6169. * default change detector has completed checking all of the directive's
  6170. * content.
  6171. */
  6172. ngAfterContentChecked(): void;
  6173. }
  6174. /**
  6175. * @description
  6176. * A lifecycle hook that is called after Angular has fully initialized
  6177. * a component's view.
  6178. * Define an `ngAfterViewInit()` method to handle any additional initialization tasks.
  6179. *
  6180. * @see {@link OnInit}
  6181. * @see {@link AfterContentInit}
  6182. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6183. *
  6184. * @usageNotes
  6185. * The following snippet shows how a component can implement this interface to
  6186. * define its own view initialization method.
  6187. *
  6188. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterViewInit'}
  6189. *
  6190. * @publicApi
  6191. */
  6192. interface AfterViewInit {
  6193. /**
  6194. * A callback method that is invoked immediately after
  6195. * Angular has completed initialization of a component's view.
  6196. * It is invoked only once when the view is instantiated.
  6197. *
  6198. */
  6199. ngAfterViewInit(): void;
  6200. }
  6201. /**
  6202. * @description
  6203. * A lifecycle hook that is called after the default change detector has
  6204. * completed checking a component's view for changes.
  6205. *
  6206. * @see {@link AfterContentChecked}
  6207. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  6208. *
  6209. * @usageNotes
  6210. * The following snippet shows how a component can implement this interface to
  6211. * define its own after-check functionality.
  6212. *
  6213. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterViewChecked'}
  6214. *
  6215. * @publicApi
  6216. */
  6217. interface AfterViewChecked {
  6218. /**
  6219. * A callback method that is invoked immediately after the
  6220. * default change detector has completed one change-check cycle
  6221. * for a component's view.
  6222. */
  6223. ngAfterViewChecked(): void;
  6224. }
  6225. /**
  6226. * Type of the Query metadata.
  6227. *
  6228. * @publicApi
  6229. */
  6230. interface Query {
  6231. descendants: boolean;
  6232. emitDistinctChangesOnly: boolean;
  6233. first: boolean;
  6234. read: any;
  6235. isViewQuery: boolean;
  6236. selector: any;
  6237. static?: boolean;
  6238. }
  6239. /**
  6240. * Base class for query metadata.
  6241. *
  6242. * @see {@link ContentChildren}
  6243. * @see {@link ContentChild}
  6244. * @see {@link ViewChildren}
  6245. * @see {@link ViewChild}
  6246. *
  6247. * @publicApi
  6248. */
  6249. declare abstract class Query {
  6250. }
  6251. /**
  6252. * Type of the ContentChildren decorator / constructor function.
  6253. *
  6254. * @see {@link ContentChildren}
  6255. * @publicApi
  6256. */
  6257. interface ContentChildrenDecorator {
  6258. /**
  6259. * @description
  6260. * Property decorator that configures a content query.
  6261. *
  6262. * Use to get the `QueryList` of elements or directives from the content DOM.
  6263. * Any time a child element is added, removed, or moved, the query list will be
  6264. * updated, and the changes observable of the query list will emit a new value.
  6265. *
  6266. * Content queries are set before the `ngAfterContentInit` callback is called.
  6267. *
  6268. * Does not retrieve elements or directives that are in other components' templates,
  6269. * since a component's template is always a black box to its ancestors.
  6270. *
  6271. * **Metadata Properties**:
  6272. *
  6273. * * **selector** - The directive type or the name used for querying.
  6274. * * **descendants** - If `true` include all descendants of the element. If `false` then only
  6275. * query direct children of the element.
  6276. * * **emitDistinctChangesOnly** - The ` QueryList#changes` observable will emit new values only
  6277. * if the QueryList result has changed. When `false` the `changes` observable might emit even
  6278. * if the QueryList has not changed.
  6279. * ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and
  6280. * removed in future versions of Angular.
  6281. * * **read** - Used to read a different token from the queried elements.
  6282. *
  6283. * The following selectors are supported.
  6284. * * Any class with the `@Component` or `@Directive` decorator
  6285. * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
  6286. * with `@ContentChildren('cmp')`)
  6287. * * Any provider defined in the child component tree of the current component (e.g.
  6288. * `@ContentChildren(SomeService) someService: SomeService`)
  6289. * * Any provider defined through a string token (e.g. `@ContentChildren('someToken')
  6290. * someTokenVal: any`)
  6291. * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with
  6292. * `@ContentChildren(TemplateRef) template;`)
  6293. *
  6294. * In addition, multiple string selectors can be separated with a comma (e.g.
  6295. * `@ContentChildren('cmp1,cmp2')`)
  6296. *
  6297. * The following values are supported by `read`:
  6298. * * Any class with the `@Component` or `@Directive` decorator
  6299. * * Any provider defined on the injector of the component that is matched by the `selector` of
  6300. * this query
  6301. * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
  6302. * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
  6303. *
  6304. * @usageNotes
  6305. *
  6306. * Here is a simple demonstration of how the `ContentChildren` decorator can be used.
  6307. *
  6308. * {@example core/di/ts/contentChildren/content_children_howto.ts region='HowTo'}
  6309. *
  6310. * ### Tab-pane example
  6311. *
  6312. * Here is a slightly more realistic example that shows how `ContentChildren` decorators
  6313. * can be used to implement a tab pane component.
  6314. *
  6315. * {@example core/di/ts/contentChildren/content_children_example.ts region='Component'}
  6316. *
  6317. * @Annotation
  6318. */
  6319. (selector: ProviderToken<unknown> | Function | string, opts?: {
  6320. descendants?: boolean;
  6321. emitDistinctChangesOnly?: boolean;
  6322. read?: any;
  6323. }): any;
  6324. new (selector: ProviderToken<unknown> | Function | string, opts?: {
  6325. descendants?: boolean;
  6326. emitDistinctChangesOnly?: boolean;
  6327. read?: any;
  6328. }): Query;
  6329. }
  6330. /**
  6331. * Type of the ContentChildren metadata.
  6332. *
  6333. *
  6334. * @Annotation
  6335. * @publicApi
  6336. */
  6337. type ContentChildren = Query;
  6338. /**
  6339. * ContentChildren decorator and metadata.
  6340. *
  6341. *
  6342. * @Annotation
  6343. * @publicApi
  6344. */
  6345. declare const ContentChildren: ContentChildrenDecorator;
  6346. /**
  6347. * Type of the ContentChild decorator / constructor function.
  6348. *
  6349. * @publicApi
  6350. */
  6351. interface ContentChildDecorator {
  6352. /**
  6353. * @description
  6354. * Property decorator that configures a content query.
  6355. *
  6356. * Use to get the first element or the directive matching the selector from the content DOM.
  6357. * If the content DOM changes, and a new child matches the selector,
  6358. * the property will be updated.
  6359. *
  6360. * Does not retrieve elements or directives that are in other components' templates,
  6361. * since a component's template is always a black box to its ancestors.
  6362. *
  6363. * **Metadata Properties**:
  6364. *
  6365. * * **selector** - The directive type or the name used for querying.
  6366. * * **descendants** - If `true` (default) include all descendants of the element. If `false` then
  6367. * only query direct children of the element.
  6368. * * **read** - Used to read a different token from the queried element.
  6369. * * **static** - True to resolve query results before change detection runs,
  6370. * false to resolve after change detection. Defaults to false.
  6371. *
  6372. * The following selectors are supported.
  6373. * * Any class with the `@Component` or `@Directive` decorator
  6374. * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
  6375. * with `@ContentChild('cmp')`)
  6376. * * Any provider defined in the child component tree of the current component (e.g.
  6377. * `@ContentChild(SomeService) someService: SomeService`)
  6378. * * Any provider defined through a string token (e.g. `@ContentChild('someToken') someTokenVal:
  6379. * any`)
  6380. * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ContentChild(TemplateRef)
  6381. * template;`)
  6382. *
  6383. * The following values are supported by `read`:
  6384. * * Any class with the `@Component` or `@Directive` decorator
  6385. * * Any provider defined on the injector of the component that is matched by the `selector` of
  6386. * this query
  6387. * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
  6388. * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
  6389. *
  6390. * Difference between dynamic and static queries:
  6391. *
  6392. * | Queries | Details |
  6393. * |:--- |:--- |
  6394. * | Dynamic queries \(`static: false`\) | The query resolves before the `ngAfterContentInit()`
  6395. * callback is called. The result will be updated for changes to your view, such as changes to
  6396. * `ngIf` and `ngFor` blocks. | | Static queries \(`static: true`\) | The query resolves once
  6397. * the view has been created, but before change detection runs (before the `ngOnInit()` callback
  6398. * is called). The result, though, will never be updated to reflect changes to your view, such as
  6399. * changes to `ngIf` and `ngFor` blocks. |
  6400. *
  6401. * @usageNotes
  6402. *
  6403. * {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'}
  6404. *
  6405. * ### Example
  6406. *
  6407. * {@example core/di/ts/contentChild/content_child_example.ts region='Component'}
  6408. *
  6409. * @Annotation
  6410. */
  6411. (selector: ProviderToken<unknown> | Function | string, opts?: {
  6412. descendants?: boolean;
  6413. read?: any;
  6414. static?: boolean;
  6415. }): any;
  6416. new (selector: ProviderToken<unknown> | Function | string, opts?: {
  6417. descendants?: boolean;
  6418. read?: any;
  6419. static?: boolean;
  6420. }): ContentChild;
  6421. }
  6422. /**
  6423. * Type of the ContentChild metadata.
  6424. *
  6425. * @publicApi
  6426. */
  6427. type ContentChild = Query;
  6428. /**
  6429. * ContentChild decorator and metadata.
  6430. *
  6431. *
  6432. * @Annotation
  6433. *
  6434. * @publicApi
  6435. */
  6436. declare const ContentChild: ContentChildDecorator;
  6437. /**
  6438. * Type of the ViewChildren decorator / constructor function.
  6439. *
  6440. * @see {@link ViewChildren}
  6441. *
  6442. * @publicApi
  6443. */
  6444. interface ViewChildrenDecorator {
  6445. /**
  6446. * @description
  6447. * Property decorator that configures a view query.
  6448. *
  6449. * Use to get the `QueryList` of elements or directives from the view DOM.
  6450. * Any time a child element is added, removed, or moved, the query list will be updated,
  6451. * and the changes observable of the query list will emit a new value.
  6452. *
  6453. * View queries are set before the `ngAfterViewInit` callback is called.
  6454. *
  6455. * **Metadata Properties**:
  6456. *
  6457. * * **selector** - The directive type or the name used for querying.
  6458. * * **read** - Used to read a different token from the queried elements.
  6459. * * **emitDistinctChangesOnly** - The ` QueryList#changes` observable will emit new values only
  6460. * if the QueryList result has changed. When `false` the `changes` observable might emit even
  6461. * if the QueryList has not changed.
  6462. * ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and
  6463. * removed in future versions of Angular.
  6464. *
  6465. * The following selectors are supported.
  6466. * * Any class with the `@Component` or `@Directive` decorator
  6467. * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
  6468. * with `@ViewChildren('cmp')`)
  6469. * * Any provider defined in the child component tree of the current component (e.g.
  6470. * `@ViewChildren(SomeService) someService!: SomeService`)
  6471. * * Any provider defined through a string token (e.g. `@ViewChildren('someToken')
  6472. * someTokenVal!: any`)
  6473. * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChildren(TemplateRef)
  6474. * template;`)
  6475. *
  6476. * In addition, multiple string selectors can be separated with a comma (e.g.
  6477. * `@ViewChildren('cmp1,cmp2')`)
  6478. *
  6479. * The following values are supported by `read`:
  6480. * * Any class with the `@Component` or `@Directive` decorator
  6481. * * Any provider defined on the injector of the component that is matched by the `selector` of
  6482. * this query
  6483. * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
  6484. * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
  6485. *
  6486. * @usageNotes
  6487. *
  6488. * {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'}
  6489. *
  6490. * ### Another example
  6491. *
  6492. * {@example core/di/ts/viewChildren/view_children_example.ts region='Component'}
  6493. *
  6494. * @Annotation
  6495. */
  6496. (selector: ProviderToken<unknown> | Function | string, opts?: {
  6497. read?: any;
  6498. emitDistinctChangesOnly?: boolean;
  6499. }): any;
  6500. new (selector: ProviderToken<unknown> | Function | string, opts?: {
  6501. read?: any;
  6502. emitDistinctChangesOnly?: boolean;
  6503. }): ViewChildren;
  6504. }
  6505. /**
  6506. * Type of the ViewChildren metadata.
  6507. *
  6508. * @publicApi
  6509. */
  6510. type ViewChildren = Query;
  6511. /**
  6512. * ViewChildren decorator and metadata.
  6513. *
  6514. * @Annotation
  6515. * @publicApi
  6516. */
  6517. declare const ViewChildren: ViewChildrenDecorator;
  6518. /**
  6519. * Type of the ViewChild decorator / constructor function.
  6520. *
  6521. * @see {@link ViewChild}
  6522. * @publicApi
  6523. */
  6524. interface ViewChildDecorator {
  6525. /**
  6526. * @description
  6527. * Property decorator that configures a view query.
  6528. * The change detector looks for the first element or the directive matching the selector
  6529. * in the view DOM. If the view DOM changes, and a new child matches the selector,
  6530. * the property is updated.
  6531. *
  6532. * **Metadata Properties**:
  6533. *
  6534. * * **selector** - The directive type or the name used for querying.
  6535. * * **read** - Used to read a different token from the queried elements.
  6536. * * **static** - `true` to resolve query results before change detection runs,
  6537. * `false` to resolve after change detection. Defaults to `false`.
  6538. *
  6539. *
  6540. * The following selectors are supported.
  6541. * * Any class with the `@Component` or `@Directive` decorator
  6542. * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
  6543. * with `@ViewChild('cmp')`)
  6544. * * Any provider defined in the child component tree of the current component (e.g.
  6545. * `@ViewChild(SomeService) someService: SomeService`)
  6546. * * Any provider defined through a string token (e.g. `@ViewChild('someToken') someTokenVal:
  6547. * any`)
  6548. * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChild(TemplateRef)
  6549. * template;`)
  6550. *
  6551. * The following values are supported by `read`:
  6552. * * Any class with the `@Component` or `@Directive` decorator
  6553. * * Any provider defined on the injector of the component that is matched by the `selector` of
  6554. * this query
  6555. * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
  6556. * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
  6557. *
  6558. * Difference between dynamic and static queries:
  6559. * * Dynamic queries \(`static: false`\) - The query resolves before the `ngAfterViewInit()`
  6560. * callback is called. The result will be updated for changes to your view, such as changes to
  6561. * `ngIf` and `ngFor` blocks.
  6562. * * Static queries \(`static: true`\) - The query resolves once
  6563. * the view has been created, but before change detection runs (before the `ngOnInit()` callback
  6564. * is called). The result, though, will never be updated to reflect changes to your view, such as
  6565. * changes to `ngIf` and `ngFor` blocks.
  6566. *
  6567. * @usageNotes
  6568. *
  6569. * ### Example 1
  6570. *
  6571. * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}
  6572. *
  6573. * ### Example 2
  6574. *
  6575. * {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'}
  6576. *
  6577. * @Annotation
  6578. */
  6579. (selector: ProviderToken<unknown> | Function | string, opts?: {
  6580. read?: any;
  6581. static?: boolean;
  6582. }): any;
  6583. new (selector: ProviderToken<unknown> | Function | string, opts?: {
  6584. read?: any;
  6585. static?: boolean;
  6586. }): ViewChild;
  6587. }
  6588. /**
  6589. * Type of the ViewChild metadata.
  6590. *
  6591. * @publicApi
  6592. */
  6593. type ViewChild = Query;
  6594. /**
  6595. * ViewChild decorator and metadata.
  6596. *
  6597. * @Annotation
  6598. * @publicApi
  6599. */
  6600. declare const ViewChild: ViewChildDecorator;
  6601. /**
  6602. * The strategy that the default change detector uses to detect changes.
  6603. * When set, takes effect the next time change detection is triggered.
  6604. *
  6605. * @see {@link /api/core/ChangeDetectorRef?tab=usage-notes Change detection usage}
  6606. * @see {@link /best-practices/skipping-subtrees Skipping component subtrees}
  6607. *
  6608. * @publicApi
  6609. */
  6610. declare enum ChangeDetectionStrategy$1 {
  6611. /**
  6612. * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated
  6613. * until reactivated by setting the strategy to `Default` (`CheckAlways`).
  6614. * Change detection can still be explicitly invoked.
  6615. * This strategy applies to all child directives and cannot be overridden.
  6616. */
  6617. OnPush = 0,
  6618. /**
  6619. * Use the default `CheckAlways` strategy, in which change detection is automatic until
  6620. * explicitly deactivated.
  6621. */
  6622. Default = 1
  6623. }
  6624. /**
  6625. * An interface implemented by all Angular type decorators, which allows them to be used as
  6626. * decorators as well as Angular syntax.
  6627. *
  6628. * ```ts
  6629. * @ng.Component({...})
  6630. * class MyClass {...}
  6631. * ```
  6632. *
  6633. * @publicApi
  6634. */
  6635. interface TypeDecorator {
  6636. /**
  6637. * Invoke as decorator.
  6638. */
  6639. <T extends Type$1<any>>(type: T): T;
  6640. (target: Object, propertyKey?: string | symbol, parameterIndex?: number): void;
  6641. (target: unknown, context: unknown): void;
  6642. }
  6643. /**
  6644. * Type of the Directive decorator / constructor function.
  6645. * @publicApi
  6646. */
  6647. interface DirectiveDecorator {
  6648. /**
  6649. * Decorator that marks a class as an Angular directive.
  6650. * You can define your own directives to attach custom behavior to elements in the DOM.
  6651. *
  6652. * The options provide configuration metadata that determines
  6653. * how the directive should be processed, instantiated and used at
  6654. * runtime.
  6655. *
  6656. * Directive classes, like component classes, can implement
  6657. * [life-cycle hooks](guide/components/lifecycle) to influence their configuration and behavior.
  6658. *
  6659. *
  6660. * @usageNotes
  6661. * To define a directive, mark the class with the decorator and provide metadata.
  6662. *
  6663. * ```ts
  6664. * import {Directive} from '@angular/core';
  6665. *
  6666. * @Directive({
  6667. * selector: 'my-directive',
  6668. * })
  6669. * export class MyDirective {
  6670. * ...
  6671. * }
  6672. * ```
  6673. *
  6674. * ### Declaring directives
  6675. *
  6676. * In order to make a directive available to other components in your application, you should do
  6677. * one of the following:
  6678. * - either mark the directive as [standalone](guide/components/importing),
  6679. * - or declare it in an NgModule by adding it to the `declarations` and `exports` fields.
  6680. *
  6681. * ** Marking a directive as standalone **
  6682. *
  6683. * You can add the `standalone: true` flag to the Directive decorator metadata to declare it as
  6684. * [standalone](guide/components/importing):
  6685. *
  6686. * ```ts
  6687. * @Directive({
  6688. * standalone: true,
  6689. * selector: 'my-directive',
  6690. * })
  6691. * class MyDirective {}
  6692. * ```
  6693. *
  6694. * When marking a directive as standalone, please make sure that the directive is not already
  6695. * declared in an NgModule.
  6696. *
  6697. *
  6698. * ** Declaring a directive in an NgModule **
  6699. *
  6700. * Another approach is to declare a directive in an NgModule:
  6701. *
  6702. * ```ts
  6703. * @Directive({
  6704. * selector: 'my-directive',
  6705. * })
  6706. * class MyDirective {}
  6707. *
  6708. * @NgModule({
  6709. * declarations: [MyDirective, SomeComponent],
  6710. * exports: [MyDirective], // making it available outside of this module
  6711. * })
  6712. * class SomeNgModule {}
  6713. * ```
  6714. *
  6715. * When declaring a directive in an NgModule, please make sure that:
  6716. * - the directive is declared in exactly one NgModule.
  6717. * - the directive is not standalone.
  6718. * - you do not re-declare a directive imported from another module.
  6719. * - the directive is included into the `exports` field as well if you want this directive to be
  6720. * accessible for components outside of the NgModule.
  6721. *
  6722. *
  6723. * @Annotation
  6724. */
  6725. (obj?: Directive): TypeDecorator;
  6726. /**
  6727. * See the `Directive` decorator.
  6728. */
  6729. new (obj?: Directive): Directive;
  6730. }
  6731. /**
  6732. * Directive decorator and metadata.
  6733. *
  6734. * @Annotation
  6735. * @publicApi
  6736. */
  6737. interface Directive {
  6738. /**
  6739. * The CSS selector that identifies this directive in a template
  6740. * and triggers instantiation of the directive.
  6741. *
  6742. * Declare as one of the following:
  6743. *
  6744. * - `element-name`: Select by element name.
  6745. * - `.class`: Select by class name.
  6746. * - `[attribute]`: Select by attribute name.
  6747. * - `[attribute=value]`: Select by attribute name and value.
  6748. * - `:not(sub_selector)`: Select only if the element does not match the `sub_selector`.
  6749. * - `selector1, selector2`: Select if either `selector1` or `selector2` matches.
  6750. *
  6751. * Angular only allows directives to apply on CSS selectors that do not cross
  6752. * element boundaries.
  6753. *
  6754. * For the following template HTML, a directive with an `input[type=text]` selector,
  6755. * would be instantiated only on the `<input type="text">` element.
  6756. *
  6757. * ```html
  6758. * <form>
  6759. * <input type="text">
  6760. * <input type="radio">
  6761. * <form>
  6762. * ```
  6763. *
  6764. */
  6765. selector?: string;
  6766. /**
  6767. * Enumerates the set of data-bound input properties for a directive
  6768. *
  6769. * Angular automatically updates input properties during change detection.
  6770. * The `inputs` property accepts either strings or object literals that configure the directive
  6771. * properties that should be exposed as inputs.
  6772. *
  6773. * When an object literal is passed in, the `name` property indicates which property on the
  6774. * class the input should write to, while the `alias` determines the name under
  6775. * which the input will be available in template bindings. The `required` property indicates that
  6776. * the input is required which will trigger a compile-time error if it isn't passed in when the
  6777. * directive is used.
  6778. *
  6779. * When a string is passed into the `inputs` array, it can have a format of `'name'` or
  6780. * `'name: alias'` where `name` is the property on the class that the directive should write
  6781. * to, while the `alias` determines the name under which the input will be available in
  6782. * template bindings. String-based input definitions are assumed to be optional.
  6783. *
  6784. * @usageNotes
  6785. *
  6786. * The following example creates a component with two data-bound properties.
  6787. *
  6788. * ```ts
  6789. * @Component({
  6790. * selector: 'bank-account',
  6791. * inputs: ['bankName', {name: 'id', alias: 'account-id'}],
  6792. * template: `
  6793. * Bank Name: {{bankName}}
  6794. * Account Id: {{id}}
  6795. * `
  6796. * })
  6797. * class BankAccount {
  6798. * bankName: string;
  6799. * id: string;
  6800. * }
  6801. * ```
  6802. *
  6803. */
  6804. inputs?: ({
  6805. name: string;
  6806. alias?: string;
  6807. required?: boolean;
  6808. transform?: (value: any) => any;
  6809. } | string)[];
  6810. /**
  6811. * Enumerates the set of event-bound output properties.
  6812. *
  6813. * When an output property emits an event, an event handler attached to that event
  6814. * in the template is invoked.
  6815. *
  6816. * The `outputs` property defines a set of `directiveProperty` to `alias`
  6817. * configuration:
  6818. *
  6819. * - `directiveProperty` specifies the component property that emits events.
  6820. * - `alias` specifies the DOM property the event handler is attached to.
  6821. *
  6822. * @usageNotes
  6823. *
  6824. * ```ts
  6825. * @Component({
  6826. * selector: 'child-dir',
  6827. * outputs: [ 'bankNameChange' ],
  6828. * template: `<input (input)="bankNameChange.emit($event.target.value)" />`
  6829. * })
  6830. * class ChildDir {
  6831. * bankNameChange: EventEmitter<string> = new EventEmitter<string>();
  6832. * }
  6833. *
  6834. * @Component({
  6835. * selector: 'main',
  6836. * template: `
  6837. * {{ bankName }} <child-dir (bankNameChange)="onBankNameChange($event)"></child-dir>
  6838. * `
  6839. * })
  6840. * class MainComponent {
  6841. * bankName: string;
  6842. *
  6843. * onBankNameChange(bankName: string) {
  6844. * this.bankName = bankName;
  6845. * }
  6846. * }
  6847. * ```
  6848. *
  6849. */
  6850. outputs?: string[];
  6851. /**
  6852. * Configures the injector of this
  6853. * directive or component with a token
  6854. * that maps to a provider of a dependency.
  6855. */
  6856. providers?: Provider[];
  6857. /**
  6858. * Defines the name that can be used in the template to assign this directive to a variable.
  6859. *
  6860. * @usageNotes
  6861. *
  6862. * ```ts
  6863. * @Directive({
  6864. * selector: 'child-dir',
  6865. * exportAs: 'child'
  6866. * })
  6867. * class ChildDir {
  6868. * }
  6869. *
  6870. * @Component({
  6871. * selector: 'main',
  6872. * template: `<child-dir #c="child"></child-dir>`
  6873. * })
  6874. * class MainComponent {
  6875. * }
  6876. * ```
  6877. *
  6878. */
  6879. exportAs?: string;
  6880. /**
  6881. * Configures the queries that will be injected into the directive.
  6882. *
  6883. * Content queries are set before the `ngAfterContentInit` callback is called.
  6884. * View queries are set before the `ngAfterViewInit` callback is called.
  6885. *
  6886. * @usageNotes
  6887. *
  6888. * The following example shows how queries are defined
  6889. * and when their results are available in lifecycle hooks:
  6890. *
  6891. * ```ts
  6892. * @Component({
  6893. * selector: 'someDir',
  6894. * queries: {
  6895. * contentChildren: new ContentChildren(ChildDirective),
  6896. * viewChildren: new ViewChildren(ChildDirective)
  6897. * },
  6898. * template: '<child-directive></child-directive>'
  6899. * })
  6900. * class SomeDir {
  6901. * contentChildren: QueryList<ChildDirective>,
  6902. * viewChildren: QueryList<ChildDirective>
  6903. *
  6904. * ngAfterContentInit() {
  6905. * // contentChildren is set
  6906. * }
  6907. *
  6908. * ngAfterViewInit() {
  6909. * // viewChildren is set
  6910. * }
  6911. * }
  6912. * ```
  6913. *
  6914. * @Annotation
  6915. */
  6916. queries?: {
  6917. [key: string]: any;
  6918. };
  6919. /**
  6920. * Maps class properties to host element bindings for properties,
  6921. * attributes, and events, using a set of key-value pairs.
  6922. *
  6923. * Angular automatically checks host property bindings during change detection.
  6924. * If a binding changes, Angular updates the directive's host element.
  6925. *
  6926. * When the key is a property of the host element, the property value is
  6927. * propagated to the specified DOM property.
  6928. *
  6929. * When the key is a static attribute in the DOM, the attribute value
  6930. * is propagated to the specified property in the host element.
  6931. *
  6932. * For event handling:
  6933. * - The key is the DOM event that the directive listens to.
  6934. * To listen to global events, add the target to the event name.
  6935. * The target can be `window`, `document` or `body`.
  6936. * - The value is the statement to execute when the event occurs. If the
  6937. * statement evaluates to `false`, then `preventDefault` is applied on the DOM
  6938. * event. A handler method can refer to the `$event` local variable.
  6939. *
  6940. */
  6941. host?: {
  6942. [key: string]: string;
  6943. };
  6944. /**
  6945. * When present, this directive/component is ignored by the AOT compiler.
  6946. * It remains in distributed code, and the JIT compiler attempts to compile it
  6947. * at run time, in the browser.
  6948. * To ensure the correct behavior, the app must import `@angular/compiler`.
  6949. */
  6950. jit?: true;
  6951. /**
  6952. * Angular directives marked as `standalone` do not need to be declared in an NgModule. Such
  6953. * directives don't depend on any "intermediate context" of an NgModule (ex. configured
  6954. * providers).
  6955. *
  6956. * More information about standalone components, directives, and pipes can be found in [this
  6957. * guide](guide/components/importing).
  6958. */
  6959. standalone?: boolean;
  6960. /**
  6961. * Standalone directives that should be applied to the host whenever the directive is matched.
  6962. * By default, none of the inputs or outputs of the host directives will be available on the host,
  6963. * unless they are specified in the `inputs` or `outputs` properties.
  6964. *
  6965. * You can additionally alias inputs and outputs by putting a colon and the alias after the
  6966. * original input or output name. For example, if a directive applied via `hostDirectives`
  6967. * defines an input named `menuDisabled`, you can alias this to `disabled` by adding
  6968. * `'menuDisabled: disabled'` as an entry to `inputs`.
  6969. */
  6970. hostDirectives?: (Type$1<unknown> | {
  6971. directive: Type$1<unknown>;
  6972. inputs?: string[];
  6973. outputs?: string[];
  6974. })[];
  6975. }
  6976. /**
  6977. * Type of the Directive metadata.
  6978. *
  6979. * @publicApi
  6980. */
  6981. declare const Directive: DirectiveDecorator;
  6982. /**
  6983. * Component decorator interface
  6984. *
  6985. * @publicApi
  6986. */
  6987. interface ComponentDecorator {
  6988. /**
  6989. * Decorator that marks a class as an Angular component and provides configuration
  6990. * metadata that determines how the component should be processed,
  6991. * instantiated, and used at runtime.
  6992. *
  6993. * Components are the most basic UI building block of an Angular app.
  6994. * An Angular app contains a tree of Angular components.
  6995. *
  6996. * Angular components are a subset of directives, always associated with a template.
  6997. * Unlike other directives, only one component can be instantiated for a given element in a
  6998. * template.
  6999. *
  7000. * Standalone components can be directly imported in any other standalone component or NgModule.
  7001. * NgModule based apps on the other hand require components to belong to an NgModule in
  7002. * order for them to be available to another component or application. To make a component a
  7003. * member of an NgModule, list it in the `declarations` field of the `NgModule` metadata.
  7004. *
  7005. * Note that, in addition to these options for configuring a directive,
  7006. * you can control a component's runtime behavior by implementing
  7007. * life-cycle hooks. For more information, see the
  7008. * [Lifecycle Hooks](guide/components/lifecycle) guide.
  7009. *
  7010. * @usageNotes
  7011. *
  7012. * ### Setting component inputs
  7013. *
  7014. * The following example creates a component with two data-bound properties,
  7015. * specified by the `inputs` value.
  7016. *
  7017. * {@example core/ts/metadata/directives.ts region='component-input'}
  7018. *
  7019. *
  7020. * ### Setting component outputs
  7021. *
  7022. * The following example shows two output function that emit on an interval. One
  7023. * emits an output every second, while the other emits every five seconds.
  7024. *
  7025. * {@example core/ts/metadata/directives.ts region='component-output-interval'}
  7026. *
  7027. * ### Injecting a class with a view provider
  7028. *
  7029. * The following simple example injects a class into a component
  7030. * using the view provider specified in component metadata:
  7031. *
  7032. * ```ts
  7033. * class Greeter {
  7034. * greet(name:string) {
  7035. * return 'Hello ' + name + '!';
  7036. * }
  7037. * }
  7038. *
  7039. * @Directive({
  7040. * selector: 'needs-greeter'
  7041. * })
  7042. * class NeedsGreeter {
  7043. * greeter:Greeter;
  7044. *
  7045. * constructor(greeter:Greeter) {
  7046. * this.greeter = greeter;
  7047. * }
  7048. * }
  7049. *
  7050. * @Component({
  7051. * selector: 'greet',
  7052. * viewProviders: [
  7053. * Greeter
  7054. * ],
  7055. * template: `<needs-greeter></needs-greeter>`
  7056. * })
  7057. * class HelloWorld {
  7058. * }
  7059. *
  7060. * ```
  7061. *
  7062. * ### Preserving whitespace
  7063. *
  7064. * Removing whitespace can greatly reduce AOT-generated code size and speed up view creation.
  7065. * As of Angular 6, the default for `preserveWhitespaces` is false (whitespace is removed).
  7066. * To change the default setting for all components in your application, set
  7067. * the `preserveWhitespaces` option of the AOT compiler.
  7068. *
  7069. * By default, the AOT compiler removes whitespace characters as follows:
  7070. * * Trims all whitespaces at the beginning and the end of a template.
  7071. * * Removes whitespace-only text nodes. For example,
  7072. *
  7073. * ```html
  7074. * <button>Action 1</button> <button>Action 2</button>
  7075. * ```
  7076. *
  7077. * becomes:
  7078. *
  7079. * ```html
  7080. * <button>Action 1</button><button>Action 2</button>
  7081. * ```
  7082. *
  7083. * * Replaces a series of whitespace characters in text nodes with a single space.
  7084. * For example, `<span>\n some text\n</span>` becomes `<span> some text </span>`.
  7085. * * Does NOT alter text nodes inside HTML tags such as `<pre>` or `<textarea>`,
  7086. * where whitespace characters are significant.
  7087. *
  7088. * Note that these transformations can influence DOM nodes layout, although impact
  7089. * should be minimal.
  7090. *
  7091. * You can override the default behavior to preserve whitespace characters
  7092. * in certain fragments of a template. For example, you can exclude an entire
  7093. * DOM sub-tree by using the `ngPreserveWhitespaces` attribute:
  7094. *
  7095. * ```html
  7096. * <div ngPreserveWhitespaces>
  7097. * whitespaces are preserved here
  7098. * <span> and here </span>
  7099. * </div>
  7100. * ```
  7101. *
  7102. * You can force a single space to be preserved in a text node by using `&ngsp;`,
  7103. * which is replaced with a space character by Angular's template
  7104. * compiler:
  7105. *
  7106. * ```html
  7107. * <a>Spaces</a>&ngsp;<a>between</a>&ngsp;<a>links.</a>
  7108. * <!-- compiled to be equivalent to:
  7109. * <a>Spaces</a> <a>between</a> <a>links.</a> -->
  7110. * ```
  7111. *
  7112. * Note that sequences of `&ngsp;` are still collapsed to just one space character when
  7113. * the `preserveWhitespaces` option is set to `false`.
  7114. *
  7115. * ```html
  7116. * <a>before</a>&ngsp;&ngsp;&ngsp;<a>after</a>
  7117. * <!-- compiled to be equivalent to:
  7118. * <a>before</a> <a>after</a> -->
  7119. * ```
  7120. *
  7121. * To preserve sequences of whitespace characters, use the
  7122. * `ngPreserveWhitespaces` attribute.
  7123. *
  7124. * @Annotation
  7125. */
  7126. (obj: Component): TypeDecorator;
  7127. /**
  7128. * See the `Component` decorator.
  7129. */
  7130. new (obj: Component): Component;
  7131. }
  7132. /**
  7133. * Supplies configuration metadata for an Angular component.
  7134. *
  7135. * @publicApi
  7136. */
  7137. interface Component extends Directive {
  7138. /**
  7139. * The change-detection strategy to use for this component.
  7140. *
  7141. * When a component is instantiated, Angular creates a change detector,
  7142. * which is responsible for propagating the component's bindings.
  7143. * The strategy is one of:
  7144. * - `ChangeDetectionStrategy#OnPush` sets the strategy to `CheckOnce` (on demand).
  7145. * - `ChangeDetectionStrategy#Default` sets the strategy to `CheckAlways`.
  7146. */
  7147. changeDetection?: ChangeDetectionStrategy$1;
  7148. /**
  7149. * Defines the set of injectable objects that are visible to its view DOM children.
  7150. * See [example](#injecting-a-class-with-a-view-provider).
  7151. *
  7152. */
  7153. viewProviders?: Provider[];
  7154. /**
  7155. * The module ID of the module that contains the component.
  7156. * The component must be able to resolve relative URLs for templates and styles.
  7157. * SystemJS exposes the `__moduleName` variable within each module.
  7158. * In CommonJS, this can be set to `module.id`.
  7159. *
  7160. * @deprecated This option does not have any effect. Will be removed in Angular v17.
  7161. */
  7162. moduleId?: string;
  7163. /**
  7164. * The relative path or absolute URL of a template file for an Angular component.
  7165. * If provided, do not supply an inline template using `template`.
  7166. *
  7167. */
  7168. templateUrl?: string;
  7169. /**
  7170. * An inline template for an Angular component. If provided,
  7171. * do not supply a template file using `templateUrl`.
  7172. *
  7173. */
  7174. template?: string;
  7175. /**
  7176. * One relative path or an absolute URL for file containing a CSS stylesheet to use
  7177. * in this component.
  7178. */
  7179. styleUrl?: string;
  7180. /**
  7181. * Relative paths or absolute URLs for files containing CSS stylesheets to use in this component.
  7182. */
  7183. styleUrls?: string[];
  7184. /**
  7185. * One or more inline CSS stylesheets to use
  7186. * in this component.
  7187. */
  7188. styles?: string | string[];
  7189. /**
  7190. * One or more animation `trigger()` calls, containing
  7191. * [`state()`](api/animations/state) and `transition()` definitions.
  7192. * See the [Animations guide](guide/animations) and animations API documentation.
  7193. *
  7194. */
  7195. animations?: any[];
  7196. /**
  7197. * An encapsulation policy for the component's styling.
  7198. * Possible values:
  7199. * - `ViewEncapsulation.Emulated`: Apply modified component styles in order to emulate
  7200. * a native Shadow DOM CSS encapsulation behavior.
  7201. * - `ViewEncapsulation.None`: Apply component styles globally without any sort of encapsulation.
  7202. * - `ViewEncapsulation.ShadowDom`: Use the browser's native Shadow DOM API to encapsulate styles.
  7203. *
  7204. * If not supplied, the value is taken from the `CompilerOptions`
  7205. * which defaults to `ViewEncapsulation.Emulated`.
  7206. *
  7207. * If the policy is `ViewEncapsulation.Emulated` and the component has no
  7208. * {@link Component#styles styles} nor {@link Component#styleUrls styleUrls},
  7209. * the policy is automatically switched to `ViewEncapsulation.None`.
  7210. */
  7211. encapsulation?: ViewEncapsulation$1;
  7212. /**
  7213. * Overrides the default interpolation start and end delimiters (`{{` and `}}`).
  7214. *
  7215. * @deprecated use Angular's default interpolation delimiters instead.
  7216. */
  7217. interpolation?: [string, string];
  7218. /**
  7219. * True to preserve or false to remove potentially superfluous whitespace characters
  7220. * from the compiled template. Whitespace characters are those matching the `\s`
  7221. * character class in JavaScript regular expressions. Default is false, unless
  7222. * overridden in compiler options.
  7223. */
  7224. preserveWhitespaces?: boolean;
  7225. /**
  7226. * Angular components marked as `standalone` do not need to be declared in an NgModule. Such
  7227. * components directly manage their own template dependencies (components, directives, and pipes
  7228. * used in a template) via the imports property.
  7229. *
  7230. * More information about standalone components, directives, and pipes can be found in [this
  7231. * guide](guide/components/importing).
  7232. */
  7233. standalone?: boolean;
  7234. /**
  7235. * The imports property specifies the standalone component's template dependencies — those
  7236. * directives, components, and pipes that can be used within its template. Standalone components
  7237. * can import other standalone components, directives, and pipes as well as existing NgModules.
  7238. *
  7239. * This property is only available for standalone components - specifying it for components
  7240. * declared in an NgModule generates a compilation error.
  7241. *
  7242. * More information about standalone components, directives, and pipes can be found in [this
  7243. * guide](guide/components/importing).
  7244. */
  7245. imports?: (Type$1<any> | ReadonlyArray<any>)[];
  7246. /**
  7247. * The set of schemas that declare elements to be allowed in a standalone component. Elements and
  7248. * properties that are neither Angular components nor directives must be declared in a schema.
  7249. *
  7250. * This property is only available for standalone components - specifying it for components
  7251. * declared in an NgModule generates a compilation error.
  7252. *
  7253. * More information about standalone components, directives, and pipes can be found in [this
  7254. * guide](guide/components/importing).
  7255. */
  7256. schemas?: SchemaMetadata[];
  7257. }
  7258. /**
  7259. * Component decorator and metadata.
  7260. *
  7261. * @Annotation
  7262. * @publicApi
  7263. */
  7264. declare const Component: ComponentDecorator;
  7265. /**
  7266. * Type of the Pipe decorator / constructor function.
  7267. *
  7268. * @publicApi
  7269. */
  7270. interface PipeDecorator {
  7271. /**
  7272. *
  7273. * Decorator that marks a class as pipe and supplies configuration metadata.
  7274. *
  7275. * A pipe class must implement the `PipeTransform` interface.
  7276. * For example, if the name is "myPipe", use a template binding expression
  7277. * such as the following:
  7278. *
  7279. * ```html
  7280. * {{ exp | myPipe }}
  7281. * ```
  7282. *
  7283. * The result of the expression is passed to the pipe's `transform()` method.
  7284. *
  7285. * A pipe must belong to an NgModule in order for it to be available
  7286. * to a template. To make it a member of an NgModule,
  7287. * list it in the `declarations` field of the `NgModule` metadata.
  7288. *
  7289. * @see [Style Guide: Pipe Names](style-guide#02-09)
  7290. *
  7291. */
  7292. (obj: Pipe): TypeDecorator;
  7293. /**
  7294. * See the `Pipe` decorator.
  7295. */
  7296. new (obj: Pipe): Pipe;
  7297. }
  7298. /**
  7299. * Type of the Pipe metadata.
  7300. *
  7301. * @publicApi
  7302. */
  7303. interface Pipe {
  7304. /**
  7305. * The pipe name to use in template bindings.
  7306. * Typically uses lowerCamelCase
  7307. * because the name cannot contain hyphens.
  7308. */
  7309. name: string;
  7310. /**
  7311. * When true, the pipe is pure, meaning that the
  7312. * `transform()` method is invoked only when its input arguments
  7313. * change. Pipes are pure by default.
  7314. *
  7315. * If the pipe has internal state (that is, the result
  7316. * depends on state other than its arguments), set `pure` to false.
  7317. * In this case, the pipe is invoked on each change-detection cycle,
  7318. * even if the arguments have not changed.
  7319. */
  7320. pure?: boolean;
  7321. /**
  7322. * Angular pipes marked as `standalone` do not need to be declared in an NgModule. Such
  7323. * pipes don't depend on any "intermediate context" of an NgModule (ex. configured providers).
  7324. *
  7325. * More information about standalone components, directives, and pipes can be found in [this
  7326. * guide](guide/components/importing).
  7327. */
  7328. standalone?: boolean;
  7329. }
  7330. /**
  7331. * @Annotation
  7332. * @publicApi
  7333. */
  7334. declare const Pipe: PipeDecorator;
  7335. /**
  7336. * @publicApi
  7337. */
  7338. interface InputDecorator {
  7339. /**
  7340. * Decorator that marks a class field as an input property and supplies configuration metadata.
  7341. * The input property is bound to a DOM property in the template. During change detection,
  7342. * Angular automatically updates the data property with the DOM property's value.
  7343. *
  7344. * @usageNotes
  7345. *
  7346. * You can supply an optional name to use in templates when the
  7347. * component is instantiated, that maps to the
  7348. * name of the bound property. By default, the original
  7349. * name of the bound property is used for input binding.
  7350. *
  7351. * The following example creates a component with two input properties,
  7352. * one of which is given a special binding name.
  7353. *
  7354. * ```ts
  7355. * import { Component, Input, numberAttribute, booleanAttribute } from '@angular/core';
  7356. * @Component({
  7357. * selector: 'bank-account',
  7358. * template: `
  7359. * Bank Name: {{bankName}}
  7360. * Account Id: {{id}}
  7361. * Account Status: {{status ? 'Active' : 'InActive'}}
  7362. * `
  7363. * })
  7364. * class BankAccount {
  7365. * // This property is bound using its original name.
  7366. * // Defining argument required as true inside the Input Decorator
  7367. * // makes this property deceleration as mandatory
  7368. * @Input({ required: true }) bankName!: string;
  7369. * // Argument alias makes this property value is bound to a different property name
  7370. * // when this component is instantiated in a template.
  7371. * // Argument transform convert the input value from string to number
  7372. * @Input({ alias:'account-id', transform: numberAttribute }) id: number;
  7373. * // Argument transform the input value from string to boolean
  7374. * @Input({ transform: booleanAttribute }) status: boolean;
  7375. * // this property is not bound, and is not automatically updated by Angular
  7376. * normalizedBankName: string;
  7377. * }
  7378. *
  7379. * @Component({
  7380. * selector: 'app',
  7381. * template: `
  7382. * <bank-account bankName="RBC" account-id="4747" status="true"></bank-account>
  7383. * `
  7384. * })
  7385. * class App {}
  7386. * ```
  7387. *
  7388. * @see [Input properties](guide/components/inputs)
  7389. * @see [Output properties](guide/components/outputs)
  7390. */
  7391. (arg?: string | Input): any;
  7392. new (arg?: string | Input): any;
  7393. }
  7394. /**
  7395. * Type of metadata for an `Input` property.
  7396. *
  7397. * @publicApi
  7398. */
  7399. interface Input {
  7400. /**
  7401. * The name of the DOM property to which the input property is bound.
  7402. */
  7403. alias?: string;
  7404. /**
  7405. * Whether the input is required for the directive to function.
  7406. */
  7407. required?: boolean;
  7408. /**
  7409. * Function with which to transform the input value before assigning it to the directive instance.
  7410. */
  7411. transform?: (value: any) => any;
  7412. }
  7413. /**
  7414. * @Annotation
  7415. * @publicApi
  7416. */
  7417. declare const Input: InputDecorator;
  7418. /**
  7419. * Type of the Output decorator / constructor function.
  7420. *
  7421. * @publicApi
  7422. */
  7423. interface OutputDecorator {
  7424. /**
  7425. * Decorator that marks a class field as an output property and supplies configuration metadata.
  7426. * The DOM property bound to the output property is automatically updated during change detection.
  7427. *
  7428. * @usageNotes
  7429. *
  7430. * You can supply an optional name to use in templates when the
  7431. * component is instantiated, that maps to the
  7432. * name of the bound property. By default, the original
  7433. * name of the bound property is used for output binding.
  7434. *
  7435. * See `Input` decorator for an example of providing a binding name.
  7436. *
  7437. * @see [Input properties](guide/components/inputs)
  7438. * @see [Output properties](guide/components/outputs)
  7439. *
  7440. */
  7441. (alias?: string): any;
  7442. new (alias?: string): any;
  7443. }
  7444. /**
  7445. * Type of the Output metadata.
  7446. *
  7447. * @publicApi
  7448. */
  7449. interface Output {
  7450. /**
  7451. * The name of the DOM property to which the output property is bound.
  7452. */
  7453. alias?: string;
  7454. }
  7455. /**
  7456. * @Annotation
  7457. * @publicApi
  7458. */
  7459. declare const Output: OutputDecorator;
  7460. /**
  7461. * Type of the HostBinding decorator / constructor function.
  7462. *
  7463. * @publicApi
  7464. */
  7465. interface HostBindingDecorator {
  7466. /**
  7467. * Decorator that marks a DOM property or an element class, style or attribute as a host-binding
  7468. * property and supplies configuration metadata. Angular automatically checks host bindings during
  7469. * change detection, and if a binding changes it updates the host element of the directive.
  7470. *
  7471. * @usageNotes
  7472. *
  7473. * The following example creates a directive that sets the `valid` and `invalid`
  7474. * class, a style color, and an id on the DOM element that has an `ngModel` directive on it.
  7475. *
  7476. * ```ts
  7477. * @Directive({selector: '[ngModel]'})
  7478. * class NgModelStatus {
  7479. * constructor(public control: NgModel) {}
  7480. * // class bindings
  7481. * @HostBinding('class.valid') get valid() { return this.control.valid; }
  7482. * @HostBinding('class.invalid') get invalid() { return this.control.invalid; }
  7483. *
  7484. * // style binding
  7485. * @HostBinding('style.color') get color() { return this.control.valid ? 'green': 'red'; }
  7486. *
  7487. * // style binding also supports a style unit extension
  7488. * @HostBinding('style.width.px') @Input() width: number = 500;
  7489. *
  7490. * // attribute binding
  7491. * @HostBinding('attr.aria-required')
  7492. * @Input() required: boolean = false;
  7493. *
  7494. * // property binding
  7495. * @HostBinding('id') get id() { return this.control.value?.length ? 'odd': 'even'; }
  7496. *
  7497. * @Component({
  7498. * selector: 'app',
  7499. * template: `<input [(ngModel)]="prop">`,
  7500. * })
  7501. * class App {
  7502. * prop;
  7503. * }
  7504. * ```
  7505. *
  7506. */
  7507. (hostPropertyName?: string): any;
  7508. new (hostPropertyName?: string): any;
  7509. }
  7510. /**
  7511. * Type of the HostBinding metadata.
  7512. *
  7513. * @publicApi
  7514. */
  7515. interface HostBinding {
  7516. /**
  7517. * The DOM property that is bound to a data property.
  7518. * This field also accepts:
  7519. * * classes, prefixed by `class.`
  7520. * * styles, prefixed by `style.`
  7521. * * attributes, prefixed by `attr.`
  7522. */
  7523. hostPropertyName?: string;
  7524. }
  7525. /**
  7526. * @Annotation
  7527. * @publicApi
  7528. */
  7529. declare const HostBinding: HostBindingDecorator;
  7530. /**
  7531. * Type of the HostListener decorator / constructor function.
  7532. *
  7533. * @publicApi
  7534. */
  7535. interface HostListenerDecorator {
  7536. /**
  7537. * Decorator that declares a DOM event to listen for,
  7538. * and provides a handler method to run when that event occurs.
  7539. *
  7540. * Angular invokes the supplied handler method when the host element emits the specified event,
  7541. * and updates the bound element with the result.
  7542. *
  7543. * If the handler method returns false, applies `preventDefault` on the bound element.
  7544. *
  7545. * @usageNotes
  7546. *
  7547. * The following example declares a directive
  7548. * that attaches a click listener to a button and counts clicks.
  7549. *
  7550. * ```ts
  7551. * @Directive({selector: 'button[counting]'})
  7552. * class CountClicks {
  7553. * numberOfClicks = 0;
  7554. *
  7555. * @HostListener('click', ['$event.target'])
  7556. * onClick(btn) {
  7557. * console.log('button', btn, 'number of clicks:', this.numberOfClicks++);
  7558. * }
  7559. * }
  7560. *
  7561. * @Component({
  7562. * selector: 'app',
  7563. * template: '<button counting>Increment</button>',
  7564. * })
  7565. * class App {}
  7566. * ```
  7567. *
  7568. * The following example registers another DOM event handler that listens for `Enter` key-press
  7569. * events on the global `window`.
  7570. * ```ts
  7571. * import { HostListener, Component } from "@angular/core";
  7572. *
  7573. * @Component({
  7574. * selector: 'app',
  7575. * template: `<h1>Hello, you have pressed enter {{counter}} number of times!</h1> Press enter
  7576. * key to increment the counter. <button (click)="resetCounter()">Reset Counter</button>`
  7577. * })
  7578. * class AppComponent {
  7579. * counter = 0;
  7580. * @HostListener('window:keydown.enter', ['$event'])
  7581. * handleKeyDown(event: KeyboardEvent) {
  7582. * this.counter++;
  7583. * }
  7584. * resetCounter() {
  7585. * this.counter = 0;
  7586. * }
  7587. * }
  7588. * ```
  7589. * The list of valid key names for `keydown` and `keyup` events
  7590. * can be found here:
  7591. * https://www.w3.org/TR/DOM-Level-3-Events-key/#named-key-attribute-values
  7592. *
  7593. * Note that keys can also be combined, e.g. `@HostListener('keydown.shift.a')`.
  7594. *
  7595. * The global target names that can be used to prefix an event name are
  7596. * `document:`, `window:` and `body:`.
  7597. *
  7598. */
  7599. (eventName: string, args?: string[]): any;
  7600. new (eventName: string, args?: string[]): any;
  7601. }
  7602. /**
  7603. * Type of the HostListener metadata.
  7604. *
  7605. * @publicApi
  7606. */
  7607. interface HostListener {
  7608. /**
  7609. * The DOM event to listen for.
  7610. */
  7611. eventName?: string;
  7612. /**
  7613. * A set of arguments to pass to the handler method when the event occurs.
  7614. */
  7615. args?: string[];
  7616. }
  7617. /**
  7618. * @Annotation
  7619. * @publicApi
  7620. */
  7621. declare const HostListener: HostListenerDecorator;
  7622. declare global {
  7623. /**
  7624. * Indicates whether HMR is enabled for the application.
  7625. *
  7626. * `ngHmrMode` is a global flag set by Angular's CLI.
  7627. *
  7628. * @remarks
  7629. * - **Internal Angular Flag**: This is an *internal* Angular flag (not a public API), avoid relying on it in application code.
  7630. * - **Avoid Direct Use**: This variable is intended for runtime configuration; it should not be accessed directly in application code.
  7631. */
  7632. var ngHmrMode: boolean | undefined;
  7633. }
  7634. declare global {
  7635. const ngJitMode: boolean;
  7636. }
  7637. declare global {
  7638. /**
  7639. * Indicates whether the application is operating in server-rendering mode.
  7640. *
  7641. * `ngServerMode` is a global flag set by Angular's server-side rendering mechanisms,
  7642. * typically configured by `provideServerRendering` and `platformServer` during runtime.
  7643. *
  7644. * @remarks
  7645. * - **Internal Angular Flag**: This is an *internal* Angular flag (not a public API), avoid relying on it in application code.
  7646. * - **Avoid Direct Use**: This variable is intended for runtime configuration; it should not be accessed directly in application code.
  7647. */
  7648. var ngServerMode: boolean | undefined;
  7649. }
  7650. /**
  7651. * A type describing supported iterable types.
  7652. *
  7653. * @publicApi
  7654. */
  7655. type NgIterable<T> = Array<T> | Iterable<T>;
  7656. /**
  7657. * A strategy for tracking changes over time to an iterable. Used by {@link /api/common/NgForOf NgForOf} to
  7658. * respond to changes in an iterable by effecting equivalent changes in the DOM.
  7659. *
  7660. * @publicApi
  7661. */
  7662. interface IterableDiffer<V> {
  7663. /**
  7664. * Compute a difference between the previous state and the new `object` state.
  7665. *
  7666. * @param object containing the new value.
  7667. * @returns an object describing the difference. The return value is only valid until the next
  7668. * `diff()` invocation.
  7669. */
  7670. diff(object: NgIterable<V> | undefined | null): IterableChanges<V> | null;
  7671. }
  7672. /**
  7673. * An object describing the changes in the `Iterable` collection since last time
  7674. * `IterableDiffer#diff()` was invoked.
  7675. *
  7676. * @publicApi
  7677. */
  7678. interface IterableChanges<V> {
  7679. /**
  7680. * Iterate over all changes. `IterableChangeRecord` will contain information about changes
  7681. * to each item.
  7682. */
  7683. forEachItem(fn: (record: IterableChangeRecord<V>) => void): void;
  7684. /**
  7685. * Iterate over a set of operations which when applied to the original `Iterable` will produce the
  7686. * new `Iterable`.
  7687. *
  7688. * NOTE: These are not necessarily the actual operations which were applied to the original
  7689. * `Iterable`, rather these are a set of computed operations which may not be the same as the
  7690. * ones applied.
  7691. *
  7692. * @param record A change which needs to be applied
  7693. * @param previousIndex The `IterableChangeRecord#previousIndex` of the `record` refers to the
  7694. * original `Iterable` location, where as `previousIndex` refers to the transient location
  7695. * of the item, after applying the operations up to this point.
  7696. * @param currentIndex The `IterableChangeRecord#currentIndex` of the `record` refers to the
  7697. * original `Iterable` location, where as `currentIndex` refers to the transient location
  7698. * of the item, after applying the operations up to this point.
  7699. */
  7700. forEachOperation(fn: (record: IterableChangeRecord<V>, previousIndex: number | null, currentIndex: number | null) => void): void;
  7701. /**
  7702. * Iterate over changes in the order of original `Iterable` showing where the original items
  7703. * have moved.
  7704. */
  7705. forEachPreviousItem(fn: (record: IterableChangeRecord<V>) => void): void;
  7706. /** Iterate over all added items. */
  7707. forEachAddedItem(fn: (record: IterableChangeRecord<V>) => void): void;
  7708. /** Iterate over all moved items. */
  7709. forEachMovedItem(fn: (record: IterableChangeRecord<V>) => void): void;
  7710. /** Iterate over all removed items. */
  7711. forEachRemovedItem(fn: (record: IterableChangeRecord<V>) => void): void;
  7712. /**
  7713. * Iterate over all items which had their identity (as computed by the `TrackByFunction`)
  7714. * changed.
  7715. */
  7716. forEachIdentityChange(fn: (record: IterableChangeRecord<V>) => void): void;
  7717. }
  7718. /**
  7719. * Record representing the item change information.
  7720. *
  7721. * @publicApi
  7722. */
  7723. interface IterableChangeRecord<V> {
  7724. /** Current index of the item in `Iterable` or null if removed. */
  7725. readonly currentIndex: number | null;
  7726. /** Previous index of the item in `Iterable` or null if added. */
  7727. readonly previousIndex: number | null;
  7728. /** The item. */
  7729. readonly item: V;
  7730. /** Track by identity as computed by the `TrackByFunction`. */
  7731. readonly trackById: any;
  7732. }
  7733. /**
  7734. * A function optionally passed into the `NgForOf` directive to customize how `NgForOf` uniquely
  7735. * identifies items in an iterable.
  7736. *
  7737. * `NgForOf` needs to uniquely identify items in the iterable to correctly perform DOM updates
  7738. * when items in the iterable are reordered, new items are added, or existing items are removed.
  7739. *
  7740. *
  7741. * In all of these scenarios it is usually desirable to only update the DOM elements associated
  7742. * with the items affected by the change. This behavior is important to:
  7743. *
  7744. * - preserve any DOM-specific UI state (like cursor position, focus, text selection) when the
  7745. * iterable is modified
  7746. * - enable animation of item addition, removal, and iterable reordering
  7747. * - preserve the value of the `<select>` element when nested `<option>` elements are dynamically
  7748. * populated using `NgForOf` and the bound iterable is updated
  7749. *
  7750. * A common use for custom `trackBy` functions is when the model that `NgForOf` iterates over
  7751. * contains a property with a unique identifier. For example, given a model:
  7752. *
  7753. * ```ts
  7754. * class User {
  7755. * id: number;
  7756. * name: string;
  7757. * ...
  7758. * }
  7759. * ```
  7760. * a custom `trackBy` function could look like the following:
  7761. * ```ts
  7762. * function userTrackBy(index, user) {
  7763. * return user.id;
  7764. * }
  7765. * ```
  7766. *
  7767. * A custom `trackBy` function must have several properties:
  7768. *
  7769. * - be [idempotent](https://en.wikipedia.org/wiki/Idempotence) (be without side effects, and always
  7770. * return the same value for a given input)
  7771. * - return unique value for all unique inputs
  7772. * - be fast
  7773. *
  7774. * @see [`NgForOf#ngForTrackBy`](api/common/NgForOf#ngForTrackBy)
  7775. * @publicApi
  7776. */
  7777. interface TrackByFunction<T> {
  7778. /**
  7779. * @param index The index of the item within the iterable.
  7780. * @param item The item in the iterable.
  7781. */
  7782. <U extends T>(index: number, item: T & U): any;
  7783. }
  7784. /**
  7785. * Provides a factory for {@link IterableDiffer}.
  7786. *
  7787. * @publicApi
  7788. */
  7789. interface IterableDifferFactory {
  7790. supports(objects: any): boolean;
  7791. create<V>(trackByFn?: TrackByFunction<V>): IterableDiffer<V>;
  7792. }
  7793. /**
  7794. * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.
  7795. *
  7796. * @publicApi
  7797. */
  7798. declare class IterableDiffers {
  7799. private factories;
  7800. /** @nocollapse */
  7801. static ɵprov: unknown;
  7802. constructor(factories: IterableDifferFactory[]);
  7803. static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers;
  7804. /**
  7805. * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the
  7806. * inherited {@link IterableDiffers} instance with the provided factories and return a new
  7807. * {@link IterableDiffers} instance.
  7808. *
  7809. * @usageNotes
  7810. * ### Example
  7811. *
  7812. * The following example shows how to extend an existing list of factories,
  7813. * which will only be applied to the injector for this component and its children.
  7814. * This step is all that's required to make a new {@link IterableDiffer} available.
  7815. *
  7816. * ```ts
  7817. * @Component({
  7818. * viewProviders: [
  7819. * IterableDiffers.extend([new ImmutableListDiffer()])
  7820. * ]
  7821. * })
  7822. * ```
  7823. */
  7824. static extend(factories: IterableDifferFactory[]): StaticProvider;
  7825. find(iterable: any): IterableDifferFactory;
  7826. }
  7827. /**
  7828. * Type of the Inject decorator / constructor function.
  7829. *
  7830. * @publicApi
  7831. */
  7832. interface InjectDecorator {
  7833. /**
  7834. * Parameter decorator on a dependency parameter of a class constructor
  7835. * that specifies a custom provider of the dependency.
  7836. *
  7837. * @usageNotes
  7838. * The following example shows a class constructor that specifies a
  7839. * custom provider of a dependency using the parameter decorator.
  7840. *
  7841. * When `@Inject()` is not present, the injector uses the type annotation of the
  7842. * parameter as the provider.
  7843. *
  7844. * {@example core/di/ts/metadata_spec.ts region='InjectWithoutDecorator'}
  7845. *
  7846. * @see [Dependency Injection Guide](guide/di/dependency-injection
  7847. *
  7848. */
  7849. (token: any): any;
  7850. new (token: any): Inject;
  7851. }
  7852. /**
  7853. * Type of the Inject metadata.
  7854. *
  7855. * @publicApi
  7856. */
  7857. interface Inject {
  7858. /**
  7859. * A DI token that maps to the dependency to be injected.
  7860. */
  7861. token: any;
  7862. }
  7863. /**
  7864. * Inject decorator and metadata.
  7865. *
  7866. * @Annotation
  7867. * @publicApi
  7868. */
  7869. declare const Inject: InjectDecorator;
  7870. /**
  7871. * Type of the Optional decorator / constructor function.
  7872. *
  7873. * @publicApi
  7874. */
  7875. interface OptionalDecorator {
  7876. /**
  7877. * Parameter decorator to be used on constructor parameters,
  7878. * which marks the parameter as being an optional dependency.
  7879. * The DI framework provides `null` if the dependency is not found.
  7880. *
  7881. * Can be used together with other parameter decorators
  7882. * that modify how dependency injection operates.
  7883. *
  7884. * @usageNotes
  7885. *
  7886. * The following code allows the possibility of a `null` result:
  7887. *
  7888. * {@example core/di/ts/metadata_spec.ts region='Optional'}
  7889. *
  7890. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  7891. */
  7892. (): any;
  7893. new (): Optional;
  7894. }
  7895. /**
  7896. * Type of the Optional metadata.
  7897. *
  7898. * @publicApi
  7899. */
  7900. interface Optional {
  7901. }
  7902. /**
  7903. * Optional decorator and metadata.
  7904. *
  7905. * @Annotation
  7906. * @publicApi
  7907. */
  7908. declare const Optional: OptionalDecorator;
  7909. /**
  7910. * Type of the Self decorator / constructor function.
  7911. *
  7912. * @publicApi
  7913. */
  7914. interface SelfDecorator {
  7915. /**
  7916. * Parameter decorator to be used on constructor parameters,
  7917. * which tells the DI framework to start dependency resolution from the local injector.
  7918. *
  7919. * Resolution works upward through the injector hierarchy, so the children
  7920. * of this class must configure their own providers or be prepared for a `null` result.
  7921. *
  7922. * @usageNotes
  7923. *
  7924. * In the following example, the dependency can be resolved
  7925. * by the local injector when instantiating the class itself, but not
  7926. * when instantiating a child.
  7927. *
  7928. * {@example core/di/ts/metadata_spec.ts region='Self'}
  7929. *
  7930. * @see {@link SkipSelf}
  7931. * @see {@link Optional}
  7932. *
  7933. */
  7934. (): any;
  7935. new (): Self;
  7936. }
  7937. /**
  7938. * Type of the Self metadata.
  7939. *
  7940. * @publicApi
  7941. */
  7942. interface Self {
  7943. }
  7944. /**
  7945. * Self decorator and metadata.
  7946. *
  7947. * @Annotation
  7948. * @publicApi
  7949. */
  7950. declare const Self: SelfDecorator;
  7951. /**
  7952. * Type of the `SkipSelf` decorator / constructor function.
  7953. *
  7954. * @publicApi
  7955. */
  7956. interface SkipSelfDecorator {
  7957. /**
  7958. * Parameter decorator to be used on constructor parameters,
  7959. * which tells the DI framework to start dependency resolution from the parent injector.
  7960. * Resolution works upward through the injector hierarchy, so the local injector
  7961. * is not checked for a provider.
  7962. *
  7963. * @usageNotes
  7964. *
  7965. * In the following example, the dependency can be resolved when
  7966. * instantiating a child, but not when instantiating the class itself.
  7967. *
  7968. * {@example core/di/ts/metadata_spec.ts region='SkipSelf'}
  7969. *
  7970. * @see [Dependency Injection guide](guide/di/di-in-action#skip).
  7971. * @see {@link Self}
  7972. * @see {@link Optional}
  7973. *
  7974. */
  7975. (): any;
  7976. new (): SkipSelf;
  7977. }
  7978. /**
  7979. * Type of the `SkipSelf` metadata.
  7980. *
  7981. * @publicApi
  7982. */
  7983. interface SkipSelf {
  7984. }
  7985. /**
  7986. * `SkipSelf` decorator and metadata.
  7987. *
  7988. * @Annotation
  7989. * @publicApi
  7990. */
  7991. declare const SkipSelf: SkipSelfDecorator;
  7992. /**
  7993. * Type of the `Host` decorator / constructor function.
  7994. *
  7995. * @publicApi
  7996. */
  7997. interface HostDecorator {
  7998. /**
  7999. * Parameter decorator on a view-provider parameter of a class constructor
  8000. * that tells the DI framework to resolve the view by checking injectors of child
  8001. * elements, and stop when reaching the host element of the current component.
  8002. *
  8003. * @usageNotes
  8004. *
  8005. * The following shows use with the `@Optional` decorator, and allows for a `null` result.
  8006. *
  8007. * {@example core/di/ts/metadata_spec.ts region='Host'}
  8008. *
  8009. * For an extended example, see ["Dependency Injection
  8010. * Guide"](guide/di/di-in-action#optional).
  8011. */
  8012. (): any;
  8013. new (): Host;
  8014. }
  8015. /**
  8016. * Type of the Host metadata.
  8017. *
  8018. * @publicApi
  8019. */
  8020. interface Host {
  8021. }
  8022. /**
  8023. * Host decorator and metadata.
  8024. *
  8025. * @Annotation
  8026. * @publicApi
  8027. */
  8028. declare const Host: HostDecorator;
  8029. /**
  8030. * Runs the given function in the [context](guide/di/dependency-injection-context) of the given
  8031. * `Injector`.
  8032. *
  8033. * Within the function's stack frame, [`inject`](api/core/inject) can be used to inject dependencies
  8034. * from the given `Injector`. Note that `inject` is only usable synchronously, and cannot be used in
  8035. * any asynchronous callbacks or after any `await` points.
  8036. *
  8037. * @param injector the injector which will satisfy calls to [`inject`](api/core/inject) while `fn`
  8038. * is executing
  8039. * @param fn the closure to be run in the context of `injector`
  8040. * @returns the return value of the function, if any
  8041. * @publicApi
  8042. */
  8043. declare function runInInjectionContext<ReturnT>(injector: Injector, fn: () => ReturnT): ReturnT;
  8044. /**
  8045. * Asserts that the current stack frame is within an [injection
  8046. * context](guide/di/dependency-injection-context) and has access to `inject`.
  8047. *
  8048. * @param debugFn a reference to the function making the assertion (used for the error message).
  8049. *
  8050. * @publicApi
  8051. */
  8052. declare function assertInInjectionContext(debugFn: Function): void;
  8053. /**
  8054. * An interface that a function passed into `forwardRef` has to implement.
  8055. *
  8056. * @usageNotes
  8057. * ### Example
  8058. *
  8059. * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref_fn'}
  8060. * @publicApi
  8061. */
  8062. interface ForwardRefFn {
  8063. (): any;
  8064. }
  8065. /**
  8066. * Allows to refer to references which are not yet defined.
  8067. *
  8068. * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of
  8069. * DI is declared, but not yet defined. It is also used when the `token` which we use when creating
  8070. * a query is not yet defined.
  8071. *
  8072. * `forwardRef` is also used to break circularities in standalone components imports.
  8073. *
  8074. * @usageNotes
  8075. * ### Circular dependency example
  8076. * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}
  8077. *
  8078. * ### Circular standalone reference import example
  8079. * ```angular-ts
  8080. * @Component({
  8081. * standalone: true,
  8082. * imports: [ChildComponent],
  8083. * selector: 'app-parent',
  8084. * template: `<app-child [hideParent]="hideParent"></app-child>`,
  8085. * })
  8086. * export class ParentComponent {
  8087. * @Input() hideParent: boolean;
  8088. * }
  8089. *
  8090. *
  8091. * @Component({
  8092. * standalone: true,
  8093. * imports: [CommonModule, forwardRef(() => ParentComponent)],
  8094. * selector: 'app-child',
  8095. * template: `<app-parent *ngIf="!hideParent"></app-parent>`,
  8096. * })
  8097. * export class ChildComponent {
  8098. * @Input() hideParent: boolean;
  8099. * }
  8100. * ```
  8101. *
  8102. * @publicApi
  8103. */
  8104. declare function forwardRef(forwardRefFn: ForwardRefFn): Type$1<any>;
  8105. /**
  8106. * Lazily retrieves the reference value from a forwardRef.
  8107. *
  8108. * Acts as the identity function when given a non-forward-ref value.
  8109. *
  8110. * @usageNotes
  8111. * ### Example
  8112. *
  8113. * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}
  8114. *
  8115. * @see {@link forwardRef}
  8116. * @publicApi
  8117. */
  8118. declare function resolveForwardRef<T>(type: T): T;
  8119. /**
  8120. * Injectable providers used in `@Injectable` decorator.
  8121. *
  8122. * @publicApi
  8123. */
  8124. type InjectableProvider = ValueSansProvider | ExistingSansProvider | StaticClassSansProvider | ConstructorSansProvider | FactorySansProvider | ClassSansProvider;
  8125. /**
  8126. * Type of the Injectable decorator / constructor function.
  8127. *
  8128. * @publicApi
  8129. */
  8130. interface InjectableDecorator {
  8131. /**
  8132. * Decorator that marks a class as available to be
  8133. * provided and injected as a dependency.
  8134. *
  8135. * @see [Introduction to Services and DI](guide/di)
  8136. * @see [Dependency Injection Guide](guide/di/dependency-injection
  8137. *
  8138. * @usageNotes
  8139. *
  8140. * Marking a class with `@Injectable` ensures that the compiler
  8141. * will generate the necessary metadata to create the class's
  8142. * dependencies when the class is injected.
  8143. *
  8144. * The following example shows how a service class is properly
  8145. * marked so that a supporting service can be injected upon creation.
  8146. *
  8147. * {@example core/di/ts/metadata_spec.ts region='Injectable'}
  8148. *
  8149. */
  8150. (): TypeDecorator;
  8151. (options?: {
  8152. providedIn: Type$1<any> | 'root' | 'platform' | 'any' | null;
  8153. } & InjectableProvider): TypeDecorator;
  8154. new (): Injectable;
  8155. new (options?: {
  8156. providedIn: Type$1<any> | 'root' | 'platform' | 'any' | null;
  8157. } & InjectableProvider): Injectable;
  8158. }
  8159. /**
  8160. * Type of the Injectable metadata.
  8161. *
  8162. * @publicApi
  8163. */
  8164. interface Injectable {
  8165. /**
  8166. * Determines which injectors will provide the injectable.
  8167. *
  8168. * - `Type<any>` - associates the injectable with an `@NgModule` or other `InjectorType`. This
  8169. * option is DEPRECATED.
  8170. * - 'null' : Equivalent to `undefined`. The injectable is not provided in any scope automatically
  8171. * and must be added to a `providers` array of an [@NgModule](api/core/NgModule#providers),
  8172. * [@Component](api/core/Directive#providers) or [@Directive](api/core/Directive#providers).
  8173. *
  8174. * The following options specify that this injectable should be provided in one of the following
  8175. * injectors:
  8176. * - 'root' : The application-level injector in most apps.
  8177. * - 'platform' : A special singleton platform injector shared by all
  8178. * applications on the page.
  8179. * - 'any' : Provides a unique instance in each lazy loaded module while all eagerly loaded
  8180. * modules share one instance. This option is DEPRECATED.
  8181. *
  8182. */
  8183. providedIn?: Type$1<any> | 'root' | 'platform' | 'any' | null;
  8184. }
  8185. /**
  8186. * Injectable decorator and metadata.
  8187. *
  8188. * @Annotation
  8189. * @publicApi
  8190. */
  8191. declare const Injectable: InjectableDecorator;
  8192. /**
  8193. * A multi-provider token for initialization functions that will run upon construction of an
  8194. * environment injector.
  8195. *
  8196. * @deprecated from v19.0.0, use provideEnvironmentInitializer instead
  8197. *
  8198. * @see {@link provideEnvironmentInitializer}
  8199. *
  8200. * Note: As opposed to the `APP_INITIALIZER` token, the `ENVIRONMENT_INITIALIZER` functions are not awaited,
  8201. * hence they should not be `async`.
  8202. *
  8203. * @publicApi
  8204. */
  8205. declare const ENVIRONMENT_INITIALIZER: InjectionToken<readonly (() => void)[]>;
  8206. /*!
  8207. * @license
  8208. * Copyright Google LLC All Rights Reserved.
  8209. *
  8210. * Use of this source code is governed by an MIT-style license that can be
  8211. * found in the LICENSE file at https://angular.dev/license
  8212. */
  8213. /**
  8214. * Creates a token that can be used to inject static attributes of the host node.
  8215. *
  8216. * @usageNotes
  8217. * ### Injecting an attribute that is known to exist
  8218. * ```ts
  8219. * @Directive()
  8220. * class MyDir {
  8221. * attr: string = inject(new HostAttributeToken('some-attr'));
  8222. * }
  8223. * ```
  8224. *
  8225. * ### Optionally injecting an attribute
  8226. * ```ts
  8227. * @Directive()
  8228. * class MyDir {
  8229. * attr: string | null = inject(new HostAttributeToken('some-attr'), {optional: true});
  8230. * }
  8231. * ```
  8232. * @publicApi
  8233. */
  8234. declare class HostAttributeToken {
  8235. private attributeName;
  8236. constructor(attributeName: string);
  8237. toString(): string;
  8238. }
  8239. /**
  8240. * Generated instruction: injects a token from the currently active injector.
  8241. *
  8242. * (Additional documentation moved to `inject`, as it is the public API, and an alias for this
  8243. * instruction)
  8244. *
  8245. * @see inject
  8246. * @codeGenApi
  8247. * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to npm.
  8248. */
  8249. declare function ɵɵinject<T>(token: ProviderToken<T>): T;
  8250. declare function ɵɵinject<T>(token: ProviderToken<T>, flags?: InjectFlags): T | null;
  8251. declare function ɵɵinject(token: HostAttributeToken): string;
  8252. declare function ɵɵinject(token: HostAttributeToken, flags?: InjectFlags): string | null;
  8253. declare function ɵɵinject<T>(token: ProviderToken<T> | HostAttributeToken, flags?: InjectFlags): string | null;
  8254. /**
  8255. * Throws an error indicating that a factory function could not be generated by the compiler for a
  8256. * particular class.
  8257. *
  8258. * The name of the class is not mentioned here, but will be in the generated factory function name
  8259. * and thus in the stack trace.
  8260. *
  8261. * @codeGenApi
  8262. */
  8263. declare function ɵɵinvalidFactoryDep(index: number): never;
  8264. /**
  8265. * @param token A token that represents a dependency that should be injected.
  8266. * @returns the injected value if operation is successful, `null` otherwise.
  8267. * @throws if called outside of a supported context.
  8268. *
  8269. * @publicApi
  8270. */
  8271. declare function inject<T>(token: ProviderToken<T>): T;
  8272. /**
  8273. * @param token A token that represents a dependency that should be injected.
  8274. * @param flags Control how injection is executed. The flags correspond to injection strategies that
  8275. * can be specified with parameter decorators `@Host`, `@Self`, `@SkipSelf`, and `@Optional`.
  8276. * @returns the injected value if operation is successful, `null` otherwise.
  8277. * @throws if called outside of a supported context.
  8278. *
  8279. * @publicApi
  8280. * @deprecated prefer an options object instead of `InjectFlags`
  8281. */
  8282. declare function inject<T>(token: ProviderToken<T>, flags?: InjectFlags): T | null;
  8283. /**
  8284. * @param token A token that represents a dependency that should be injected.
  8285. * @param options Control how injection is executed. Options correspond to injection strategies
  8286. * that can be specified with parameter decorators `@Host`, `@Self`, `@SkipSelf`, and
  8287. * `@Optional`.
  8288. * @returns the injected value if operation is successful.
  8289. * @throws if called outside of a supported context, or if the token is not found.
  8290. *
  8291. * @publicApi
  8292. */
  8293. declare function inject<T>(token: ProviderToken<T>, options: InjectOptions & {
  8294. optional?: false;
  8295. }): T;
  8296. /**
  8297. * @param token A token that represents a dependency that should be injected.
  8298. * @param options Control how injection is executed. Options correspond to injection strategies
  8299. * that can be specified with parameter decorators `@Host`, `@Self`, `@SkipSelf`, and
  8300. * `@Optional`.
  8301. * @returns the injected value if operation is successful, `null` if the token is not
  8302. * found and optional injection has been requested.
  8303. * @throws if called outside of a supported context, or if the token is not found and optional
  8304. * injection was not requested.
  8305. *
  8306. * @publicApi
  8307. */
  8308. declare function inject<T>(token: ProviderToken<T>, options: InjectOptions): T | null;
  8309. /**
  8310. * @param token A token that represents a static attribute on the host node that should be injected.
  8311. * @returns Value of the attribute if it exists.
  8312. * @throws If called outside of a supported context or the attribute does not exist.
  8313. *
  8314. * @publicApi
  8315. */
  8316. declare function inject(token: HostAttributeToken): string;
  8317. /**
  8318. * @param token A token that represents a static attribute on the host node that should be injected.
  8319. * @returns Value of the attribute if it exists, otherwise `null`.
  8320. * @throws If called outside of a supported context.
  8321. *
  8322. * @publicApi
  8323. */
  8324. declare function inject(token: HostAttributeToken, options: {
  8325. optional: true;
  8326. }): string | null;
  8327. /**
  8328. * @param token A token that represents a static attribute on the host node that should be injected.
  8329. * @returns Value of the attribute if it exists.
  8330. * @throws If called outside of a supported context or the attribute does not exist.
  8331. *
  8332. * @publicApi
  8333. */
  8334. declare function inject(token: HostAttributeToken, options: {
  8335. optional: false;
  8336. }): string;
  8337. declare function convertToBitFlags(flags: InjectOptions | InjectFlags | undefined): InjectFlags | undefined;
  8338. /**
  8339. * An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors.
  8340. *
  8341. * Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a
  8342. * project.
  8343. *
  8344. * @publicApi
  8345. */
  8346. declare const INJECTOR: InjectionToken<Injector>;
  8347. /**
  8348. * A token that can be used to inject the tag name of the host node.
  8349. *
  8350. * @usageNotes
  8351. * ### Injecting a tag name that is known to exist
  8352. * ```ts
  8353. * @Directive()
  8354. * class MyDir {
  8355. * tagName: string = inject(HOST_TAG_NAME);
  8356. * }
  8357. * ```
  8358. *
  8359. * ### Optionally injecting a tag name
  8360. * ```ts
  8361. * @Directive()
  8362. * class MyDir {
  8363. * tagName: string | null = inject(HOST_TAG_NAME, {optional: true});
  8364. * }
  8365. * ```
  8366. * @publicApi
  8367. */
  8368. declare const HOST_TAG_NAME: InjectionToken<string>;
  8369. /**
  8370. * A differ that tracks changes made to an object over time.
  8371. *
  8372. * @publicApi
  8373. */
  8374. interface KeyValueDiffer<K, V> {
  8375. /**
  8376. * Compute a difference between the previous state and the new `object` state.
  8377. *
  8378. * @param object containing the new value.
  8379. * @returns an object describing the difference. The return value is only valid until the next
  8380. * `diff()` invocation.
  8381. */
  8382. diff(object: Map<K, V>): KeyValueChanges<K, V> | null;
  8383. /**
  8384. * Compute a difference between the previous state and the new `object` state.
  8385. *
  8386. * @param object containing the new value.
  8387. * @returns an object describing the difference. The return value is only valid until the next
  8388. * `diff()` invocation.
  8389. */
  8390. diff(object: {
  8391. [key: string]: V;
  8392. }): KeyValueChanges<string, V> | null;
  8393. }
  8394. /**
  8395. * An object describing the changes in the `Map` or `{[k:string]: string}` since last time
  8396. * `KeyValueDiffer#diff()` was invoked.
  8397. *
  8398. * @publicApi
  8399. */
  8400. interface KeyValueChanges<K, V> {
  8401. /**
  8402. * Iterate over all changes. `KeyValueChangeRecord` will contain information about changes
  8403. * to each item.
  8404. */
  8405. forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  8406. /**
  8407. * Iterate over changes in the order of original Map showing where the original items
  8408. * have moved.
  8409. */
  8410. forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  8411. /**
  8412. * Iterate over all keys for which values have changed.
  8413. */
  8414. forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  8415. /**
  8416. * Iterate over all added items.
  8417. */
  8418. forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  8419. /**
  8420. * Iterate over all removed items.
  8421. */
  8422. forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  8423. }
  8424. /**
  8425. * Record representing the item change information.
  8426. *
  8427. * @publicApi
  8428. */
  8429. interface KeyValueChangeRecord<K, V> {
  8430. /**
  8431. * Current key in the Map.
  8432. */
  8433. readonly key: K;
  8434. /**
  8435. * Current value for the key or `null` if removed.
  8436. */
  8437. readonly currentValue: V | null;
  8438. /**
  8439. * Previous value for the key or `null` if added.
  8440. */
  8441. readonly previousValue: V | null;
  8442. }
  8443. /**
  8444. * Provides a factory for {@link KeyValueDiffer}.
  8445. *
  8446. * @publicApi
  8447. */
  8448. interface KeyValueDifferFactory {
  8449. /**
  8450. * Test to see if the differ knows how to diff this kind of object.
  8451. */
  8452. supports(objects: any): boolean;
  8453. /**
  8454. * Create a `KeyValueDiffer`.
  8455. */
  8456. create<K, V>(): KeyValueDiffer<K, V>;
  8457. }
  8458. /**
  8459. * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.
  8460. *
  8461. * @publicApi
  8462. */
  8463. declare class KeyValueDiffers {
  8464. /** @nocollapse */
  8465. static ɵprov: unknown;
  8466. private readonly factories;
  8467. constructor(factories: KeyValueDifferFactory[]);
  8468. static create<S>(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers;
  8469. /**
  8470. * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the
  8471. * inherited {@link KeyValueDiffers} instance with the provided factories and return a new
  8472. * {@link KeyValueDiffers} instance.
  8473. *
  8474. * @usageNotes
  8475. * ### Example
  8476. *
  8477. * The following example shows how to extend an existing list of factories,
  8478. * which will only be applied to the injector for this component and its children.
  8479. * This step is all that's required to make a new {@link KeyValueDiffer} available.
  8480. *
  8481. * ```ts
  8482. * @Component({
  8483. * viewProviders: [
  8484. * KeyValueDiffers.extend([new ImmutableMapDiffer()])
  8485. * ]
  8486. * })
  8487. * ```
  8488. */
  8489. static extend<S>(factories: KeyValueDifferFactory[]): StaticProvider;
  8490. find(kv: any): KeyValueDifferFactory;
  8491. }
  8492. declare function devModeEqual(a: any, b: any): boolean;
  8493. /**
  8494. * Base class that provides change detection functionality.
  8495. * A change-detection tree collects all views that are to be checked for changes.
  8496. * Use the methods to add and remove views from the tree, initiate change-detection,
  8497. * and explicitly mark views as _dirty_, meaning that they have changed and need to be re-rendered.
  8498. *
  8499. * @see [Using change detection hooks](guide/components/lifecycle#using-change-detection-hooks)
  8500. * @see [Defining custom change detection](guide/components/lifecycle#defining-custom-change-detection)
  8501. *
  8502. * @usageNotes
  8503. *
  8504. * The following examples demonstrate how to modify default change-detection behavior
  8505. * to perform explicit detection when needed.
  8506. *
  8507. * ### Use `markForCheck()` with `CheckOnce` strategy
  8508. *
  8509. * The following example sets the `OnPush` change-detection strategy for a component
  8510. * (`CheckOnce`, rather than the default `CheckAlways`), then forces a second check
  8511. * after an interval.
  8512. *
  8513. * {@example core/ts/change_detect/change-detection.ts region='mark-for-check'}
  8514. *
  8515. * ### Detach change detector to limit how often check occurs
  8516. *
  8517. * The following example defines a component with a large list of read-only data
  8518. * that is expected to change constantly, many times per second.
  8519. * To improve performance, we want to check and update the list
  8520. * less often than the changes actually occur. To do that, we detach
  8521. * the component's change detector and perform an explicit local check every five seconds.
  8522. *
  8523. * {@example core/ts/change_detect/change-detection.ts region='detach'}
  8524. *
  8525. *
  8526. * ### Reattaching a detached component
  8527. *
  8528. * The following example creates a component displaying live data.
  8529. * The component detaches its change detector from the main change detector tree
  8530. * when the `live` property is set to false, and reattaches it when the property
  8531. * becomes true.
  8532. *
  8533. * {@example core/ts/change_detect/change-detection.ts region='reattach'}
  8534. *
  8535. * @publicApi
  8536. */
  8537. declare abstract class ChangeDetectorRef {
  8538. /**
  8539. * When a view uses the {@link ChangeDetectionStrategy#OnPush} (checkOnce)
  8540. * change detection strategy, explicitly marks the view as changed so that
  8541. * it can be checked again.
  8542. *
  8543. * Components are normally marked as dirty (in need of rerendering) when inputs
  8544. * have changed or events have fired in the view. Call this method to ensure that
  8545. * a component is checked even if these triggers have not occurred.
  8546. *
  8547. * <!-- TODO: Add a link to a chapter on OnPush components -->
  8548. *
  8549. */
  8550. abstract markForCheck(): void;
  8551. /**
  8552. * Detaches this view from the change-detection tree.
  8553. * A detached view is not checked until it is reattached.
  8554. * Use in combination with `detectChanges()` to implement local change detection checks.
  8555. *
  8556. * Detached views are not checked during change detection runs until they are
  8557. * re-attached, even if they are marked as dirty.
  8558. *
  8559. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  8560. * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
  8561. *
  8562. */
  8563. abstract detach(): void;
  8564. /**
  8565. * Checks this view and its children. Use in combination with {@link ChangeDetectorRef#detach}
  8566. * to implement local change detection checks.
  8567. *
  8568. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  8569. * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
  8570. *
  8571. */
  8572. abstract detectChanges(): void;
  8573. /**
  8574. * Checks the change detector and its children, and throws if any changes are detected.
  8575. *
  8576. * Use in development mode to verify that running change detection doesn't introduce
  8577. * other changes. Calling it in production mode is a noop.
  8578. *
  8579. * @deprecated This is a test-only API that does not have a place in production interface.
  8580. * `checkNoChanges` is already part of an `ApplicationRef` tick when the app is running in dev
  8581. * mode. For more granular `checkNoChanges` validation, use `ComponentFixture`.
  8582. */
  8583. abstract checkNoChanges(): void;
  8584. /**
  8585. * Re-attaches the previously detached view to the change detection tree.
  8586. * Views are attached to the tree by default.
  8587. *
  8588. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  8589. *
  8590. */
  8591. abstract reattach(): void;
  8592. }
  8593. /** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */
  8594. declare function injectChangeDetectorRef(flags: InjectFlags): ChangeDetectorRef;
  8595. /**
  8596. * @deprecated v4.0.0 - Should not be part of public API.
  8597. * @publicApi
  8598. */
  8599. declare class DefaultIterableDiffer<V> implements IterableDiffer<V>, IterableChanges<V> {
  8600. readonly length: number;
  8601. readonly collection: V[] | Iterable<V> | null;
  8602. private _linkedRecords;
  8603. private _unlinkedRecords;
  8604. private _previousItHead;
  8605. private _itHead;
  8606. private _itTail;
  8607. private _additionsHead;
  8608. private _additionsTail;
  8609. private _movesHead;
  8610. private _movesTail;
  8611. private _removalsHead;
  8612. private _removalsTail;
  8613. private _identityChangesHead;
  8614. private _identityChangesTail;
  8615. private _trackByFn;
  8616. constructor(trackByFn?: TrackByFunction<V>);
  8617. forEachItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  8618. forEachOperation(fn: (item: IterableChangeRecord<V>, previousIndex: number | null, currentIndex: number | null) => void): void;
  8619. forEachPreviousItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  8620. forEachAddedItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  8621. forEachMovedItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  8622. forEachRemovedItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  8623. forEachIdentityChange(fn: (record: IterableChangeRecord_<V>) => void): void;
  8624. diff(collection: NgIterable<V> | null | undefined): DefaultIterableDiffer<V> | null;
  8625. onDestroy(): void;
  8626. check(collection: NgIterable<V>): boolean;
  8627. get isDirty(): boolean;
  8628. private _addToRemovals;
  8629. }
  8630. declare class IterableChangeRecord_<V> implements IterableChangeRecord<V> {
  8631. item: V;
  8632. trackById: any;
  8633. currentIndex: number | null;
  8634. previousIndex: number | null;
  8635. constructor(item: V, trackById: any);
  8636. }
  8637. /**
  8638. * An interface that is implemented by pipes in order to perform a transformation.
  8639. * Angular invokes the `transform` method with the value of a binding
  8640. * as the first argument, and any parameters as the second argument in list form.
  8641. *
  8642. * @usageNotes
  8643. *
  8644. * In the following example, `TruncatePipe` returns the shortened value with an added ellipses.
  8645. *
  8646. * <code-example path="core/ts/pipes/simple_truncate.ts" header="simple_truncate.ts"></code-example>
  8647. *
  8648. * Invoking `{{ 'It was the best of times' | truncate }}` in a template will produce `It was...`.
  8649. *
  8650. * In the following example, `TruncatePipe` takes parameters that sets the truncated length and the
  8651. * string to append with.
  8652. *
  8653. * <code-example path="core/ts/pipes/truncate.ts" header="truncate.ts"></code-example>
  8654. *
  8655. * Invoking `{{ 'It was the best of times' | truncate:4:'....' }}` in a template will produce `It
  8656. * was the best....`.
  8657. *
  8658. * @publicApi
  8659. */
  8660. interface PipeTransform {
  8661. transform(value: any, ...args: any[]): any;
  8662. }
  8663. declare const defaultIterableDiffers: IterableDiffers;
  8664. declare const defaultKeyValueDiffers: KeyValueDiffers;
  8665. /**
  8666. * A wrapper around a native element inside of a View.
  8667. *
  8668. * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM
  8669. * element.
  8670. *
  8671. * @security Permitting direct access to the DOM can make your application more vulnerable to
  8672. * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the
  8673. * [Security Guide](https://g.co/ng/security).
  8674. *
  8675. * @publicApi
  8676. */
  8677. declare class ElementRef<T = any> {
  8678. /**
  8679. * <div class="docs-alert docs-alert-important">
  8680. * <header>Use with caution</header>
  8681. * <p>
  8682. * Use this API as the last resort when direct access to DOM is needed. Use templating and
  8683. * data-binding provided by Angular instead. If used, it is recommended in combination with
  8684. * {@link /best-practices/security#direct-use-of-the-dom-apis-and-explicit-sanitization-calls DomSanitizer}
  8685. * for maxiumum security;
  8686. * </p>
  8687. * </div>
  8688. */
  8689. nativeElement: T;
  8690. constructor(nativeElement: T);
  8691. }
  8692. /**
  8693. * A simple registry that maps `Components` to generated `ComponentFactory` classes
  8694. * that can be used to create instances of components.
  8695. * Use to obtain the factory for a given component type,
  8696. * then use the factory's `create()` method to create a component of that type.
  8697. *
  8698. * Note: since v13, dynamic component creation via
  8699. * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)
  8700. * does **not** require resolving component factory: component class can be used directly.
  8701. *
  8702. * @publicApi
  8703. *
  8704. * @deprecated Angular no longer requires Component factories. Please use other APIs where
  8705. * Component class can be used directly.
  8706. */
  8707. declare abstract class ComponentFactoryResolver$1 {
  8708. static NULL: ComponentFactoryResolver$1;
  8709. /**
  8710. * Retrieves the factory object that creates a component of the given type.
  8711. * @param component The component type.
  8712. */
  8713. abstract resolveComponentFactory<T>(component: Type$1<T>): ComponentFactory$1<T>;
  8714. }
  8715. /**
  8716. * Represents an instance of an `NgModule` created by an `NgModuleFactory`.
  8717. * Provides access to the `NgModule` instance and related objects.
  8718. *
  8719. * @publicApi
  8720. */
  8721. declare abstract class NgModuleRef$1<T> {
  8722. /**
  8723. * The injector that contains all of the providers of the `NgModule`.
  8724. */
  8725. abstract get injector(): EnvironmentInjector;
  8726. /**
  8727. * The resolver that can retrieve component factories in a context of this module.
  8728. *
  8729. * Note: since v13, dynamic component creation via
  8730. * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)
  8731. * does **not** require resolving component factory: component class can be used directly.
  8732. *
  8733. * @deprecated Angular no longer requires Component factories. Please use other APIs where
  8734. * Component class can be used directly.
  8735. */
  8736. abstract get componentFactoryResolver(): ComponentFactoryResolver$1;
  8737. /**
  8738. * The `NgModule` instance.
  8739. */
  8740. abstract get instance(): T;
  8741. /**
  8742. * Destroys the module instance and all of the data structures associated with it.
  8743. */
  8744. abstract destroy(): void;
  8745. /**
  8746. * Registers a callback to be executed when the module is destroyed.
  8747. */
  8748. abstract onDestroy(callback: () => void): void;
  8749. }
  8750. interface InternalNgModuleRef<T> extends NgModuleRef$1<T> {
  8751. _bootstrapComponents: Type$1<any>[];
  8752. resolveInjectorInitializers(): void;
  8753. }
  8754. /**
  8755. * @publicApi
  8756. *
  8757. * @deprecated
  8758. * This class was mostly used as a part of ViewEngine-based JIT API and is no longer needed in Ivy
  8759. * JIT mode. Angular provides APIs that accept NgModule classes directly (such as
  8760. * [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and
  8761. * [createNgModule](api/core/createNgModule)), consider switching to those APIs instead of
  8762. * using factory-based ones.
  8763. */
  8764. declare abstract class NgModuleFactory$1<T> {
  8765. abstract get moduleType(): Type$1<T>;
  8766. abstract create(parentInjector: Injector | null): NgModuleRef$1<T>;
  8767. }
  8768. /**
  8769. * Represents an Angular view.
  8770. *
  8771. * @see {@link /api/core/ChangeDetectorRef?tab=usage-notes Change detection usage}
  8772. *
  8773. * @publicApi
  8774. */
  8775. declare abstract class ViewRef$1 extends ChangeDetectorRef {
  8776. /**
  8777. * Destroys this view and all of the data structures associated with it.
  8778. */
  8779. abstract destroy(): void;
  8780. /**
  8781. * Reports whether this view has been destroyed.
  8782. * @returns True after the `destroy()` method has been called, false otherwise.
  8783. */
  8784. abstract get destroyed(): boolean;
  8785. /**
  8786. * A lifecycle hook that provides additional developer-defined cleanup
  8787. * functionality for views.
  8788. * @param callback A handler function that cleans up developer-defined data
  8789. * associated with a view. Called when the `destroy()` method is invoked.
  8790. */
  8791. abstract onDestroy(callback: Function): void;
  8792. }
  8793. /**
  8794. * Represents an Angular view in a view container.
  8795. * An embedded view can be referenced from a component
  8796. * other than the hosting component whose template defines it, or it can be defined
  8797. * independently by a `TemplateRef`.
  8798. *
  8799. * Properties of elements in a view can change, but the structure (number and order) of elements in
  8800. * a view cannot. Change the structure of elements by inserting, moving, or
  8801. * removing nested views in a view container.
  8802. *
  8803. * @see {@link ViewContainerRef}
  8804. *
  8805. * @usageNotes
  8806. *
  8807. * The following template breaks down into two separate `TemplateRef` instances,
  8808. * an outer one and an inner one.
  8809. *
  8810. * ```html
  8811. * Count: {{items.length}}
  8812. * <ul>
  8813. * <li *ngFor="let item of items">{{item}}</li>
  8814. * </ul>
  8815. * ```
  8816. *
  8817. * This is the outer `TemplateRef`:
  8818. *
  8819. * ```html
  8820. * Count: {{items.length}}
  8821. * <ul>
  8822. * <ng-template ngFor let-item [ngForOf]="items"></ng-template>
  8823. * </ul>
  8824. * ```
  8825. *
  8826. * This is the inner `TemplateRef`:
  8827. *
  8828. * ```html
  8829. * <li>{{item}}</li>
  8830. * ```
  8831. *
  8832. * The outer and inner `TemplateRef` instances are assembled into views as follows:
  8833. *
  8834. * ```html
  8835. * <!-- ViewRef: outer-0 -->
  8836. * Count: 2
  8837. * <ul>
  8838. * <ng-template view-container-ref></ng-template>
  8839. * <!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 -->
  8840. * <!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 -->
  8841. * </ul>
  8842. * <!-- /ViewRef: outer-0 -->
  8843. * ```
  8844. * @publicApi
  8845. */
  8846. declare abstract class EmbeddedViewRef<C> extends ViewRef$1 {
  8847. /**
  8848. * The context for this view, inherited from the anchor element.
  8849. */
  8850. abstract context: C;
  8851. /**
  8852. * The root nodes for this embedded view.
  8853. */
  8854. abstract get rootNodes(): any[];
  8855. }
  8856. /**
  8857. * Represents a component created by a `ComponentFactory`.
  8858. * Provides access to the component instance and related objects,
  8859. * and provides the means of destroying the instance.
  8860. *
  8861. * @publicApi
  8862. */
  8863. declare abstract class ComponentRef$1<C> {
  8864. /**
  8865. * Updates a specified input name to a new value. Using this method will properly mark for check
  8866. * component using the `OnPush` change detection strategy. It will also assure that the
  8867. * `OnChanges` lifecycle hook runs when a dynamically created component is change-detected.
  8868. *
  8869. * @param name The name of an input.
  8870. * @param value The new value of an input.
  8871. */
  8872. abstract setInput(name: string, value: unknown): void;
  8873. /**
  8874. * The host or anchor element for this component instance.
  8875. */
  8876. abstract get location(): ElementRef;
  8877. /**
  8878. * The dependency injector for this component instance.
  8879. */
  8880. abstract get injector(): Injector;
  8881. /**
  8882. * This component instance.
  8883. */
  8884. abstract get instance(): C;
  8885. /**
  8886. * The host view defined by the template
  8887. * for this component instance.
  8888. */
  8889. abstract get hostView(): ViewRef$1;
  8890. /**
  8891. * The change detector for this component instance.
  8892. */
  8893. abstract get changeDetectorRef(): ChangeDetectorRef;
  8894. /**
  8895. * The type of this component (as created by a `ComponentFactory` class).
  8896. */
  8897. abstract get componentType(): Type$1<any>;
  8898. /**
  8899. * Destroys the component instance and all of the data structures associated with it.
  8900. */
  8901. abstract destroy(): void;
  8902. /**
  8903. * A lifecycle hook that provides additional developer-defined cleanup
  8904. * functionality for the component.
  8905. * @param callback A handler function that cleans up developer-defined data
  8906. * associated with this component. Called when the `destroy()` method is invoked.
  8907. */
  8908. abstract onDestroy(callback: Function): void;
  8909. }
  8910. /**
  8911. * Base class for a factory that can create a component dynamically.
  8912. * Instantiate a factory for a given type of component with `resolveComponentFactory()`.
  8913. * Use the resulting `ComponentFactory.create()` method to create a component of that type.
  8914. *
  8915. * @publicApi
  8916. *
  8917. * @deprecated Angular no longer requires Component factories. Please use other APIs where
  8918. * Component class can be used directly.
  8919. */
  8920. declare abstract class ComponentFactory$1<C> {
  8921. /**
  8922. * The component's HTML selector.
  8923. */
  8924. abstract get selector(): string;
  8925. /**
  8926. * The type of component the factory will create.
  8927. */
  8928. abstract get componentType(): Type$1<any>;
  8929. /**
  8930. * Selector for all <ng-content> elements in the component.
  8931. */
  8932. abstract get ngContentSelectors(): string[];
  8933. /**
  8934. * The inputs of the component.
  8935. */
  8936. abstract get inputs(): {
  8937. propName: string;
  8938. templateName: string;
  8939. transform?: (value: any) => any;
  8940. isSignal: boolean;
  8941. }[];
  8942. /**
  8943. * The outputs of the component.
  8944. */
  8945. abstract get outputs(): {
  8946. propName: string;
  8947. templateName: string;
  8948. }[];
  8949. /**
  8950. * Creates a new component.
  8951. */
  8952. abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any, environmentInjector?: EnvironmentInjector | NgModuleRef$1<any>): ComponentRef$1<C>;
  8953. }
  8954. /**
  8955. * Use in components with the `@Output` directive to emit custom events
  8956. * synchronously or asynchronously, and register handlers for those events
  8957. * by subscribing to an instance.
  8958. *
  8959. * @usageNotes
  8960. *
  8961. * Extends
  8962. * [RxJS `Subject`](https://rxjs.dev/api/index/class/Subject)
  8963. * for Angular by adding the `emit()` method.
  8964. *
  8965. * In the following example, a component defines two output properties
  8966. * that create event emitters. When the title is clicked, the emitter
  8967. * emits an open or close event to toggle the current visibility state.
  8968. *
  8969. * ```angular-ts
  8970. * @Component({
  8971. * selector: 'zippy',
  8972. * template: `
  8973. * <div class="zippy">
  8974. * <div (click)="toggle()">Toggle</div>
  8975. * <div [hidden]="!visible">
  8976. * <ng-content></ng-content>
  8977. * </div>
  8978. * </div>`})
  8979. * export class Zippy {
  8980. * visible: boolean = true;
  8981. * @Output() open: EventEmitter<any> = new EventEmitter();
  8982. * @Output() close: EventEmitter<any> = new EventEmitter();
  8983. *
  8984. * toggle() {
  8985. * this.visible = !this.visible;
  8986. * if (this.visible) {
  8987. * this.open.emit(null);
  8988. * } else {
  8989. * this.close.emit(null);
  8990. * }
  8991. * }
  8992. * }
  8993. * ```
  8994. *
  8995. * Access the event object with the `$event` argument passed to the output event
  8996. * handler:
  8997. *
  8998. * ```html
  8999. * <zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>
  9000. * ```
  9001. *
  9002. * @publicApi
  9003. */
  9004. interface EventEmitter<T> extends Subject<T>, OutputRef<T> {
  9005. /**
  9006. * Creates an instance of this class that can
  9007. * deliver events synchronously or asynchronously.
  9008. *
  9009. * @param [isAsync=false] When true, deliver events asynchronously.
  9010. *
  9011. */
  9012. new (isAsync?: boolean): EventEmitter<T>;
  9013. /**
  9014. * Emits an event containing a given value.
  9015. * @param value The value to emit.
  9016. */
  9017. emit(value?: T): void;
  9018. /**
  9019. * Registers handlers for events emitted by this instance.
  9020. * @param next When supplied, a custom handler for emitted events.
  9021. * @param error When supplied, a custom handler for an error notification from this emitter.
  9022. * @param complete When supplied, a custom handler for a completion notification from this
  9023. * emitter.
  9024. */
  9025. subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Subscription;
  9026. /**
  9027. * Registers handlers for events emitted by this instance.
  9028. * @param observerOrNext When supplied, a custom handler for emitted events, or an observer
  9029. * object.
  9030. * @param error When supplied, a custom handler for an error notification from this emitter.
  9031. * @param complete When supplied, a custom handler for a completion notification from this
  9032. * emitter.
  9033. */
  9034. subscribe(observerOrNext?: any, error?: any, complete?: any): Subscription;
  9035. }
  9036. /**
  9037. * @publicApi
  9038. */
  9039. declare const EventEmitter: {
  9040. new (isAsync?: boolean): EventEmitter<any>;
  9041. new <T>(isAsync?: boolean): EventEmitter<T>;
  9042. readonly prototype: EventEmitter<any>;
  9043. };
  9044. /**
  9045. * An injectable service for executing work inside or outside of the Angular zone.
  9046. *
  9047. * The most common use of this service is to optimize performance when starting a work consisting of
  9048. * one or more asynchronous tasks that don't require UI updates or error handling to be handled by
  9049. * Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks
  9050. * can reenter the Angular zone via {@link #run}.
  9051. *
  9052. * <!-- TODO: add/fix links to:
  9053. * - docs explaining zones and the use of zones in Angular and change-detection
  9054. * - link to runOutsideAngular/run (throughout this file!)
  9055. * -->
  9056. *
  9057. * @usageNotes
  9058. * ### Example
  9059. *
  9060. * ```ts
  9061. * import {Component, NgZone} from '@angular/core';
  9062. * import {NgIf} from '@angular/common';
  9063. *
  9064. * @Component({
  9065. * selector: 'ng-zone-demo',
  9066. * template: `
  9067. * <h2>Demo: NgZone</h2>
  9068. *
  9069. * <p>Progress: {{progress}}%</p>
  9070. * <p *ngIf="progress >= 100">Done processing {{label}} of Angular zone!</p>
  9071. *
  9072. * <button (click)="processWithinAngularZone()">Process within Angular zone</button>
  9073. * <button (click)="processOutsideOfAngularZone()">Process outside of Angular zone</button>
  9074. * `,
  9075. * })
  9076. * export class NgZoneDemo {
  9077. * progress: number = 0;
  9078. * label: string;
  9079. *
  9080. * constructor(private _ngZone: NgZone) {}
  9081. *
  9082. * // Loop inside the Angular zone
  9083. * // so the UI DOES refresh after each setTimeout cycle
  9084. * processWithinAngularZone() {
  9085. * this.label = 'inside';
  9086. * this.progress = 0;
  9087. * this._increaseProgress(() => console.log('Inside Done!'));
  9088. * }
  9089. *
  9090. * // Loop outside of the Angular zone
  9091. * // so the UI DOES NOT refresh after each setTimeout cycle
  9092. * processOutsideOfAngularZone() {
  9093. * this.label = 'outside';
  9094. * this.progress = 0;
  9095. * this._ngZone.runOutsideAngular(() => {
  9096. * this._increaseProgress(() => {
  9097. * // reenter the Angular zone and display done
  9098. * this._ngZone.run(() => { console.log('Outside Done!'); });
  9099. * });
  9100. * });
  9101. * }
  9102. *
  9103. * _increaseProgress(doneCallback: () => void) {
  9104. * this.progress += 1;
  9105. * console.log(`Current progress: ${this.progress}%`);
  9106. *
  9107. * if (this.progress < 100) {
  9108. * window.setTimeout(() => this._increaseProgress(doneCallback), 10);
  9109. * } else {
  9110. * doneCallback();
  9111. * }
  9112. * }
  9113. * }
  9114. * ```
  9115. *
  9116. * @publicApi
  9117. */
  9118. declare class NgZone {
  9119. readonly hasPendingMacrotasks: boolean;
  9120. readonly hasPendingMicrotasks: boolean;
  9121. /**
  9122. * Whether there are no outstanding microtasks or macrotasks.
  9123. */
  9124. readonly isStable: boolean;
  9125. /**
  9126. * Notifies when code enters Angular Zone. This gets fired first on VM Turn.
  9127. */
  9128. readonly onUnstable: EventEmitter<any>;
  9129. /**
  9130. * Notifies when there is no more microtasks enqueued in the current VM Turn.
  9131. * This is a hint for Angular to do change detection, which may enqueue more microtasks.
  9132. * For this reason this event can fire multiple times per VM Turn.
  9133. */
  9134. readonly onMicrotaskEmpty: EventEmitter<any>;
  9135. /**
  9136. * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which
  9137. * implies we are about to relinquish VM turn.
  9138. * This event gets called just once.
  9139. */
  9140. readonly onStable: EventEmitter<any>;
  9141. /**
  9142. * Notifies that an error has been delivered.
  9143. */
  9144. readonly onError: EventEmitter<any>;
  9145. constructor(options: {
  9146. enableLongStackTrace?: boolean;
  9147. shouldCoalesceEventChangeDetection?: boolean;
  9148. shouldCoalesceRunChangeDetection?: boolean;
  9149. });
  9150. /**
  9151. This method checks whether the method call happens within an Angular Zone instance.
  9152. */
  9153. static isInAngularZone(): boolean;
  9154. /**
  9155. Assures that the method is called within the Angular Zone, otherwise throws an error.
  9156. */
  9157. static assertInAngularZone(): void;
  9158. /**
  9159. Assures that the method is called outside of the Angular Zone, otherwise throws an error.
  9160. */
  9161. static assertNotInAngularZone(): void;
  9162. /**
  9163. * Executes the `fn` function synchronously within the Angular zone and returns value returned by
  9164. * the function.
  9165. *
  9166. * Running functions via `run` allows you to reenter Angular zone from a task that was executed
  9167. * outside of the Angular zone (typically started via {@link #runOutsideAngular}).
  9168. *
  9169. * Any future tasks or microtasks scheduled from within this function will continue executing from
  9170. * within the Angular zone.
  9171. *
  9172. * If a synchronous error happens it will be rethrown and not reported via `onError`.
  9173. */
  9174. run<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T;
  9175. /**
  9176. * Executes the `fn` function synchronously within the Angular zone as a task and returns value
  9177. * returned by the function.
  9178. *
  9179. * Running functions via `runTask` allows you to reenter Angular zone from a task that was executed
  9180. * outside of the Angular zone (typically started via {@link #runOutsideAngular}).
  9181. *
  9182. * Any future tasks or microtasks scheduled from within this function will continue executing from
  9183. * within the Angular zone.
  9184. *
  9185. * If a synchronous error happens it will be rethrown and not reported via `onError`.
  9186. */
  9187. runTask<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[], name?: string): T;
  9188. /**
  9189. * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not
  9190. * rethrown.
  9191. */
  9192. runGuarded<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T;
  9193. /**
  9194. * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by
  9195. * the function.
  9196. *
  9197. * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do
  9198. * work that
  9199. * doesn't trigger Angular change-detection or is subject to Angular's error handling.
  9200. *
  9201. * Any future tasks or microtasks scheduled from within this function will continue executing from
  9202. * outside of the Angular zone.
  9203. *
  9204. * Use {@link #run} to reenter the Angular zone and do work that updates the application model.
  9205. */
  9206. runOutsideAngular<T>(fn: (...args: any[]) => T): T;
  9207. }
  9208. /**
  9209. * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls
  9210. * to framework to perform rendering.
  9211. */
  9212. declare class NoopNgZone implements NgZone {
  9213. readonly hasPendingMicrotasks = false;
  9214. readonly hasPendingMacrotasks = false;
  9215. readonly isStable = true;
  9216. readonly onUnstable: EventEmitter<any>;
  9217. readonly onMicrotaskEmpty: EventEmitter<any>;
  9218. readonly onStable: EventEmitter<any>;
  9219. readonly onError: EventEmitter<any>;
  9220. run<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any): T;
  9221. runGuarded<T>(fn: (...args: any[]) => any, applyThis?: any, applyArgs?: any): T;
  9222. runOutsideAngular<T>(fn: (...args: any[]) => T): T;
  9223. runTask<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any, name?: string): T;
  9224. }
  9225. interface NgModuleType<T = any> extends Type$1<T> {
  9226. ɵmod: NgModuleDef<T>;
  9227. }
  9228. /**
  9229. * Represents the expansion of an `NgModule` into its scopes.
  9230. *
  9231. * A scope is a set of directives and pipes that are visible in a particular context. Each
  9232. * `NgModule` has two scopes. The `compilation` scope is the set of directives and pipes that will
  9233. * be recognized in the templates of components declared by the module. The `exported` scope is the
  9234. * set of directives and pipes exported by a module (that is, module B's exported scope gets added
  9235. * to module A's compilation scope when module A imports B).
  9236. */
  9237. interface NgModuleTransitiveScopes {
  9238. compilation: {
  9239. directives: Set<any>;
  9240. pipes: Set<any>;
  9241. };
  9242. exported: {
  9243. directives: Set<any>;
  9244. pipes: Set<any>;
  9245. };
  9246. schemas: SchemaMetadata[] | null;
  9247. }
  9248. /**
  9249. * Runtime link information for NgModules.
  9250. *
  9251. * This is the internal data structure used by the runtime to assemble components, directives,
  9252. * pipes, and injectors.
  9253. *
  9254. * NOTE: Always use `ɵɵdefineNgModule` function to create this object,
  9255. * never create the object directly since the shape of this object
  9256. * can change between versions.
  9257. */
  9258. interface NgModuleDef<T> {
  9259. /** Token representing the module. Used by DI. */
  9260. type: T;
  9261. /**
  9262. * List of components to bootstrap.
  9263. *
  9264. * @see {NgModuleScopeInfoFromDecorator} This field is only used in global compilation mode. In local compilation mode the bootstrap info is computed and added in runtime.
  9265. */
  9266. bootstrap: Type$1<any>[] | (() => Type$1<any>[]);
  9267. /** List of components, directives, and pipes declared by this module. */
  9268. declarations: Type$1<any>[] | (() => Type$1<any>[]);
  9269. /** List of modules or `ModuleWithProviders` imported by this module. */
  9270. imports: Type$1<any>[] | (() => Type$1<any>[]);
  9271. /**
  9272. * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this
  9273. * module.
  9274. */
  9275. exports: Type$1<any>[] | (() => Type$1<any>[]);
  9276. /**
  9277. * Cached value of computed `transitiveCompileScopes` for this module.
  9278. *
  9279. * This should never be read directly, but accessed via `transitiveScopesFor`.
  9280. */
  9281. transitiveCompileScopes: NgModuleTransitiveScopes | null;
  9282. /** The set of schemas that declare elements to be allowed in the NgModule. */
  9283. schemas: SchemaMetadata[] | null;
  9284. /** Unique ID for the module with which it should be registered. */
  9285. id: string | null;
  9286. }
  9287. /**
  9288. * Map of inputs for a given directive/component.
  9289. *
  9290. * Given:
  9291. * ```ts
  9292. * class MyComponent {
  9293. * @Input()
  9294. * publicInput1: string;
  9295. *
  9296. * @Input('publicInput2')
  9297. * declaredInput2: string;
  9298. *
  9299. * @Input({transform: (value: boolean) => value ? 1 : 0})
  9300. * transformedInput3: number;
  9301. *
  9302. * signalInput = input(3);
  9303. * }
  9304. * ```
  9305. *
  9306. * is described as:
  9307. * ```ts
  9308. * {
  9309. * publicInput1: 'publicInput1',
  9310. * declaredInput2: [InputFlags.None, 'declaredInput2', 'publicInput2'],
  9311. * transformedInput3: [
  9312. * InputFlags.None,
  9313. * 'transformedInput3',
  9314. * 'transformedInput3',
  9315. * (value: boolean) => value ? 1 : 0
  9316. * ],
  9317. * signalInput: [InputFlags.SignalBased, "signalInput"],
  9318. * }
  9319. * ```
  9320. *
  9321. * Which the minifier may translate to:
  9322. * ```ts
  9323. * {
  9324. * minifiedPublicInput1: 'publicInput1',
  9325. * minifiedDeclaredInput2: [InputFlags.None, 'publicInput2', 'declaredInput2'],
  9326. * minifiedTransformedInput3: [
  9327. * InputFlags.None,
  9328. * 'transformedInput3',
  9329. * 'transformedInput3',
  9330. * (value: boolean) => value ? 1 : 0
  9331. * ],
  9332. * minifiedSignalInput: [InputFlags.SignalBased, "signalInput"],
  9333. * }
  9334. * ```
  9335. *
  9336. * This allows the render to re-construct the minified, public, and declared names
  9337. * of properties.
  9338. *
  9339. * NOTE:
  9340. * - Because declared and public name are usually same we only generate the array
  9341. * `['declared', 'public']` format when they differ, or there is a transform.
  9342. * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has
  9343. * inconsistent behavior in that it uses declared names rather than minified or public.
  9344. */
  9345. type DirectiveInputs<T> = {
  9346. [P in keyof T]?: string | [
  9347. flags: InputFlags,
  9348. publicName: string,
  9349. declaredName?: string,
  9350. transform?: InputTransformFunction
  9351. ];
  9352. };
  9353. interface DirectiveDefinition<T> {
  9354. /**
  9355. * Directive type, needed to configure the injector.
  9356. */
  9357. type: Type$1<T>;
  9358. /** The selectors that will be used to match nodes to this directive. */
  9359. selectors?: CssSelectorList;
  9360. /**
  9361. * A map of input names.
  9362. */
  9363. inputs?: DirectiveInputs<T>;
  9364. /**
  9365. * A map of output names.
  9366. *
  9367. * The format is in: `{[actualPropertyName: string]:string}`.
  9368. *
  9369. * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.
  9370. *
  9371. * This allows the render to re-construct the minified and non-minified names
  9372. * of properties.
  9373. */
  9374. outputs?: {
  9375. [P in keyof T]?: string;
  9376. };
  9377. /**
  9378. * A list of optional features to apply.
  9379. *
  9380. * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}, {@link InheritDefinitionFeature}
  9381. */
  9382. features?: DirectiveDefFeature[];
  9383. /**
  9384. * Function executed by the parent template to allow child directive to apply host bindings.
  9385. */
  9386. hostBindings?: HostBindingsFunction<T>;
  9387. /**
  9388. * The number of bindings in this directive `hostBindings` (including pure fn bindings).
  9389. *
  9390. * Used to calculate the length of the component's LView array, so we
  9391. * can pre-fill the array and set the host binding start index.
  9392. */
  9393. hostVars?: number;
  9394. /**
  9395. * Assign static attribute values to a host element.
  9396. *
  9397. * This property will assign static attribute values as well as class and style
  9398. * values to a host element. Since attribute values can consist of different types of values,
  9399. * the `hostAttrs` array must include the values in the following format:
  9400. *
  9401. * attrs = [
  9402. * // static attributes (like `title`, `name`, `id`...)
  9403. * attr1, value1, attr2, value,
  9404. *
  9405. * // a single namespace value (like `x:id`)
  9406. * NAMESPACE_MARKER, namespaceUri1, name1, value1,
  9407. *
  9408. * // another single namespace value (like `x:name`)
  9409. * NAMESPACE_MARKER, namespaceUri2, name2, value2,
  9410. *
  9411. * // a series of CSS classes that will be applied to the element (no spaces)
  9412. * CLASSES_MARKER, class1, class2, class3,
  9413. *
  9414. * // a series of CSS styles (property + value) that will be applied to the element
  9415. * STYLES_MARKER, prop1, value1, prop2, value2
  9416. * ]
  9417. *
  9418. * All non-class and non-style attributes must be defined at the start of the list
  9419. * first before all class and style values are set. When there is a change in value
  9420. * type (like when classes and styles are introduced) a marker must be used to separate
  9421. * the entries. The marker values themselves are set via entries found in the
  9422. * [AttributeMarker] enum.
  9423. */
  9424. hostAttrs?: TAttributes;
  9425. /**
  9426. * Function to create instances of content queries associated with a given directive.
  9427. */
  9428. contentQueries?: ContentQueriesFunction<T>;
  9429. /**
  9430. * Additional set of instructions specific to view query processing. This could be seen as a
  9431. * set of instructions to be inserted into the template function.
  9432. */
  9433. viewQuery?: ViewQueriesFunction<T> | null;
  9434. /**
  9435. * Defines the name that can be used in the template to assign this directive to a variable.
  9436. *
  9437. * See: {@link Directive.exportAs}
  9438. */
  9439. exportAs?: string[];
  9440. /**
  9441. * Whether this directive/component is standalone.
  9442. */
  9443. standalone?: boolean;
  9444. /**
  9445. * Whether this directive/component is signal-based.
  9446. */
  9447. signals?: boolean;
  9448. }
  9449. interface ComponentDefinition<T> extends Omit<DirectiveDefinition<T>, 'features'> {
  9450. /**
  9451. * The number of nodes, local refs, and pipes in this component template.
  9452. *
  9453. * Used to calculate the length of this component's LView array, so we
  9454. * can pre-fill the array and set the binding start index.
  9455. */
  9456. decls: number;
  9457. /**
  9458. * The number of bindings in this component template (including pure fn bindings).
  9459. *
  9460. * Used to calculate the length of this component's LView array, so we
  9461. * can pre-fill the array and set the host binding start index.
  9462. */
  9463. vars: number;
  9464. /**
  9465. * Template function use for rendering DOM.
  9466. *
  9467. * This function has following structure.
  9468. *
  9469. * ```ts
  9470. * function Template<T>(ctx:T, creationMode: boolean) {
  9471. * if (creationMode) {
  9472. * // Contains creation mode instructions.
  9473. * }
  9474. * // Contains binding update instructions
  9475. * }
  9476. * ```
  9477. *
  9478. * Common instructions are:
  9479. * Creation mode instructions:
  9480. * - `elementStart`, `elementEnd`
  9481. * - `text`
  9482. * - `container`
  9483. * - `listener`
  9484. *
  9485. * Binding update instructions:
  9486. * - `bind`
  9487. * - `elementAttribute`
  9488. * - `elementProperty`
  9489. * - `elementClass`
  9490. * - `elementStyle`
  9491. *
  9492. */
  9493. template: ComponentTemplate<T>;
  9494. /**
  9495. * Constants for the nodes in the component's view.
  9496. * Includes attribute arrays, local definition arrays etc.
  9497. */
  9498. consts?: TConstantsOrFactory;
  9499. /**
  9500. * An array of `ngContent[selector]` values that were found in the template.
  9501. */
  9502. ngContentSelectors?: string[];
  9503. /**
  9504. * A list of optional features to apply.
  9505. *
  9506. * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}
  9507. */
  9508. features?: ComponentDefFeature[];
  9509. /**
  9510. * Defines template and style encapsulation options available for Component's {@link /api/core/Component Component}.
  9511. */
  9512. encapsulation?: ViewEncapsulation$1;
  9513. /**
  9514. * Defines arbitrary developer-defined data to be stored on a renderer instance.
  9515. * This is useful for renderers that delegate to other renderers.
  9516. *
  9517. * see: animation
  9518. */
  9519. data?: {
  9520. [kind: string]: any;
  9521. };
  9522. /**
  9523. * A set of styles that the component needs to be present for component to render correctly.
  9524. */
  9525. styles?: string[];
  9526. /**
  9527. * The strategy that the default change detector uses to detect changes.
  9528. * When set, takes effect the next time change detection is triggered.
  9529. */
  9530. changeDetection?: ChangeDetectionStrategy$1;
  9531. /**
  9532. * Registry of directives, components, and pipes that may be found in this component's view.
  9533. *
  9534. * This property is either an array of types or a function that returns the array of types. This
  9535. * function may be necessary to support forward declarations.
  9536. */
  9537. dependencies?: TypeOrFactory<DependencyTypeList>;
  9538. /**
  9539. * The set of schemas that declare elements to be allowed in the component's template.
  9540. */
  9541. schemas?: SchemaMetadata[] | null;
  9542. }
  9543. /**
  9544. * Create a component definition object.
  9545. *
  9546. *
  9547. * # Example
  9548. * ```ts
  9549. * class MyComponent {
  9550. * // Generated by Angular Template Compiler
  9551. * // [Symbol] syntax will not be supported by TypeScript until v2.7
  9552. * static ɵcmp = defineComponent({
  9553. * ...
  9554. * });
  9555. * }
  9556. * ```
  9557. * @codeGenApi
  9558. */
  9559. declare function ɵɵdefineComponent<T>(componentDefinition: ComponentDefinition<T>): ComponentDef<any>;
  9560. /**
  9561. * @codeGenApi
  9562. */
  9563. declare function ɵɵdefineNgModule<T>(def: {
  9564. /** Token representing the module. Used by DI. */
  9565. type: T;
  9566. /** List of components to bootstrap. */
  9567. bootstrap?: Type$1<any>[] | (() => Type$1<any>[]);
  9568. /** List of components, directives, and pipes declared by this module. */
  9569. declarations?: Type$1<any>[] | (() => Type$1<any>[]);
  9570. /** List of modules or `ModuleWithProviders` imported by this module. */
  9571. imports?: Type$1<any>[] | (() => Type$1<any>[]);
  9572. /**
  9573. * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this
  9574. * module.
  9575. */
  9576. exports?: Type$1<any>[] | (() => Type$1<any>[]);
  9577. /** The set of schemas that declare elements to be allowed in the NgModule. */
  9578. schemas?: SchemaMetadata[] | null;
  9579. /** Unique ID for the module that is used with `getModuleFactory`. */
  9580. id?: string | null;
  9581. }): unknown;
  9582. /**
  9583. * Create a directive definition object.
  9584. *
  9585. * # Example
  9586. * ```ts
  9587. * class MyDirective {
  9588. * // Generated by Angular Template Compiler
  9589. * // [Symbol] syntax will not be supported by TypeScript until v2.7
  9590. * static ɵdir = ɵɵdefineDirective({
  9591. * ...
  9592. * });
  9593. * }
  9594. * ```
  9595. *
  9596. * @codeGenApi
  9597. */
  9598. declare function ɵɵdefineDirective<T>(directiveDefinition: DirectiveDefinition<T>): DirectiveDef<any>;
  9599. /**
  9600. * Create a pipe definition object.
  9601. *
  9602. * # Example
  9603. * ```ts
  9604. * class MyPipe implements PipeTransform {
  9605. * // Generated by Angular Template Compiler
  9606. * static ɵpipe = definePipe({
  9607. * ...
  9608. * });
  9609. * }
  9610. * ```
  9611. * @param pipeDef Pipe definition generated by the compiler
  9612. *
  9613. * @codeGenApi
  9614. */
  9615. declare function ɵɵdefinePipe<T>(pipeDef: {
  9616. /** Name of the pipe. Used for matching pipes in template to pipe defs. */
  9617. name: string;
  9618. /** Pipe class reference. Needed to extract pipe lifecycle hooks. */
  9619. type: Type$1<T>;
  9620. /** Whether the pipe is pure. */
  9621. pure?: boolean;
  9622. /**
  9623. * Whether the pipe is standalone.
  9624. */
  9625. standalone?: boolean;
  9626. }): unknown;
  9627. /**
  9628. * @publicApi
  9629. */
  9630. type ɵɵDirectiveDeclaration<T, Selector extends string, ExportAs extends string[], InputMap extends {
  9631. [key: string]: string | {
  9632. alias: string | null;
  9633. required: boolean;
  9634. isSignal?: boolean;
  9635. };
  9636. }, OutputMap extends {
  9637. [key: string]: string;
  9638. }, QueryFields extends string[], NgContentSelectors extends never = never, IsStandalone extends boolean = false, HostDirectives = never, IsSignal extends boolean = false> = unknown;
  9639. /**
  9640. * @publicApi
  9641. */
  9642. type ɵɵComponentDeclaration<T, Selector extends String, ExportAs extends string[], InputMap extends {
  9643. [key: string]: string | {
  9644. alias: string | null;
  9645. required: boolean;
  9646. };
  9647. }, OutputMap extends {
  9648. [key: string]: string;
  9649. }, QueryFields extends string[], NgContentSelectors extends string[], IsStandalone extends boolean = false, HostDirectives = never, IsSignal extends boolean = false> = unknown;
  9650. /**
  9651. * @publicApi
  9652. */
  9653. type ɵɵNgModuleDeclaration<T, Declarations, Imports, Exports> = unknown;
  9654. /**
  9655. * @publicApi
  9656. */
  9657. type ɵɵPipeDeclaration<T, Name extends string, IsStandalone extends boolean = false> = unknown;
  9658. /**
  9659. * @publicApi
  9660. */
  9661. type ɵɵInjectorDeclaration<T> = unknown;
  9662. /**
  9663. * @publicApi
  9664. */
  9665. type ɵɵFactoryDeclaration<T, CtorDependencies extends CtorDependency[]> = unknown;
  9666. /**
  9667. * An object literal of this type is used to represent the metadata of a constructor dependency.
  9668. * The type itself is never referred to from generated code.
  9669. *
  9670. * @publicApi
  9671. */
  9672. type CtorDependency = {
  9673. /**
  9674. * If an `@Attribute` decorator is used, this represents the injected attribute's name. If the
  9675. * attribute name is a dynamic expression instead of a string literal, this will be the unknown
  9676. * type.
  9677. */
  9678. attribute?: string | unknown;
  9679. /**
  9680. * If `@Optional()` is used, this key is set to true.
  9681. */
  9682. optional?: true;
  9683. /**
  9684. * If `@Host` is used, this key is set to true.
  9685. */
  9686. host?: true;
  9687. /**
  9688. * If `@Self` is used, this key is set to true.
  9689. */
  9690. self?: true;
  9691. /**
  9692. * If `@SkipSelf` is used, this key is set to true.
  9693. */
  9694. skipSelf?: true;
  9695. } | null;
  9696. /**
  9697. * If a given component has unresolved async metadata - returns a reference
  9698. * to a function that applies component metadata after resolving defer-loadable
  9699. * dependencies. Otherwise - this function returns `null`.
  9700. */
  9701. declare function getAsyncClassMetadataFn(type: Type$1<unknown>): (() => Promise<Array<Type$1<unknown>>>) | null;
  9702. /**
  9703. * Handles the process of applying metadata info to a component class in case
  9704. * component template has defer blocks (thus some dependencies became deferrable).
  9705. *
  9706. * @param type Component class where metadata should be added
  9707. * @param dependencyLoaderFn Function that loads dependencies
  9708. * @param metadataSetterFn Function that forms a scope in which the `setClassMetadata` is invoked
  9709. */
  9710. declare function setClassMetadataAsync(type: Type$1<any>, dependencyLoaderFn: () => Array<Promise<Type$1<unknown>>>, metadataSetterFn: (...types: Type$1<unknown>[]) => void): () => Promise<Array<Type$1<unknown>>>;
  9711. /**
  9712. * Adds decorator, constructor, and property metadata to a given type via static metadata fields
  9713. * on the type.
  9714. *
  9715. * These metadata fields can later be read with Angular's `ReflectionCapabilities` API.
  9716. *
  9717. * Calls to `setClassMetadata` can be guarded by ngDevMode, resulting in the metadata assignments
  9718. * being tree-shaken away during production builds.
  9719. */
  9720. declare function setClassMetadata(type: Type$1<any>, decorators: any[] | null, ctorParameters: (() => any[]) | null, propDecorators: {
  9721. [field: string]: any;
  9722. } | null): void;
  9723. interface ChangeDetectorRefInterface extends ChangeDetectorRef {
  9724. }
  9725. declare class ViewRef<T> implements EmbeddedViewRef<T>, ChangeDetectorRefInterface {
  9726. /**
  9727. * This represents the `LView` associated with the point where `ChangeDetectorRef` was
  9728. * requested.
  9729. *
  9730. * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.
  9731. */
  9732. private _cdRefInjectingView?;
  9733. readonly notifyErrorHandler: boolean;
  9734. private _appRef;
  9735. private _attachedToViewContainer;
  9736. get rootNodes(): any[];
  9737. constructor(
  9738. /**
  9739. * This represents `LView` associated with the component when ViewRef is a ChangeDetectorRef.
  9740. *
  9741. * When ViewRef is created for a dynamic component, this also represents the `LView` for the
  9742. * component.
  9743. *
  9744. * For a "regular" ViewRef created for an embedded view, this is the `LView` for the embedded
  9745. * view.
  9746. *
  9747. * @internal
  9748. */
  9749. _lView: LView,
  9750. /**
  9751. * This represents the `LView` associated with the point where `ChangeDetectorRef` was
  9752. * requested.
  9753. *
  9754. * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.
  9755. */
  9756. _cdRefInjectingView?: LView | undefined, notifyErrorHandler?: boolean);
  9757. get context(): T;
  9758. /**
  9759. * @deprecated Replacing the full context object is not supported. Modify the context
  9760. * directly, or consider using a `Proxy` if you need to replace the full object.
  9761. * // TODO(devversion): Remove this.
  9762. */
  9763. set context(value: T);
  9764. get destroyed(): boolean;
  9765. destroy(): void;
  9766. onDestroy(callback: Function): void;
  9767. /**
  9768. * Marks a view and all of its ancestors dirty.
  9769. *
  9770. * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush} component is
  9771. * checked when it needs to be re-rendered but the two normal triggers haven't marked it
  9772. * dirty (i.e. inputs haven't changed and events haven't fired in the view).
  9773. *
  9774. * <!-- TODO: Add a link to a chapter on OnPush components -->
  9775. *
  9776. * @usageNotes
  9777. * ### Example
  9778. *
  9779. * ```ts
  9780. * @Component({
  9781. * selector: 'app-root',
  9782. * template: `Number of ticks: {{numberOfTicks}}`
  9783. * changeDetection: ChangeDetectionStrategy.OnPush,
  9784. * })
  9785. * class AppComponent {
  9786. * numberOfTicks = 0;
  9787. *
  9788. * constructor(private ref: ChangeDetectorRef) {
  9789. * setInterval(() => {
  9790. * this.numberOfTicks++;
  9791. * // the following is required, otherwise the view will not be updated
  9792. * this.ref.markForCheck();
  9793. * }, 1000);
  9794. * }
  9795. * }
  9796. * ```
  9797. */
  9798. markForCheck(): void;
  9799. /**
  9800. * Detaches the view from the change detection tree.
  9801. *
  9802. * Detached views will not be checked during change detection runs until they are
  9803. * re-attached, even if they are dirty. `detach` can be used in combination with
  9804. * {@link ChangeDetectorRef#detectChanges} to implement local change
  9805. * detection checks.
  9806. *
  9807. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  9808. * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
  9809. *
  9810. * @usageNotes
  9811. * ### Example
  9812. *
  9813. * The following example defines a component with a large list of readonly data.
  9814. * Imagine the data changes constantly, many times per second. For performance reasons,
  9815. * we want to check and update the list every five seconds. We can do that by detaching
  9816. * the component's change detector and doing a local check every five seconds.
  9817. *
  9818. * ```ts
  9819. * class DataProvider {
  9820. * // in a real application the returned data will be different every time
  9821. * get data() {
  9822. * return [1,2,3,4,5];
  9823. * }
  9824. * }
  9825. *
  9826. * @Component({
  9827. * selector: 'giant-list',
  9828. * template: `
  9829. * <li *ngFor="let d of dataProvider.data">Data {{d}}</li>
  9830. * `,
  9831. * })
  9832. * class GiantList {
  9833. * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {
  9834. * ref.detach();
  9835. * setInterval(() => {
  9836. * this.ref.detectChanges();
  9837. * }, 5000);
  9838. * }
  9839. * }
  9840. *
  9841. * @Component({
  9842. * selector: 'app',
  9843. * providers: [DataProvider],
  9844. * template: `
  9845. * <giant-list><giant-list>
  9846. * `,
  9847. * })
  9848. * class App {
  9849. * }
  9850. * ```
  9851. */
  9852. detach(): void;
  9853. /**
  9854. * Re-attaches a view to the change detection tree.
  9855. *
  9856. * This can be used to re-attach views that were previously detached from the tree
  9857. * using {@link ChangeDetectorRef#detach}. Views are attached to the tree by default.
  9858. *
  9859. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  9860. *
  9861. * @usageNotes
  9862. * ### Example
  9863. *
  9864. * The following example creates a component displaying `live` data. The component will detach
  9865. * its change detector from the main change detector tree when the component's live property
  9866. * is set to false.
  9867. *
  9868. * ```ts
  9869. * class DataProvider {
  9870. * data = 1;
  9871. *
  9872. * constructor() {
  9873. * setInterval(() => {
  9874. * this.data = this.data * 2;
  9875. * }, 500);
  9876. * }
  9877. * }
  9878. *
  9879. * @Component({
  9880. * selector: 'live-data',
  9881. * inputs: ['live'],
  9882. * template: 'Data: {{dataProvider.data}}'
  9883. * })
  9884. * class LiveData {
  9885. * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}
  9886. *
  9887. * set live(value) {
  9888. * if (value) {
  9889. * this.ref.reattach();
  9890. * } else {
  9891. * this.ref.detach();
  9892. * }
  9893. * }
  9894. * }
  9895. *
  9896. * @Component({
  9897. * selector: 'app-root',
  9898. * providers: [DataProvider],
  9899. * template: `
  9900. * Live Update: <input type="checkbox" [(ngModel)]="live">
  9901. * <live-data [live]="live"><live-data>
  9902. * `,
  9903. * })
  9904. * class AppComponent {
  9905. * live = true;
  9906. * }
  9907. * ```
  9908. */
  9909. reattach(): void;
  9910. /**
  9911. * Checks the view and its children.
  9912. *
  9913. * This can also be used in combination with {@link ChangeDetectorRef#detach} to implement
  9914. * local change detection checks.
  9915. *
  9916. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  9917. * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
  9918. *
  9919. * @usageNotes
  9920. * ### Example
  9921. *
  9922. * The following example defines a component with a large list of readonly data.
  9923. * Imagine, the data changes constantly, many times per second. For performance reasons,
  9924. * we want to check and update the list every five seconds.
  9925. *
  9926. * We can do that by detaching the component's change detector and doing a local change detection
  9927. * check every five seconds.
  9928. *
  9929. * See {@link ChangeDetectorRef#detach} for more information.
  9930. */
  9931. detectChanges(): void;
  9932. /**
  9933. * Checks the change detector and its children, and throws if any changes are detected.
  9934. *
  9935. * This is used in development mode to verify that running change detection doesn't
  9936. * introduce other changes.
  9937. */
  9938. checkNoChanges(): void;
  9939. attachToViewContainerRef(): void;
  9940. detachFromAppRef(): void;
  9941. attachToAppRef(appRef: ApplicationRef): void;
  9942. }
  9943. /**
  9944. * Reports whether the given view is considered dirty according to the different marking mechanisms.
  9945. */
  9946. declare function isViewDirty(view: ViewRef<unknown>): boolean;
  9947. declare function markForRefresh(view: ViewRef<unknown>): void;
  9948. declare class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
  9949. private ngModule?;
  9950. /**
  9951. * @param ngModule The NgModuleRef to which all resolved factories are bound.
  9952. */
  9953. constructor(ngModule?: NgModuleRef$1<any> | undefined);
  9954. resolveComponentFactory<T>(component: Type$1<T>): ComponentFactory$1<T>;
  9955. }
  9956. /**
  9957. * ComponentFactory interface implementation.
  9958. */
  9959. declare class ComponentFactory<T> extends ComponentFactory$1<T> {
  9960. private componentDef;
  9961. private ngModule?;
  9962. selector: string;
  9963. componentType: Type$1<any>;
  9964. ngContentSelectors: string[];
  9965. isBoundToModule: boolean;
  9966. private cachedInputs;
  9967. private cachedOutputs;
  9968. get inputs(): {
  9969. propName: string;
  9970. templateName: string;
  9971. isSignal: boolean;
  9972. transform?: (value: any) => any;
  9973. }[];
  9974. get outputs(): {
  9975. propName: string;
  9976. templateName: string;
  9977. }[];
  9978. /**
  9979. * @param componentDef The component definition.
  9980. * @param ngModule The NgModuleRef to which the factory is bound.
  9981. */
  9982. constructor(componentDef: ComponentDef<any>, ngModule?: NgModuleRef$1<any> | undefined);
  9983. create(injector: Injector, projectableNodes?: any[][] | undefined, rootSelectorOrNode?: any, environmentInjector?: NgModuleRef$1<any> | EnvironmentInjector | undefined): ComponentRef$1<T>;
  9984. }
  9985. /**
  9986. * Represents an instance of a Component created via a {@link ComponentFactory}.
  9987. *
  9988. * `ComponentRef` provides access to the Component Instance as well other objects related to this
  9989. * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
  9990. * method.
  9991. *
  9992. */
  9993. declare class ComponentRef<T> extends ComponentRef$1<T> {
  9994. private _rootLView;
  9995. instance: T;
  9996. hostView: ViewRef<T>;
  9997. changeDetectorRef: ChangeDetectorRef;
  9998. componentType: Type$1<T>;
  9999. location: ElementRef;
  10000. private previousInputValues;
  10001. private _tNode;
  10002. constructor(componentType: Type$1<T>, _rootLView: LView);
  10003. setInput(name: string, value: unknown): void;
  10004. get injector(): Injector;
  10005. destroy(): void;
  10006. onDestroy(callback: () => void): void;
  10007. }
  10008. /**
  10009. * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
  10010. *
  10011. * @param ngModule NgModule class.
  10012. * @param parentInjector Optional injector instance to use as a parent for the module injector. If
  10013. * not provided, `NullInjector` will be used instead.
  10014. * @returns NgModuleRef that represents an NgModule instance.
  10015. *
  10016. * @publicApi
  10017. */
  10018. declare function createNgModule<T>(ngModule: Type$1<T>, parentInjector?: Injector): NgModuleRef$1<T>;
  10019. /**
  10020. * The `createNgModule` function alias for backwards-compatibility.
  10021. * Please avoid using it directly and use `createNgModule` instead.
  10022. *
  10023. * @deprecated Use `createNgModule` instead.
  10024. */
  10025. declare const createNgModuleRef: typeof createNgModule;
  10026. declare class NgModuleRef<T> extends NgModuleRef$1<T> implements InternalNgModuleRef<T> {
  10027. private readonly ngModuleType;
  10028. _parent: Injector | null;
  10029. _bootstrapComponents: Type$1<any>[];
  10030. private readonly _r3Injector;
  10031. instance: T;
  10032. destroyCbs: (() => void)[] | null;
  10033. readonly componentFactoryResolver: ComponentFactoryResolver;
  10034. constructor(ngModuleType: Type$1<T>, _parent: Injector | null, additionalProviders: StaticProvider[], runInjectorInitializers?: boolean);
  10035. resolveInjectorInitializers(): void;
  10036. get injector(): EnvironmentInjector;
  10037. destroy(): void;
  10038. onDestroy(callback: () => void): void;
  10039. }
  10040. declare class NgModuleFactory<T> extends NgModuleFactory$1<T> {
  10041. moduleType: Type$1<T>;
  10042. constructor(moduleType: Type$1<T>);
  10043. create(parentInjector: Injector | null): NgModuleRef$1<T>;
  10044. }
  10045. /**
  10046. * Create a new environment injector.
  10047. *
  10048. * @param providers An array of providers.
  10049. * @param parent A parent environment injector.
  10050. * @param debugName An optional name for this injector instance, which will be used in error
  10051. * messages.
  10052. *
  10053. * @publicApi
  10054. */
  10055. declare function createEnvironmentInjector(providers: Array<Provider | EnvironmentProviders>, parent: EnvironmentInjector, debugName?: string | null): EnvironmentInjector;
  10056. /**
  10057. * Convince closure compiler that the wrapped function has no side-effects.
  10058. *
  10059. * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to
  10060. * allow us to execute a function but have closure compiler mark the call as no-side-effects.
  10061. * It is important that the return value for the `noSideEffects` function be assigned
  10062. * to something which is retained otherwise the call to `noSideEffects` will be removed by closure
  10063. * compiler.
  10064. */
  10065. declare function noSideEffects<T>(fn: () => T): T;
  10066. /**
  10067. * A DI token that provides a set of callbacks to
  10068. * be called for every component that is bootstrapped.
  10069. *
  10070. * Each callback must take a `ComponentRef` instance and return nothing.
  10071. *
  10072. * `(componentRef: ComponentRef) => void`
  10073. *
  10074. * @publicApi
  10075. */
  10076. declare const APP_BOOTSTRAP_LISTENER: InjectionToken<readonly ((compRef: ComponentRef$1<any>) => void)[]>;
  10077. declare function isBoundToModule<C>(cf: ComponentFactory$1<C>): boolean;
  10078. /**
  10079. * A token for third-party components that can register themselves with NgProbe.
  10080. *
  10081. * @deprecated
  10082. * @publicApi
  10083. */
  10084. declare class NgProbeToken {
  10085. name: string;
  10086. token: any;
  10087. constructor(name: string, token: any);
  10088. }
  10089. /**
  10090. * Provides additional options to the bootstrapping process.
  10091. *
  10092. * @publicApi
  10093. */
  10094. interface BootstrapOptions {
  10095. /**
  10096. * Optionally specify which `NgZone` should be used when not configured in the providers.
  10097. *
  10098. * - Provide your own `NgZone` instance.
  10099. * - `zone.js` - Use default `NgZone` which requires `Zone.js`.
  10100. * - `noop` - Use `NoopNgZone` which does nothing.
  10101. */
  10102. ngZone?: NgZone | 'zone.js' | 'noop';
  10103. /**
  10104. * Optionally specify coalescing event change detections or not.
  10105. * Consider the following case.
  10106. *
  10107. * ```html
  10108. * <div (click)="doSomething()">
  10109. * <button (click)="doSomethingElse()"></button>
  10110. * </div>
  10111. * ```
  10112. *
  10113. * When button is clicked, because of the event bubbling, both
  10114. * event handlers will be called and 2 change detections will be
  10115. * triggered. We can coalesce such kind of events to only trigger
  10116. * change detection only once.
  10117. *
  10118. * By default, this option will be false. So the events will not be
  10119. * coalesced and the change detection will be triggered multiple times.
  10120. * And if this option be set to true, the change detection will be
  10121. * triggered async by scheduling a animation frame. So in the case above,
  10122. * the change detection will only be triggered once.
  10123. */
  10124. ngZoneEventCoalescing?: boolean;
  10125. /**
  10126. * Optionally specify if `NgZone#run()` method invocations should be coalesced
  10127. * into a single change detection.
  10128. *
  10129. * Consider the following case.
  10130. * ```ts
  10131. * for (let i = 0; i < 10; i ++) {
  10132. * ngZone.run(() => {
  10133. * // do something
  10134. * });
  10135. * }
  10136. * ```
  10137. *
  10138. * This case triggers the change detection multiple times.
  10139. * With ngZoneRunCoalescing options, all change detections in an event loop trigger only once.
  10140. * In addition, the change detection executes in requestAnimation.
  10141. *
  10142. */
  10143. ngZoneRunCoalescing?: boolean;
  10144. /**
  10145. * When false, change detection is scheduled when Angular receives
  10146. * a clear indication that templates need to be refreshed. This includes:
  10147. *
  10148. * - calling `ChangeDetectorRef.markForCheck`
  10149. * - calling `ComponentRef.setInput`
  10150. * - updating a signal that is read in a template
  10151. * - attaching a view that is marked dirty
  10152. * - removing a view
  10153. * - registering a render hook (templates are only refreshed if render hooks do one of the above)
  10154. *
  10155. * @deprecated This option was introduced out of caution as a way for developers to opt out of the
  10156. * new behavior in v18 which schedule change detection for the above events when they occur
  10157. * outside the Zone. After monitoring the results post-release, we have determined that this
  10158. * feature is working as desired and do not believe it should ever be disabled by setting
  10159. * this option to `true`.
  10160. */
  10161. ignoreChangesOutsideZone?: boolean;
  10162. }
  10163. /**
  10164. * A reference to an Angular application running on a page.
  10165. *
  10166. * @usageNotes
  10167. * ### isStable examples and caveats
  10168. *
  10169. * Note two important points about `isStable`, demonstrated in the examples below:
  10170. * - the application will never be stable if you start any kind
  10171. * of recurrent asynchronous task when the application starts
  10172. * (for example for a polling process, started with a `setInterval`, a `setTimeout`
  10173. * or using RxJS operators like `interval`);
  10174. * - the `isStable` Observable runs outside of the Angular zone.
  10175. *
  10176. * Let's imagine that you start a recurrent task
  10177. * (here incrementing a counter, using RxJS `interval`),
  10178. * and at the same time subscribe to `isStable`.
  10179. *
  10180. * ```ts
  10181. * constructor(appRef: ApplicationRef) {
  10182. * appRef.isStable.pipe(
  10183. * filter(stable => stable)
  10184. * ).subscribe(() => console.log('App is stable now');
  10185. * interval(1000).subscribe(counter => console.log(counter));
  10186. * }
  10187. * ```
  10188. * In this example, `isStable` will never emit `true`,
  10189. * and the trace "App is stable now" will never get logged.
  10190. *
  10191. * If you want to execute something when the app is stable,
  10192. * you have to wait for the application to be stable
  10193. * before starting your polling process.
  10194. *
  10195. * ```ts
  10196. * constructor(appRef: ApplicationRef) {
  10197. * appRef.isStable.pipe(
  10198. * first(stable => stable),
  10199. * tap(stable => console.log('App is stable now')),
  10200. * switchMap(() => interval(1000))
  10201. * ).subscribe(counter => console.log(counter));
  10202. * }
  10203. * ```
  10204. * In this example, the trace "App is stable now" will be logged
  10205. * and then the counter starts incrementing every second.
  10206. *
  10207. * Note also that this Observable runs outside of the Angular zone,
  10208. * which means that the code in the subscription
  10209. * to this Observable will not trigger the change detection.
  10210. *
  10211. * Let's imagine that instead of logging the counter value,
  10212. * you update a field of your component
  10213. * and display it in its template.
  10214. *
  10215. * ```ts
  10216. * constructor(appRef: ApplicationRef) {
  10217. * appRef.isStable.pipe(
  10218. * first(stable => stable),
  10219. * switchMap(() => interval(1000))
  10220. * ).subscribe(counter => this.value = counter);
  10221. * }
  10222. * ```
  10223. * As the `isStable` Observable runs outside the zone,
  10224. * the `value` field will be updated properly,
  10225. * but the template will not be refreshed!
  10226. *
  10227. * You'll have to manually trigger the change detection to update the template.
  10228. *
  10229. * ```ts
  10230. * constructor(appRef: ApplicationRef, cd: ChangeDetectorRef) {
  10231. * appRef.isStable.pipe(
  10232. * first(stable => stable),
  10233. * switchMap(() => interval(1000))
  10234. * ).subscribe(counter => {
  10235. * this.value = counter;
  10236. * cd.detectChanges();
  10237. * });
  10238. * }
  10239. * ```
  10240. *
  10241. * Or make the subscription callback run inside the zone.
  10242. *
  10243. * ```ts
  10244. * constructor(appRef: ApplicationRef, zone: NgZone) {
  10245. * appRef.isStable.pipe(
  10246. * first(stable => stable),
  10247. * switchMap(() => interval(1000))
  10248. * ).subscribe(counter => zone.run(() => this.value = counter));
  10249. * }
  10250. * ```
  10251. *
  10252. * @publicApi
  10253. */
  10254. declare class ApplicationRef {
  10255. private _destroyed;
  10256. private _destroyListeners;
  10257. private readonly internalErrorHandler;
  10258. private readonly afterRenderManager;
  10259. private readonly zonelessEnabled;
  10260. private readonly rootEffectScheduler;
  10261. private externalTestViews;
  10262. /**
  10263. * Indicates whether this instance was destroyed.
  10264. */
  10265. get destroyed(): boolean;
  10266. /**
  10267. * Get a list of component types registered to this application.
  10268. * This list is populated even before the component is created.
  10269. */
  10270. readonly componentTypes: Type$1<any>[];
  10271. /**
  10272. * Get a list of components registered to this application.
  10273. */
  10274. readonly components: ComponentRef$1<any>[];
  10275. /**
  10276. * Returns an Observable that indicates when the application is stable or unstable.
  10277. */
  10278. readonly isStable: Observable<boolean>;
  10279. constructor();
  10280. /**
  10281. * @returns A promise that resolves when the application becomes stable
  10282. */
  10283. whenStable(): Promise<void>;
  10284. private readonly _injector;
  10285. private _rendererFactory;
  10286. /**
  10287. * The `EnvironmentInjector` used to create this application.
  10288. */
  10289. get injector(): EnvironmentInjector;
  10290. /**
  10291. * Bootstrap a component onto the element identified by its selector or, optionally, to a
  10292. * specified element.
  10293. *
  10294. * @usageNotes
  10295. * ### Bootstrap process
  10296. *
  10297. * When bootstrapping a component, Angular mounts it onto a target DOM element
  10298. * and kicks off automatic change detection. The target DOM element can be
  10299. * provided using the `rootSelectorOrNode` argument.
  10300. *
  10301. * If the target DOM element is not provided, Angular tries to find one on a page
  10302. * using the `selector` of the component that is being bootstrapped
  10303. * (first matched element is used).
  10304. *
  10305. * ### Example
  10306. *
  10307. * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,
  10308. * but it requires us to know the component while writing the application code.
  10309. *
  10310. * Imagine a situation where we have to wait for an API call to decide about the component to
  10311. * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to
  10312. * dynamically bootstrap a component.
  10313. *
  10314. * {@example core/ts/platform/platform.ts region='componentSelector'}
  10315. *
  10316. * Optionally, a component can be mounted onto a DOM element that does not match the
  10317. * selector of the bootstrapped component.
  10318. *
  10319. * In the following example, we are providing a CSS selector to match the target element.
  10320. *
  10321. * {@example core/ts/platform/platform.ts region='cssSelector'}
  10322. *
  10323. * While in this example, we are providing reference to a DOM node.
  10324. *
  10325. * {@example core/ts/platform/platform.ts region='domNode'}
  10326. */
  10327. bootstrap<C>(component: Type$1<C>, rootSelectorOrNode?: string | any): ComponentRef$1<C>;
  10328. /**
  10329. * Bootstrap a component onto the element identified by its selector or, optionally, to a
  10330. * specified element.
  10331. *
  10332. * @usageNotes
  10333. * ### Bootstrap process
  10334. *
  10335. * When bootstrapping a component, Angular mounts it onto a target DOM element
  10336. * and kicks off automatic change detection. The target DOM element can be
  10337. * provided using the `rootSelectorOrNode` argument.
  10338. *
  10339. * If the target DOM element is not provided, Angular tries to find one on a page
  10340. * using the `selector` of the component that is being bootstrapped
  10341. * (first matched element is used).
  10342. *
  10343. * ### Example
  10344. *
  10345. * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,
  10346. * but it requires us to know the component while writing the application code.
  10347. *
  10348. * Imagine a situation where we have to wait for an API call to decide about the component to
  10349. * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to
  10350. * dynamically bootstrap a component.
  10351. *
  10352. * {@example core/ts/platform/platform.ts region='componentSelector'}
  10353. *
  10354. * Optionally, a component can be mounted onto a DOM element that does not match the
  10355. * selector of the bootstrapped component.
  10356. *
  10357. * In the following example, we are providing a CSS selector to match the target element.
  10358. *
  10359. * {@example core/ts/platform/platform.ts region='cssSelector'}
  10360. *
  10361. * While in this example, we are providing reference to a DOM node.
  10362. *
  10363. * {@example core/ts/platform/platform.ts region='domNode'}
  10364. *
  10365. * @deprecated Passing Component factories as the `Application.bootstrap` function argument is
  10366. * deprecated. Pass Component Types instead.
  10367. */
  10368. bootstrap<C>(componentFactory: ComponentFactory$1<C>, rootSelectorOrNode?: string | any): ComponentRef$1<C>;
  10369. private bootstrapImpl;
  10370. /**
  10371. * Invoke this method to explicitly process change detection and its side-effects.
  10372. *
  10373. * In development mode, `tick()` also performs a second change detection cycle to ensure that no
  10374. * further changes are detected. If additional changes are picked up during this second cycle,
  10375. * bindings in the app have side-effects that cannot be resolved in a single change detection
  10376. * pass.
  10377. * In this case, Angular throws an error, since an Angular application can only have one change
  10378. * detection pass during which all change detection must complete.
  10379. */
  10380. tick(): void;
  10381. private tickImpl;
  10382. /**
  10383. * Performs the core work of synchronizing the application state with the UI, resolving any
  10384. * pending dirtiness (potentially in a loop).
  10385. */
  10386. private synchronize;
  10387. /**
  10388. * Perform a single synchronization pass.
  10389. */
  10390. private synchronizeOnce;
  10391. /**
  10392. * Checks `allViews` for views which require refresh/traversal, and updates `dirtyFlags`
  10393. * accordingly, with two potential behaviors:
  10394. *
  10395. * 1. If any of our views require updating, then this adds the `ViewTreeTraversal` dirty flag.
  10396. * This _should_ be a no-op, since the scheduler should've added the flag at the same time the
  10397. * view was marked as needing updating.
  10398. *
  10399. * TODO(alxhub): figure out if this behavior is still needed for edge cases.
  10400. *
  10401. * 2. If none of our views require updating, then clear the view-related `dirtyFlag`s. This
  10402. * happens when the scheduler is notified of a view becoming dirty, but the view itself isn't
  10403. * reachable through traversal from our roots (e.g. it's detached from the CD tree).
  10404. */
  10405. private syncDirtyFlagsWithViews;
  10406. /**
  10407. * Attaches a view so that it will be dirty checked.
  10408. * The view will be automatically detached when it is destroyed.
  10409. * This will throw if the view is already attached to a ViewContainer.
  10410. */
  10411. attachView(viewRef: ViewRef$1): void;
  10412. /**
  10413. * Detaches a view from dirty checking again.
  10414. */
  10415. detachView(viewRef: ViewRef$1): void;
  10416. private _loadComponent;
  10417. /**
  10418. * Registers a listener to be called when an instance is destroyed.
  10419. *
  10420. * @param callback A callback function to add as a listener.
  10421. * @returns A function which unregisters a listener.
  10422. */
  10423. onDestroy(callback: () => void): VoidFunction;
  10424. /**
  10425. * Destroys an Angular application represented by this `ApplicationRef`. Calling this function
  10426. * will destroy the associated environment injectors as well as all the bootstrapped components
  10427. * with their views.
  10428. */
  10429. destroy(): void;
  10430. /**
  10431. * Returns the number of attached views.
  10432. */
  10433. get viewCount(): number;
  10434. static ɵfac: ɵɵFactoryDeclaration<ApplicationRef, never>;
  10435. static ɵprov: ɵɵInjectableDeclaration<ApplicationRef>;
  10436. }
  10437. declare function detectChangesInViewIfRequired(lView: LView, notifyErrorHandler: boolean, isFirstPass: boolean, zonelessEnabled: boolean): void;
  10438. /**
  10439. * @description
  10440. * Hook for manual bootstrapping of the application instead of using `bootstrap` array in @NgModule
  10441. * annotation. This hook is invoked only when the `bootstrap` array is empty or not provided.
  10442. *
  10443. * Reference to the current application is provided as a parameter.
  10444. *
  10445. * See ["Bootstrapping"](guide/ngmodules/bootstrapping).
  10446. *
  10447. * @usageNotes
  10448. * The example below uses `ApplicationRef.bootstrap()` to render the
  10449. * `AppComponent` on the page.
  10450. *
  10451. * ```ts
  10452. * class AppModule implements DoBootstrap {
  10453. * ngDoBootstrap(appRef: ApplicationRef) {
  10454. * appRef.bootstrap(AppComponent); // Or some other component
  10455. * }
  10456. * }
  10457. * ```
  10458. *
  10459. * @publicApi
  10460. */
  10461. interface DoBootstrap {
  10462. ngDoBootstrap(appRef: ApplicationRef): void;
  10463. }
  10464. /**
  10465. * Type of the NgModule decorator / constructor function.
  10466. *
  10467. * @publicApi
  10468. */
  10469. interface NgModuleDecorator {
  10470. /**
  10471. * Decorator that marks a class as an NgModule and supplies configuration metadata.
  10472. */
  10473. (obj?: NgModule): TypeDecorator;
  10474. new (obj?: NgModule): NgModule;
  10475. }
  10476. /**
  10477. * Type of the NgModule metadata.
  10478. *
  10479. * @publicApi
  10480. */
  10481. interface NgModule {
  10482. /**
  10483. * The set of injectable objects that are available in the injector
  10484. * of this module.
  10485. *
  10486. * @see [Dependency Injection guide](guide/di/dependency-injection
  10487. * @see [NgModule guide](guide/ngmodules/providers)
  10488. *
  10489. * @usageNotes
  10490. *
  10491. * Dependencies whose providers are listed here become available for injection
  10492. * into any component, directive, pipe or service that is a child of this injector.
  10493. * The NgModule used for bootstrapping uses the root injector, and can provide dependencies
  10494. * to any part of the app.
  10495. *
  10496. * A lazy-loaded module has its own injector, typically a child of the app root injector.
  10497. * Lazy-loaded services are scoped to the lazy-loaded module's injector.
  10498. * If a lazy-loaded module also provides the `UserService`, any component created
  10499. * within that module's context (such as by router navigation) gets the local instance
  10500. * of the service, not the instance in the root injector.
  10501. * Components in external modules continue to receive the instance provided by their injectors.
  10502. *
  10503. * ### Example
  10504. *
  10505. * The following example defines a class that is injected in
  10506. * the HelloWorld NgModule:
  10507. *
  10508. * ```ts
  10509. * class Greeter {
  10510. * greet(name:string) {
  10511. * return 'Hello ' + name + '!';
  10512. * }
  10513. * }
  10514. *
  10515. * @NgModule({
  10516. * providers: [
  10517. * Greeter
  10518. * ]
  10519. * })
  10520. * class HelloWorld {
  10521. * greeter:Greeter;
  10522. *
  10523. * constructor(greeter:Greeter) {
  10524. * this.greeter = greeter;
  10525. * }
  10526. * }
  10527. * ```
  10528. */
  10529. providers?: Array<Provider | EnvironmentProviders>;
  10530. /**
  10531. * The set of components, directives, and pipes (declarables
  10532. * that belong to this module.
  10533. *
  10534. * @usageNotes
  10535. *
  10536. * The set of selectors that are available to a template include those declared here, and
  10537. * those that are exported from imported NgModules.
  10538. *
  10539. * Declarables must belong to exactly one module.
  10540. * The compiler emits an error if you try to declare the same class in more than one module.
  10541. * Be careful not to declare a class that is imported from another module.
  10542. *
  10543. * ### Example
  10544. *
  10545. * The following example allows the CommonModule to use the `NgFor`
  10546. * directive.
  10547. *
  10548. * ```javascript
  10549. * @NgModule({
  10550. * declarations: [NgFor]
  10551. * })
  10552. * class CommonModule {
  10553. * }
  10554. * ```
  10555. */
  10556. declarations?: Array<Type$1<any> | any[]>;
  10557. /**
  10558. * The set of NgModules whose exported declarables
  10559. * are available to templates in this module.
  10560. *
  10561. * @usageNotes
  10562. *
  10563. * A template can use exported declarables from any
  10564. * imported module, including those from modules that are imported indirectly
  10565. * and re-exported.
  10566. * For example, `ModuleA` imports `ModuleB`, and also exports
  10567. * it, which makes the declarables from `ModuleB` available
  10568. * wherever `ModuleA` is imported.
  10569. *
  10570. * ### Example
  10571. *
  10572. * The following example allows MainModule to use anything exported by
  10573. * `CommonModule`:
  10574. *
  10575. * ```javascript
  10576. * @NgModule({
  10577. * imports: [CommonModule]
  10578. * })
  10579. * class MainModule {
  10580. * }
  10581. * ```
  10582. *
  10583. */
  10584. imports?: Array<Type$1<any> | ModuleWithProviders<{}> | any[]>;
  10585. /**
  10586. * The set of components, directives, and pipes declared in this
  10587. * NgModule that can be used in the template of any component that is part of an
  10588. * NgModule that imports this NgModule. Exported declarations are the module's public API.
  10589. *
  10590. * A declarable belongs to one and only one NgModule.
  10591. * A module can list another module among its exports, in which case all of that module's
  10592. * public declaration are exported.
  10593. *
  10594. * @usageNotes
  10595. *
  10596. * Declarations are private by default.
  10597. * If this ModuleA does not export UserComponent, then only the components within this
  10598. * ModuleA can use UserComponent.
  10599. *
  10600. * ModuleA can import ModuleB and also export it, making exports from ModuleB
  10601. * available to an NgModule that imports ModuleA.
  10602. *
  10603. * ### Example
  10604. *
  10605. * The following example exports the `NgFor` directive from CommonModule.
  10606. *
  10607. * ```javascript
  10608. * @NgModule({
  10609. * exports: [NgFor]
  10610. * })
  10611. * class CommonModule {
  10612. * }
  10613. * ```
  10614. */
  10615. exports?: Array<Type$1<any> | any[]>;
  10616. /**
  10617. * The set of components that are bootstrapped when this module is bootstrapped.
  10618. */
  10619. bootstrap?: Array<Type$1<any> | any[]>;
  10620. /**
  10621. * The set of schemas that declare elements to be allowed in the NgModule.
  10622. * Elements and properties that are neither Angular components nor directives
  10623. * must be declared in a schema.
  10624. *
  10625. * Allowed value are `NO_ERRORS_SCHEMA` and `CUSTOM_ELEMENTS_SCHEMA`.
  10626. *
  10627. * @security When using one of `NO_ERRORS_SCHEMA` or `CUSTOM_ELEMENTS_SCHEMA`
  10628. * you must ensure that allowed elements and properties securely escape inputs.
  10629. */
  10630. schemas?: Array<SchemaMetadata | any[]>;
  10631. /**
  10632. * A name or path that uniquely identifies this NgModule in `getNgModuleById`.
  10633. * If left `undefined`, the NgModule is not registered with `getNgModuleById`.
  10634. */
  10635. id?: string;
  10636. /**
  10637. * When present, this module is ignored by the AOT compiler.
  10638. * It remains in distributed code, and the JIT compiler attempts to compile it
  10639. * at run time, in the browser.
  10640. * To ensure the correct behavior, the app must import `@angular/compiler`.
  10641. */
  10642. jit?: true;
  10643. }
  10644. /**
  10645. * @Annotation
  10646. */
  10647. declare const NgModule: NgModuleDecorator;
  10648. /**
  10649. * @description Represents the version of Angular
  10650. *
  10651. * @publicApi
  10652. */
  10653. declare class Version {
  10654. full: string;
  10655. readonly major: string;
  10656. readonly minor: string;
  10657. readonly patch: string;
  10658. constructor(full: string);
  10659. }
  10660. /**
  10661. * @publicApi
  10662. */
  10663. declare const VERSION: Version;
  10664. /**
  10665. * Combination of NgModuleFactory and ComponentFactories.
  10666. *
  10667. * @publicApi
  10668. *
  10669. * @deprecated
  10670. * Ivy JIT mode doesn't require accessing this symbol.
  10671. */
  10672. declare class ModuleWithComponentFactories<T> {
  10673. ngModuleFactory: NgModuleFactory$1<T>;
  10674. componentFactories: ComponentFactory$1<any>[];
  10675. constructor(ngModuleFactory: NgModuleFactory$1<T>, componentFactories: ComponentFactory$1<any>[]);
  10676. }
  10677. /**
  10678. * Low-level service for running the angular compiler during runtime
  10679. * to create {@link ComponentFactory}s, which
  10680. * can later be used to create and render a Component instance.
  10681. *
  10682. * Each `@NgModule` provides an own `Compiler` to its injector,
  10683. * that will use the directives/pipes of the ng module for compilation
  10684. * of components.
  10685. *
  10686. * @publicApi
  10687. *
  10688. * @deprecated
  10689. * Ivy JIT mode doesn't require accessing this symbol.
  10690. */
  10691. declare class Compiler {
  10692. /**
  10693. * Compiles the given NgModule and all of its components. All templates of the components
  10694. * have to be inlined.
  10695. */
  10696. compileModuleSync<T>(moduleType: Type$1<T>): NgModuleFactory$1<T>;
  10697. /**
  10698. * Compiles the given NgModule and all of its components
  10699. */
  10700. compileModuleAsync<T>(moduleType: Type$1<T>): Promise<NgModuleFactory$1<T>>;
  10701. /**
  10702. * Same as {@link Compiler#compileModuleSync compileModuleSync} but also creates ComponentFactories for all components.
  10703. */
  10704. compileModuleAndAllComponentsSync<T>(moduleType: Type$1<T>): ModuleWithComponentFactories<T>;
  10705. /**
  10706. * Same as {@link Compiler#compileModuleAsync compileModuleAsync} but also creates ComponentFactories for all components.
  10707. */
  10708. compileModuleAndAllComponentsAsync<T>(moduleType: Type$1<T>): Promise<ModuleWithComponentFactories<T>>;
  10709. /**
  10710. * Clears all caches.
  10711. */
  10712. clearCache(): void;
  10713. /**
  10714. * Clears the cache for the given component/ngModule.
  10715. */
  10716. clearCacheFor(type: Type$1<any>): void;
  10717. /**
  10718. * Returns the id for a given NgModule, if one is defined and known to the compiler.
  10719. */
  10720. getModuleId(moduleType: Type$1<any>): string | undefined;
  10721. static ɵfac: ɵɵFactoryDeclaration<Compiler, never>;
  10722. static ɵprov: ɵɵInjectableDeclaration<Compiler>;
  10723. }
  10724. /**
  10725. * Options for creating a compiler.
  10726. *
  10727. * @publicApi
  10728. */
  10729. type CompilerOptions = {
  10730. defaultEncapsulation?: ViewEncapsulation$1;
  10731. providers?: StaticProvider[];
  10732. preserveWhitespaces?: boolean;
  10733. };
  10734. /**
  10735. * Token to provide CompilerOptions in the platform injector.
  10736. *
  10737. * @publicApi
  10738. */
  10739. declare const COMPILER_OPTIONS: InjectionToken<CompilerOptions[]>;
  10740. /**
  10741. * A factory for creating a Compiler
  10742. *
  10743. * @publicApi
  10744. *
  10745. * @deprecated
  10746. * Ivy JIT mode doesn't require accessing this symbol.
  10747. */
  10748. declare abstract class CompilerFactory {
  10749. abstract createCompiler(options?: CompilerOptions[]): Compiler;
  10750. }
  10751. /**
  10752. * Returns the NgModuleFactory with the given id (specified using [@NgModule.id
  10753. * field](api/core/NgModule#id)), if it exists and has been loaded. Factories for NgModules that do
  10754. * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found.
  10755. * @publicApi
  10756. * @deprecated Use `getNgModuleById` instead.
  10757. */
  10758. declare function getModuleFactory(id: string): NgModuleFactory$1<any>;
  10759. /**
  10760. * Returns the NgModule class with the given id (specified using [@NgModule.id
  10761. * field](api/core/NgModule#id)), if it exists and has been loaded. Classes for NgModules that do
  10762. * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found.
  10763. * @publicApi
  10764. */
  10765. declare function getNgModuleById<T>(id: string): Type$1<T>;
  10766. /**
  10767. * Represents an embedded template that can be used to instantiate embedded views.
  10768. * To instantiate embedded views based on a template, use the `ViewContainerRef`
  10769. * method `createEmbeddedView()`.
  10770. *
  10771. * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`
  10772. * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view
  10773. * is injected into the constructor of the directive,
  10774. * using the `TemplateRef` token.
  10775. *
  10776. * You can also use a `Query` to find a `TemplateRef` associated with
  10777. * a component or a directive.
  10778. *
  10779. * @see {@link ViewContainerRef}
  10780. *
  10781. * @publicApi
  10782. */
  10783. declare abstract class TemplateRef<C> {
  10784. /**
  10785. * The anchor element in the parent view for this embedded view.
  10786. *
  10787. * The data-binding and [injection contexts](guide/di/dependency-injection-context) of embedded
  10788. * views created from this `TemplateRef` inherit from the contexts of this location.
  10789. *
  10790. * Typically new embedded views are attached to the view container of this location, but in
  10791. * advanced use-cases, the view can be attached to a different container while keeping the
  10792. * data-binding and injection context from the original location.
  10793. *
  10794. */
  10795. abstract readonly elementRef: ElementRef;
  10796. /**
  10797. * Instantiates an unattached embedded view based on this template.
  10798. * @param context The data-binding context of the embedded view, as declared
  10799. * in the `<ng-template>` usage.
  10800. * @param injector Injector to be used within the embedded view.
  10801. * @returns The new embedded view object.
  10802. */
  10803. abstract createEmbeddedView(context: C, injector?: Injector): EmbeddedViewRef<C>;
  10804. }
  10805. /**
  10806. * Represents a container where one or more views can be attached to a component.
  10807. *
  10808. * Can contain *host views* (created by instantiating a
  10809. * component with the `createComponent()` method), and *embedded views*
  10810. * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).
  10811. *
  10812. * A view container instance can contain other view containers,
  10813. * creating a view hierarchy.
  10814. *
  10815. * @usageNotes
  10816. *
  10817. * The example below demonstrates how the `createComponent` function can be used
  10818. * to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,
  10819. * so that it gets included into change detection cycles.
  10820. *
  10821. * Note: the example uses standalone components, but the function can also be used for
  10822. * non-standalone components (declared in an NgModule) as well.
  10823. *
  10824. * ```angular-ts
  10825. * @Component({
  10826. * standalone: true,
  10827. * selector: 'dynamic',
  10828. * template: `<span>This is a content of a dynamic component.</span>`,
  10829. * })
  10830. * class DynamicComponent {
  10831. * vcr = inject(ViewContainerRef);
  10832. * }
  10833. *
  10834. * @Component({
  10835. * standalone: true,
  10836. * selector: 'app',
  10837. * template: `<main>Hi! This is the main content.</main>`,
  10838. * })
  10839. * class AppComponent {
  10840. * vcr = inject(ViewContainerRef);
  10841. *
  10842. * ngAfterViewInit() {
  10843. * const compRef = this.vcr.createComponent(DynamicComponent);
  10844. * compRef.changeDetectorRef.detectChanges();
  10845. * }
  10846. * }
  10847. * ```
  10848. *
  10849. * @see {@link ComponentRef}
  10850. * @see {@link EmbeddedViewRef}
  10851. *
  10852. * @publicApi
  10853. */
  10854. declare abstract class ViewContainerRef {
  10855. /**
  10856. * Anchor element that specifies the location of this container in the containing view.
  10857. * Each view container can have only one anchor element, and each anchor element
  10858. * can have only a single view container.
  10859. *
  10860. * Root elements of views attached to this container become siblings of the anchor element in
  10861. * the rendered view.
  10862. *
  10863. * Access the `ViewContainerRef` of an element by placing a `Directive` injected
  10864. * with `ViewContainerRef` on the element, or use a `ViewChild` query.
  10865. *
  10866. * <!-- TODO: rename to anchorElement -->
  10867. */
  10868. abstract get element(): ElementRef;
  10869. /**
  10870. * The dependency injector for this view container.
  10871. */
  10872. abstract get injector(): Injector;
  10873. /** @deprecated No replacement */
  10874. abstract get parentInjector(): Injector;
  10875. /**
  10876. * Destroys all views in this container.
  10877. */
  10878. abstract clear(): void;
  10879. /**
  10880. * Retrieves a view from this container.
  10881. * @param index The 0-based index of the view to retrieve.
  10882. * @returns The `ViewRef` instance, or null if the index is out of range.
  10883. */
  10884. abstract get(index: number): ViewRef$1 | null;
  10885. /**
  10886. * Reports how many views are currently attached to this container.
  10887. * @returns The number of views.
  10888. */
  10889. abstract get length(): number;
  10890. /**
  10891. * Instantiates an embedded view and inserts it
  10892. * into this container.
  10893. * @param templateRef The HTML template that defines the view.
  10894. * @param context The data-binding context of the embedded view, as declared
  10895. * in the `<ng-template>` usage.
  10896. * @param options Extra configuration for the created view. Includes:
  10897. * * index: The 0-based index at which to insert the new view into this container.
  10898. * If not specified, appends the new view as the last entry.
  10899. * * injector: Injector to be used within the embedded view.
  10900. *
  10901. * @returns The `ViewRef` instance for the newly created view.
  10902. */
  10903. abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, options?: {
  10904. index?: number;
  10905. injector?: Injector;
  10906. }): EmbeddedViewRef<C>;
  10907. /**
  10908. * Instantiates an embedded view and inserts it
  10909. * into this container.
  10910. * @param templateRef The HTML template that defines the view.
  10911. * @param context The data-binding context of the embedded view, as declared
  10912. * in the `<ng-template>` usage.
  10913. * @param index The 0-based index at which to insert the new view into this container.
  10914. * If not specified, appends the new view as the last entry.
  10915. *
  10916. * @returns The `ViewRef` instance for the newly created view.
  10917. */
  10918. abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number): EmbeddedViewRef<C>;
  10919. /**
  10920. * Instantiates a component and inserts its host view into this view container.
  10921. *
  10922. * @param componentType Component Type to use.
  10923. * @param options An object that contains extra parameters:
  10924. * * index: the index at which to insert the new component's host view into this container.
  10925. * If not specified, appends the new view as the last entry.
  10926. * * injector: the injector to use as the parent for the new component.
  10927. * * ngModuleRef: an NgModuleRef of the component's NgModule, you should almost always provide
  10928. * this to ensure that all expected providers are available for the component
  10929. * instantiation.
  10930. * * environmentInjector: an EnvironmentInjector which will provide the component's environment.
  10931. * you should almost always provide this to ensure that all expected providers
  10932. * are available for the component instantiation. This option is intended to
  10933. * replace the `ngModuleRef` parameter.
  10934. * * projectableNodes: list of DOM nodes that should be projected through
  10935. * [`<ng-content>`](api/core/ng-content) of the new component instance.
  10936. *
  10937. * @returns The new `ComponentRef` which contains the component instance and the host view.
  10938. */
  10939. abstract createComponent<C>(componentType: Type$1<C>, options?: {
  10940. index?: number;
  10941. injector?: Injector;
  10942. ngModuleRef?: NgModuleRef$1<unknown>;
  10943. environmentInjector?: EnvironmentInjector | NgModuleRef$1<unknown>;
  10944. projectableNodes?: Node[][];
  10945. }): ComponentRef$1<C>;
  10946. /**
  10947. * Instantiates a single component and inserts its host view into this container.
  10948. *
  10949. * @param componentFactory Component factory to use.
  10950. * @param index The index at which to insert the new component's host view into this container.
  10951. * If not specified, appends the new view as the last entry.
  10952. * @param injector The injector to use as the parent for the new component.
  10953. * @param projectableNodes List of DOM nodes that should be projected through
  10954. * [`<ng-content>`](api/core/ng-content) of the new component instance.
  10955. * @param ngModuleRef An instance of the NgModuleRef that represent an NgModule.
  10956. * This information is used to retrieve corresponding NgModule injector.
  10957. *
  10958. * @returns The new `ComponentRef` which contains the component instance and the host view.
  10959. *
  10960. * @deprecated Angular no longer requires component factories to dynamically create components.
  10961. * Use different signature of the `createComponent` method, which allows passing
  10962. * Component class directly.
  10963. */
  10964. abstract createComponent<C>(componentFactory: ComponentFactory$1<C>, index?: number, injector?: Injector, projectableNodes?: any[][], environmentInjector?: EnvironmentInjector | NgModuleRef$1<any>): ComponentRef$1<C>;
  10965. /**
  10966. * Inserts a view into this container.
  10967. * @param viewRef The view to insert.
  10968. * @param index The 0-based index at which to insert the view.
  10969. * If not specified, appends the new view as the last entry.
  10970. * @returns The inserted `ViewRef` instance.
  10971. *
  10972. */
  10973. abstract insert(viewRef: ViewRef$1, index?: number): ViewRef$1;
  10974. /**
  10975. * Moves a view to a new location in this container.
  10976. * @param viewRef The view to move.
  10977. * @param index The 0-based index of the new location.
  10978. * @returns The moved `ViewRef` instance.
  10979. */
  10980. abstract move(viewRef: ViewRef$1, currentIndex: number): ViewRef$1;
  10981. /**
  10982. * Returns the index of a view within the current container.
  10983. * @param viewRef The view to query.
  10984. * @returns The 0-based index of the view's position in this container,
  10985. * or `-1` if this container doesn't contain the view.
  10986. */
  10987. abstract indexOf(viewRef: ViewRef$1): number;
  10988. /**
  10989. * Destroys a view attached to this container
  10990. * @param index The 0-based index of the view to destroy.
  10991. * If not specified, the last view in the container is removed.
  10992. */
  10993. abstract remove(index?: number): void;
  10994. /**
  10995. * Detaches a view from this container without destroying it.
  10996. * Use along with `insert()` to move a view within the current container.
  10997. * @param index The 0-based index of the view to detach.
  10998. * If not specified, the last view in the container is detached.
  10999. */
  11000. abstract detach(index?: number): ViewRef$1 | null;
  11001. }
  11002. /**
  11003. * The Angular platform is the entry point for Angular on a web page.
  11004. * Each page has exactly one platform. Services (such as reflection) which are common
  11005. * to every Angular application running on the page are bound in its scope.
  11006. * A page's platform is initialized implicitly when a platform is created using a platform
  11007. * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.
  11008. *
  11009. * @publicApi
  11010. */
  11011. declare class PlatformRef {
  11012. private _injector;
  11013. private _modules;
  11014. private _destroyListeners;
  11015. private _destroyed;
  11016. /**
  11017. * Creates an instance of an `@NgModule` for the given platform.
  11018. *
  11019. * @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function
  11020. * argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.
  11021. */
  11022. bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory$1<M>, options?: BootstrapOptions): Promise<NgModuleRef$1<M>>;
  11023. /**
  11024. * Creates an instance of an `@NgModule` for a given platform.
  11025. *
  11026. * @usageNotes
  11027. * ### Simple Example
  11028. *
  11029. * ```ts
  11030. * @NgModule({
  11031. * imports: [BrowserModule]
  11032. * })
  11033. * class MyModule {}
  11034. *
  11035. * let moduleRef = platformBrowser().bootstrapModule(MyModule);
  11036. * ```
  11037. *
  11038. */
  11039. bootstrapModule<M>(moduleType: Type$1<M>, compilerOptions?: (CompilerOptions & BootstrapOptions) | Array<CompilerOptions & BootstrapOptions>): Promise<NgModuleRef$1<M>>;
  11040. /**
  11041. * Registers a listener to be called when the platform is destroyed.
  11042. */
  11043. onDestroy(callback: () => void): void;
  11044. /**
  11045. * Retrieves the platform {@link Injector}, which is the parent injector for
  11046. * every Angular application on the page and provides singleton providers.
  11047. */
  11048. get injector(): Injector;
  11049. /**
  11050. * Destroys the current Angular platform and all Angular applications on the page.
  11051. * Destroys all modules and listeners registered with the platform.
  11052. */
  11053. destroy(): void;
  11054. /**
  11055. * Indicates whether this instance was destroyed.
  11056. */
  11057. get destroyed(): boolean;
  11058. static ɵfac: ɵɵFactoryDeclaration<PlatformRef, never>;
  11059. static ɵprov: ɵɵInjectableDeclaration<PlatformRef>;
  11060. }
  11061. /**
  11062. * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
  11063. * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.
  11064. */
  11065. declare const ALLOW_MULTIPLE_PLATFORMS: InjectionToken<boolean>;
  11066. /**
  11067. * Creates a platform.
  11068. * Platforms must be created on launch using this function.
  11069. *
  11070. * @publicApi
  11071. */
  11072. declare function createPlatform(injector: Injector): PlatformRef;
  11073. /**
  11074. * Creates a factory for a platform. Can be used to provide or override `Providers` specific to
  11075. * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.
  11076. * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories
  11077. * to build up configurations that might be required by different libraries or parts of the
  11078. * application.
  11079. * @param name Identifies the new platform factory.
  11080. * @param providers A set of dependency providers for platforms created with the new factory.
  11081. *
  11082. * @publicApi
  11083. */
  11084. declare function createPlatformFactory(parentPlatformFactory: ((extraProviders?: StaticProvider[]) => PlatformRef) | null, name: string, providers?: StaticProvider[]): (extraProviders?: StaticProvider[]) => PlatformRef;
  11085. /**
  11086. * Checks that there is currently a platform that contains the given token as a provider.
  11087. *
  11088. * @publicApi
  11089. */
  11090. declare function assertPlatform(requiredToken: any): PlatformRef;
  11091. /**
  11092. * Returns the current platform.
  11093. *
  11094. * @publicApi
  11095. */
  11096. declare function getPlatform(): PlatformRef | null;
  11097. /**
  11098. * Destroys the current Angular platform and all Angular applications on the page.
  11099. * Destroys all modules and listeners registered with the platform.
  11100. *
  11101. * @publicApi
  11102. */
  11103. declare function destroyPlatform(): void;
  11104. /**
  11105. * The goal of this function is to bootstrap a platform injector,
  11106. * but avoid referencing `PlatformRef` class.
  11107. * This function is needed for bootstrapping a Standalone Component.
  11108. */
  11109. declare function createOrReusePlatformInjector(providers?: StaticProvider[]): Injector;
  11110. /**
  11111. * @description
  11112. * This function is used to provide initialization functions that will be executed upon
  11113. * initialization of the platform injector.
  11114. *
  11115. * Note that the provided initializer is run in the injection context.
  11116. *
  11117. * Previously, this was achieved using the `PLATFORM_INITIALIZER` token which is now deprecated.
  11118. *
  11119. * @see {@link PLATFORM_INITIALIZER}
  11120. *
  11121. * @publicApi
  11122. */
  11123. declare function providePlatformInitializer(initializerFn: () => void): EnvironmentProviders;
  11124. /**
  11125. * Internal token used to verify that `provideZoneChangeDetection` is not used
  11126. * with the bootstrapModule API.
  11127. */
  11128. declare const PROVIDED_NG_ZONE: InjectionToken<boolean>;
  11129. declare function internalProvideZoneChangeDetection({ ngZoneFactory, ignoreChangesOutsideZone, scheduleInRootZone, }: {
  11130. ngZoneFactory?: () => NgZone;
  11131. ignoreChangesOutsideZone?: boolean;
  11132. scheduleInRootZone?: boolean;
  11133. }): StaticProvider[];
  11134. /**
  11135. * Provides `NgZone`-based change detection for the application bootstrapped using
  11136. * `bootstrapApplication`.
  11137. *
  11138. * `NgZone` is already provided in applications by default. This provider allows you to configure
  11139. * options like `eventCoalescing` in the `NgZone`.
  11140. * This provider is not available for `platformBrowser().bootstrapModule`, which uses
  11141. * `BootstrapOptions` instead.
  11142. *
  11143. * @usageNotes
  11144. * ```ts
  11145. * bootstrapApplication(MyApp, {providers: [
  11146. * provideZoneChangeDetection({eventCoalescing: true}),
  11147. * ]});
  11148. * ```
  11149. *
  11150. * @publicApi
  11151. * @see {@link /api/platform-browser/bootstrapApplication bootstrapApplication}
  11152. * @see {@link NgZoneOptions}
  11153. */
  11154. declare function provideZoneChangeDetection(options?: NgZoneOptions): EnvironmentProviders;
  11155. /**
  11156. * Used to configure event and run coalescing with `provideZoneChangeDetection`.
  11157. *
  11158. * @publicApi
  11159. *
  11160. * @see {@link provideZoneChangeDetection}
  11161. */
  11162. interface NgZoneOptions {
  11163. /**
  11164. * Optionally specify coalescing event change detections or not.
  11165. * Consider the following case.
  11166. *
  11167. * ```html
  11168. * <div (click)="doSomething()">
  11169. * <button (click)="doSomethingElse()"></button>
  11170. * </div>
  11171. * ```
  11172. *
  11173. * When button is clicked, because of the event bubbling, both
  11174. * event handlers will be called and 2 change detections will be
  11175. * triggered. We can coalesce such kind of events to trigger
  11176. * change detection only once.
  11177. *
  11178. * By default, this option is set to false, meaning events will
  11179. * not be coalesced, and change detection will be triggered multiple times.
  11180. * If this option is set to true, change detection will be triggered
  11181. * once in the scenario described above.
  11182. */
  11183. eventCoalescing?: boolean;
  11184. /**
  11185. * Optionally specify if `NgZone#run()` method invocations should be coalesced
  11186. * into a single change detection.
  11187. *
  11188. * Consider the following case.
  11189. * ```ts
  11190. * for (let i = 0; i < 10; i ++) {
  11191. * ngZone.run(() => {
  11192. * // do something
  11193. * });
  11194. * }
  11195. * ```
  11196. *
  11197. * This case triggers the change detection multiple times.
  11198. * With ngZoneRunCoalescing options, all change detections in an event loop trigger only once.
  11199. * In addition, the change detection executes in requestAnimation.
  11200. *
  11201. */
  11202. runCoalescing?: boolean;
  11203. /**
  11204. * When false, change detection is scheduled when Angular receives
  11205. * a clear indication that templates need to be refreshed. This includes:
  11206. *
  11207. * - calling `ChangeDetectorRef.markForCheck`
  11208. * - calling `ComponentRef.setInput`
  11209. * - updating a signal that is read in a template
  11210. * - attaching a view that is marked dirty
  11211. * - removing a view
  11212. * - registering a render hook (templates are only refreshed if render hooks do one of the above)
  11213. *
  11214. * @deprecated This option was introduced out of caution as a way for developers to opt out of the
  11215. * new behavior in v18 which schedule change detection for the above events when they occur
  11216. * outside the Zone. After monitoring the results post-release, we have determined that this
  11217. * feature is working as desired and do not believe it should ever be disabled by setting
  11218. * this option to `true`.
  11219. */
  11220. ignoreChangesOutsideZone?: boolean;
  11221. }
  11222. declare class ChangeDetectionSchedulerImpl implements ChangeDetectionScheduler {
  11223. private readonly appRef;
  11224. private readonly taskService;
  11225. private readonly ngZone;
  11226. private readonly zonelessEnabled;
  11227. private readonly tracing;
  11228. private readonly disableScheduling;
  11229. private readonly zoneIsDefined;
  11230. private readonly schedulerTickApplyArgs;
  11231. private readonly subscriptions;
  11232. private readonly angularZoneId;
  11233. private readonly scheduleInRootZone;
  11234. private cancelScheduledCallback;
  11235. private useMicrotaskScheduler;
  11236. runningTick: boolean;
  11237. pendingRenderTaskId: number | null;
  11238. constructor();
  11239. notify(source: NotificationSource): void;
  11240. private shouldScheduleTick;
  11241. /**
  11242. * Calls ApplicationRef._tick inside the `NgZone`.
  11243. *
  11244. * Calling `tick` directly runs change detection and cancels any change detection that had been
  11245. * scheduled previously.
  11246. *
  11247. * @param shouldRefreshViews Passed directly to `ApplicationRef._tick` and skips straight to
  11248. * render hooks when `false`.
  11249. */
  11250. private tick;
  11251. ngOnDestroy(): void;
  11252. private cleanup;
  11253. static ɵfac: ɵɵFactoryDeclaration<ChangeDetectionSchedulerImpl, never>;
  11254. static ɵprov: ɵɵInjectableDeclaration<ChangeDetectionSchedulerImpl>;
  11255. }
  11256. /**
  11257. * Provides change detection without ZoneJS for the application bootstrapped using
  11258. * `bootstrapApplication`.
  11259. *
  11260. * This function allows you to configure the application to not use the state/state changes of
  11261. * ZoneJS to schedule change detection in the application. This will work when ZoneJS is not present
  11262. * on the page at all or if it exists because something else is using it (either another Angular
  11263. * application which uses ZoneJS for scheduling or some other library that relies on ZoneJS).
  11264. *
  11265. * This can also be added to the `TestBed` providers to configure the test environment to more
  11266. * closely match production behavior. This will help give higher confidence that components are
  11267. * compatible with zoneless change detection.
  11268. *
  11269. * ZoneJS uses browser events to trigger change detection. When using this provider, Angular will
  11270. * instead use Angular APIs to schedule change detection. These APIs include:
  11271. *
  11272. * - `ChangeDetectorRef.markForCheck`
  11273. * - `ComponentRef.setInput`
  11274. * - updating a signal that is read in a template
  11275. * - when bound host or template listeners are triggered
  11276. * - attaching a view that was marked dirty by one of the above
  11277. * - removing a view
  11278. * - registering a render hook (templates are only refreshed if render hooks do one of the above)
  11279. *
  11280. * @usageNotes
  11281. * ```ts
  11282. * bootstrapApplication(MyApp, {providers: [
  11283. * provideExperimentalZonelessChangeDetection(),
  11284. * ]});
  11285. * ```
  11286. *
  11287. * This API is experimental. Neither the shape, nor the underlying behavior is stable and can change
  11288. * in patch versions. There are known feature gaps and API ergonomic considerations. We will iterate
  11289. * on the exact API based on the feedback and our understanding of the problem and solution space.
  11290. *
  11291. * @publicApi
  11292. * @experimental
  11293. * @see {@link /api/platform-browser/bootstrapApplication bootstrapApplication}
  11294. */
  11295. declare function provideExperimentalZonelessChangeDetection(): EnvironmentProviders;
  11296. /**
  11297. * Internal implementation of the pending tasks service.
  11298. */
  11299. declare class PendingTasksInternal implements OnDestroy {
  11300. private taskId;
  11301. private pendingTasks;
  11302. private get _hasPendingTasks();
  11303. hasPendingTasks: BehaviorSubject<boolean>;
  11304. add(): number;
  11305. has(taskId: number): boolean;
  11306. remove(taskId: number): void;
  11307. ngOnDestroy(): void;
  11308. /** @nocollapse */
  11309. static ɵprov: unknown;
  11310. }
  11311. /**
  11312. * Service that keeps track of pending tasks contributing to the stableness of Angular
  11313. * application. While several existing Angular services (ex.: `HttpClient`) will internally manage
  11314. * tasks influencing stability, this API gives control over stability to library and application
  11315. * developers for specific cases not covered by Angular internals.
  11316. *
  11317. * The concept of stability comes into play in several important scenarios:
  11318. * - SSR process needs to wait for the application stability before serializing and sending rendered
  11319. * HTML;
  11320. * - tests might want to delay assertions until the application becomes stable;
  11321. *
  11322. * @usageNotes
  11323. * ```ts
  11324. * const pendingTasks = inject(PendingTasks);
  11325. * const taskCleanup = pendingTasks.add();
  11326. * // do work that should block application's stability and then:
  11327. * taskCleanup();
  11328. * ```
  11329. *
  11330. * @publicApi
  11331. * @developerPreview
  11332. */
  11333. declare class PendingTasks {
  11334. private internalPendingTasks;
  11335. private scheduler;
  11336. /**
  11337. * Adds a new task that should block application's stability.
  11338. * @returns A cleanup function that removes a task when called.
  11339. */
  11340. add(): () => void;
  11341. /**
  11342. * Runs an asynchronous function and blocks the application's stability until the function completes.
  11343. *
  11344. * ```ts
  11345. * pendingTasks.run(async () => {
  11346. * const userData = await fetch('/api/user');
  11347. * this.userData.set(userData);
  11348. * });
  11349. * ```
  11350. *
  11351. * Application stability is at least delayed until the next tick after the `run` method resolves
  11352. * so it is safe to make additional updates to application state that would require UI synchronization:
  11353. *
  11354. * ```ts
  11355. * const userData = await pendingTasks.run(() => fetch('/api/user'));
  11356. * this.userData.set(userData);
  11357. * ```
  11358. *
  11359. * @param fn The asynchronous function to execute
  11360. */
  11361. run<T>(fn: () => Promise<T>): Promise<T>;
  11362. /** @nocollapse */
  11363. static ɵprov: unknown;
  11364. }
  11365. /**
  11366. * Enables directive matching on elements.
  11367. *
  11368. * * Example:
  11369. * ```html
  11370. * <my-comp my-directive>
  11371. * Should match component / directive.
  11372. * </my-comp>
  11373. * <div ngNonBindable>
  11374. * <!-- ɵɵdisableBindings() -->
  11375. * <my-comp my-directive>
  11376. * Should not match component / directive because we are in ngNonBindable.
  11377. * </my-comp>
  11378. * <!-- ɵɵenableBindings() -->
  11379. * </div>
  11380. * ```
  11381. *
  11382. * @codeGenApi
  11383. */
  11384. declare function ɵɵenableBindings(): void;
  11385. /**
  11386. * Disables directive matching on element.
  11387. *
  11388. * * Example:
  11389. * ```html
  11390. * <my-comp my-directive>
  11391. * Should match component / directive.
  11392. * </my-comp>
  11393. * <div ngNonBindable>
  11394. * <!-- ɵɵdisableBindings() -->
  11395. * <my-comp my-directive>
  11396. * Should not match component / directive because we are in ngNonBindable.
  11397. * </my-comp>
  11398. * <!-- ɵɵenableBindings() -->
  11399. * </div>
  11400. * ```
  11401. *
  11402. * @codeGenApi
  11403. */
  11404. declare function ɵɵdisableBindings(): void;
  11405. /**
  11406. * Restores `contextViewData` to the given OpaqueViewState instance.
  11407. *
  11408. * Used in conjunction with the getCurrentView() instruction to save a snapshot
  11409. * of the current view and restore it when listeners are invoked. This allows
  11410. * walking the declaration view tree in listeners to get vars from parent views.
  11411. *
  11412. * @param viewToRestore The OpaqueViewState instance to restore.
  11413. * @returns Context of the restored OpaqueViewState instance.
  11414. *
  11415. * @codeGenApi
  11416. */
  11417. declare function ɵɵrestoreView<T = any>(viewToRestore: OpaqueViewState): T;
  11418. /**
  11419. * Clears the view set in `ɵɵrestoreView` from memory. Returns the passed in
  11420. * value so that it can be used as a return value of an instruction.
  11421. *
  11422. * @codeGenApi
  11423. */
  11424. declare function ɵɵresetView<T>(value?: T): T | undefined;
  11425. /**
  11426. * Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.
  11427. *
  11428. * @codeGenApi
  11429. */
  11430. declare function ɵɵnamespaceSVG(): void;
  11431. /**
  11432. * Sets the namespace used to create elements to `'http://www.w3.org/1998/MathML/'` in global state.
  11433. *
  11434. * @codeGenApi
  11435. */
  11436. declare function ɵɵnamespaceMathML(): void;
  11437. /**
  11438. * Sets the namespace used to create elements to `null`, which forces element creation to use
  11439. * `createElement` rather than `createElementNS`.
  11440. *
  11441. * @codeGenApi
  11442. */
  11443. declare function ɵɵnamespaceHTML(): void;
  11444. /**
  11445. * Used to periodically verify no expressions have changed after they were checked.
  11446. *
  11447. * @param options Used to configure when the check will execute.
  11448. * - `interval` will periodically run exhaustive `checkNoChanges` on application views
  11449. * - `useNgZoneOnStable` will use ZoneJS to determine when change detection might have run
  11450. * in an application using ZoneJS to drive change detection. When the `NgZone.onStable` would
  11451. * have emitted, all views attached to the `ApplicationRef` are checked for changes.
  11452. * - 'exhaustive' means that all views attached to `ApplicationRef` and all the descendants of those views will be
  11453. * checked for changes (excluding those subtrees which are detached via `ChangeDetectorRef.detach()`).
  11454. * This is useful because the check that runs after regular change detection does not work for components using `ChangeDetectionStrategy.OnPush`.
  11455. * This check is will surface any existing errors hidden by `OnPush` components. By default, this check is exhaustive
  11456. * and will always check all views, regardless of their "dirty" state and `ChangeDetectionStrategy`.
  11457. *
  11458. * When the `useNgZoneOnStable` option is `true`, this function will provide its own `NgZone` implementation and needs
  11459. * to come after any other `NgZone` provider, including `provideZoneChangeDetection()` and `provideExperimentalZonelessChangeDetection()`.
  11460. *
  11461. * @experimental
  11462. * @publicApi
  11463. */
  11464. declare function provideExperimentalCheckNoChangesForDebug(options: {
  11465. interval?: number;
  11466. useNgZoneOnStable?: boolean;
  11467. exhaustive?: boolean;
  11468. }): _angular_core.EnvironmentProviders;
  11469. /**
  11470. * Returns whether Angular is in development mode.
  11471. *
  11472. * By default, this is true, unless `enableProdMode` is invoked prior to calling this method or the
  11473. * application is built using the Angular CLI with the `optimization` option.
  11474. * @see {@link /cli/build ng build}
  11475. *
  11476. * @publicApi
  11477. */
  11478. declare function isDevMode(): boolean;
  11479. /**
  11480. * Disable Angular's development mode, which turns off assertions and other
  11481. * checks within the framework.
  11482. *
  11483. * One important assertion this disables verifies that a change detection pass
  11484. * does not result in additional changes to any bindings (also known as
  11485. * unidirectional data flow).
  11486. *
  11487. * Using this method is discouraged as the Angular CLI will set production mode when using the
  11488. * `optimization` option.
  11489. * @see {@link /cli/build ng build}
  11490. *
  11491. * @publicApi
  11492. */
  11493. declare function enableProdMode(): void;
  11494. /**
  11495. * A DI token representing a string ID, used
  11496. * primarily for prefixing application attributes and CSS styles when
  11497. * {@link ViewEncapsulation#Emulated} is being used.
  11498. *
  11499. * The token is needed in cases when multiple applications are bootstrapped on a page
  11500. * (for example, using `bootstrapApplication` calls). In this case, ensure that those applications
  11501. * have different `APP_ID` value setup. For example:
  11502. *
  11503. * ```ts
  11504. * bootstrapApplication(ComponentA, {
  11505. * providers: [
  11506. * { provide: APP_ID, useValue: 'app-a' },
  11507. * // ... other providers ...
  11508. * ]
  11509. * });
  11510. *
  11511. * bootstrapApplication(ComponentB, {
  11512. * providers: [
  11513. * { provide: APP_ID, useValue: 'app-b' },
  11514. * // ... other providers ...
  11515. * ]
  11516. * });
  11517. * ```
  11518. *
  11519. * By default, when there is only one application bootstrapped, you don't need to provide the
  11520. * `APP_ID` token (the `ng` will be used as an app ID).
  11521. *
  11522. * @publicApi
  11523. */
  11524. declare const APP_ID: InjectionToken<string>;
  11525. /**
  11526. * A function that is executed when a platform is initialized.
  11527. *
  11528. * @deprecated from v19.0.0, use providePlatformInitializer instead
  11529. *
  11530. * @see {@link providePlatformInitializer}
  11531. *
  11532. * @publicApi
  11533. */
  11534. declare const PLATFORM_INITIALIZER: InjectionToken<readonly (() => void)[]>;
  11535. /**
  11536. * A token that indicates an opaque platform ID.
  11537. * @publicApi
  11538. */
  11539. declare const PLATFORM_ID: InjectionToken<Object>;
  11540. /**
  11541. * A DI token that indicates the root directory of
  11542. * the application
  11543. * @publicApi
  11544. * @deprecated
  11545. */
  11546. declare const PACKAGE_ROOT_URL: InjectionToken<string>;
  11547. /**
  11548. * A [DI token](api/core/InjectionToken) that indicates which animations
  11549. * module has been loaded.
  11550. * @publicApi
  11551. */
  11552. declare const ANIMATION_MODULE_TYPE: InjectionToken<"NoopAnimations" | "BrowserAnimations">;
  11553. /**
  11554. * Token used to configure the [Content Security Policy](https://web.dev/strict-csp/) nonce that
  11555. * Angular will apply when inserting inline styles. If not provided, Angular will look up its value
  11556. * from the `ngCspNonce` attribute of the application root node.
  11557. *
  11558. * @publicApi
  11559. */
  11560. declare const CSP_NONCE: InjectionToken<string | null>;
  11561. /**
  11562. * A configuration object for the image-related options. Contains:
  11563. * - breakpoints: An array of integer breakpoints used to generate
  11564. * srcsets for responsive images.
  11565. * - disableImageSizeWarning: A boolean value. Setting this to true will
  11566. * disable console warnings about oversized images.
  11567. * - disableImageLazyLoadWarning: A boolean value. Setting this to true will
  11568. * disable console warnings about LCP images configured with `loading="lazy"`.
  11569. * Learn more about the responsive image configuration in [the NgOptimizedImage
  11570. * guide](guide/image-optimization).
  11571. * Learn more about image warning options in [the related error page](errors/NG0913).
  11572. * @publicApi
  11573. */
  11574. type ImageConfig = {
  11575. breakpoints?: number[];
  11576. placeholderResolution?: number;
  11577. disableImageSizeWarning?: boolean;
  11578. disableImageLazyLoadWarning?: boolean;
  11579. };
  11580. declare const IMAGE_CONFIG_DEFAULTS: ImageConfig;
  11581. /**
  11582. * Injection token that configures the image optimized image functionality.
  11583. * See {@link ImageConfig} for additional information about parameters that
  11584. * can be used.
  11585. *
  11586. * @see {@link NgOptimizedImage}
  11587. * @see {@link ImageConfig}
  11588. * @publicApi
  11589. */
  11590. declare const IMAGE_CONFIG: InjectionToken<ImageConfig>;
  11591. /**
  11592. * A DI token that you can use to provide
  11593. * one or more initialization functions.
  11594. *
  11595. * The provided functions are injected at application startup and executed during
  11596. * app initialization. If any of these functions returns a Promise or an Observable, initialization
  11597. * does not complete until the Promise is resolved or the Observable is completed.
  11598. *
  11599. * You can, for example, create a factory function that loads language data
  11600. * or an external configuration, and provide that function to the `APP_INITIALIZER` token.
  11601. * The function is executed during the application bootstrap process,
  11602. * and the needed data is available on startup.
  11603. *
  11604. * Note that the provided initializer is run in the injection context.
  11605. *
  11606. * @deprecated from v19.0.0, use provideAppInitializer instead
  11607. *
  11608. * @see {@link ApplicationInitStatus}
  11609. * @see {@link provideAppInitializer}
  11610. *
  11611. * @usageNotes
  11612. *
  11613. * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token
  11614. * and a function returning a promise.
  11615. * ### Example with NgModule-based application
  11616. * ```ts
  11617. * function initializeApp(): Promise<any> {
  11618. * const http = inject(HttpClient);
  11619. * return firstValueFrom(
  11620. * http
  11621. * .get("https://someUrl.com/api/user")
  11622. * .pipe(tap(user => { ... }))
  11623. * );
  11624. * }
  11625. *
  11626. * @NgModule({
  11627. * imports: [BrowserModule],
  11628. * declarations: [AppComponent],
  11629. * bootstrap: [AppComponent],
  11630. * providers: [{
  11631. * provide: APP_INITIALIZER,
  11632. * useValue: initializeApp,
  11633. * multi: true,
  11634. * }]
  11635. * })
  11636. * export class AppModule {}
  11637. * ```
  11638. *
  11639. * ### Example with standalone application
  11640. * ```ts
  11641. * function initializeApp() {
  11642. * const http = inject(HttpClient);
  11643. * return firstValueFrom(
  11644. * http
  11645. * .get("https://someUrl.com/api/user")
  11646. * .pipe(tap(user => { ... }))
  11647. * );
  11648. * }
  11649. *
  11650. * bootstrapApplication(App, {
  11651. * providers: [
  11652. * provideHttpClient(),
  11653. * {
  11654. * provide: APP_INITIALIZER,
  11655. * useValue: initializeApp,
  11656. * multi: true,
  11657. * },
  11658. * ],
  11659. * });
  11660. * ```
  11661. *
  11662. *
  11663. * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function
  11664. * returning an observable, see an example below. Note: the `HttpClient` in this example is used for
  11665. * demo purposes to illustrate how the factory function can work with other providers available
  11666. * through DI.
  11667. *
  11668. * ### Example with NgModule-based application
  11669. * ```ts
  11670. * function initializeApp() {
  11671. * const http = inject(HttpClient);
  11672. * return firstValueFrom(
  11673. * http
  11674. * .get("https://someUrl.com/api/user")
  11675. * .pipe(tap(user => { ... }))
  11676. * );
  11677. * }
  11678. *
  11679. * @NgModule({
  11680. * imports: [BrowserModule, HttpClientModule],
  11681. * declarations: [AppComponent],
  11682. * bootstrap: [AppComponent],
  11683. * providers: [{
  11684. * provide: APP_INITIALIZER,
  11685. * useValue: initializeApp,
  11686. * multi: true,
  11687. * }]
  11688. * })
  11689. * export class AppModule {}
  11690. * ```
  11691. *
  11692. * ### Example with standalone application
  11693. * ```ts
  11694. * function initializeApp() {
  11695. * const http = inject(HttpClient);
  11696. * return firstValueFrom(
  11697. * http
  11698. * .get("https://someUrl.com/api/user")
  11699. * .pipe(tap(user => { ... }))
  11700. * );
  11701. * }
  11702. *
  11703. * bootstrapApplication(App, {
  11704. * providers: [
  11705. * provideHttpClient(),
  11706. * {
  11707. * provide: APP_INITIALIZER,
  11708. * useValue: initializeApp,
  11709. * multi: true,
  11710. * },
  11711. * ],
  11712. * });
  11713. * ```
  11714. *
  11715. * @publicApi
  11716. */
  11717. declare const APP_INITIALIZER: InjectionToken<readonly (() => Observable<unknown> | Promise<unknown> | void)[]>;
  11718. /**
  11719. * @description
  11720. * The provided function is injected at application startup and executed during
  11721. * app initialization. If the function returns a Promise or an Observable, initialization
  11722. * does not complete until the Promise is resolved or the Observable is completed.
  11723. *
  11724. * You can, for example, create a function that loads language data
  11725. * or an external configuration, and provide that function using `provideAppInitializer()`.
  11726. * The function is executed during the application bootstrap process,
  11727. * and the needed data is available on startup.
  11728. *
  11729. * Note that the provided initializer is run in the injection context.
  11730. *
  11731. * Previously, this was achieved using the `APP_INITIALIZER` token which is now deprecated.
  11732. *
  11733. * @see {@link APP_INITIALIZER}
  11734. *
  11735. * @usageNotes
  11736. * The following example illustrates how to configure an initialization function using
  11737. * `provideAppInitializer()`
  11738. * ```ts
  11739. * bootstrapApplication(App, {
  11740. * providers: [
  11741. * provideAppInitializer(() => {
  11742. * const http = inject(HttpClient);
  11743. * return firstValueFrom(
  11744. * http
  11745. * .get("https://someUrl.com/api/user")
  11746. * .pipe(tap(user => { ... }))
  11747. * );
  11748. * }),
  11749. * provideHttpClient(),
  11750. * ],
  11751. * });
  11752. * ```
  11753. *
  11754. * @publicApi
  11755. */
  11756. declare function provideAppInitializer(initializerFn: () => Observable<unknown> | Promise<unknown> | void): EnvironmentProviders;
  11757. /**
  11758. * A class that reflects the state of running {@link APP_INITIALIZER} functions.
  11759. *
  11760. * @publicApi
  11761. */
  11762. declare class ApplicationInitStatus {
  11763. private resolve;
  11764. private reject;
  11765. private initialized;
  11766. readonly done = false;
  11767. readonly donePromise: Promise<any>;
  11768. private readonly appInits;
  11769. private readonly injector;
  11770. constructor();
  11771. static ɵfac: ɵɵFactoryDeclaration<ApplicationInitStatus, never>;
  11772. static ɵprov: ɵɵInjectableDeclaration<ApplicationInitStatus>;
  11773. }
  11774. /**
  11775. * @publicApi
  11776. */
  11777. declare class DebugEventListener {
  11778. name: string;
  11779. callback: Function;
  11780. constructor(name: string, callback: Function);
  11781. }
  11782. /**
  11783. * @publicApi
  11784. */
  11785. declare function asNativeElements(debugEls: DebugElement[]): any;
  11786. /**
  11787. * @publicApi
  11788. */
  11789. declare class DebugNode {
  11790. /**
  11791. * The underlying DOM node.
  11792. */
  11793. readonly nativeNode: any;
  11794. constructor(nativeNode: Node);
  11795. /**
  11796. * The `DebugElement` parent. Will be `null` if this is the root element.
  11797. */
  11798. get parent(): DebugElement | null;
  11799. /**
  11800. * The host dependency injector. For example, the root element's component instance injector.
  11801. */
  11802. get injector(): Injector;
  11803. /**
  11804. * The element's own component instance, if it has one.
  11805. */
  11806. get componentInstance(): any;
  11807. /**
  11808. * An object that provides parent context for this element. Often an ancestor component instance
  11809. * that governs this element.
  11810. *
  11811. * When an element is repeated within *ngFor, the context is an `NgForOf` whose `$implicit`
  11812. * property is the value of the row instance value. For example, the `hero` in `*ngFor="let hero
  11813. * of heroes"`.
  11814. */
  11815. get context(): any;
  11816. /**
  11817. * The callbacks attached to the component's @Output properties and/or the element's event
  11818. * properties.
  11819. */
  11820. get listeners(): DebugEventListener[];
  11821. /**
  11822. * Dictionary of objects associated with template local variables (e.g. #foo), keyed by the local
  11823. * variable name.
  11824. */
  11825. get references(): {
  11826. [key: string]: any;
  11827. };
  11828. /**
  11829. * This component's injector lookup tokens. Includes the component itself plus the tokens that the
  11830. * component lists in its providers metadata.
  11831. */
  11832. get providerTokens(): any[];
  11833. }
  11834. /**
  11835. * @publicApi
  11836. *
  11837. * @see [Component testing scenarios](guide/testing/components-scenarios)
  11838. * @see [Basics of testing components](guide/testing/components-basics)
  11839. * @see [Testing utility APIs](guide/testing/utility-apis)
  11840. */
  11841. declare class DebugElement extends DebugNode {
  11842. constructor(nativeNode: Element);
  11843. /**
  11844. * The underlying DOM element at the root of the component.
  11845. */
  11846. get nativeElement(): any;
  11847. /**
  11848. * The element tag name, if it is an element.
  11849. */
  11850. get name(): string;
  11851. /**
  11852. * Gets a map of property names to property values for an element.
  11853. *
  11854. * This map includes:
  11855. * - Regular property bindings (e.g. `[id]="id"`)
  11856. * - Host property bindings (e.g. `host: { '[id]': "id" }`)
  11857. * - Interpolated property bindings (e.g. `id="{{ value }}")
  11858. *
  11859. * It does not include:
  11860. * - input property bindings (e.g. `[myCustomInput]="value"`)
  11861. * - attribute bindings (e.g. `[attr.role]="menu"`)
  11862. */
  11863. get properties(): {
  11864. [key: string]: any;
  11865. };
  11866. /**
  11867. * A map of attribute names to attribute values for an element.
  11868. */
  11869. get attributes(): {
  11870. [key: string]: string | null;
  11871. };
  11872. /**
  11873. * The inline styles of the DOM element.
  11874. */
  11875. get styles(): {
  11876. [key: string]: string | null;
  11877. };
  11878. /**
  11879. * A map containing the class names on the element as keys.
  11880. *
  11881. * This map is derived from the `className` property of the DOM element.
  11882. *
  11883. * Note: The values of this object will always be `true`. The class key will not appear in the KV
  11884. * object if it does not exist on the element.
  11885. *
  11886. * @see [Element.className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className)
  11887. */
  11888. get classes(): {
  11889. [key: string]: boolean;
  11890. };
  11891. /**
  11892. * The `childNodes` of the DOM element as a `DebugNode` array.
  11893. *
  11894. * @see [Node.childNodes](https://developer.mozilla.org/en-US/docs/Web/API/Node/childNodes)
  11895. */
  11896. get childNodes(): DebugNode[];
  11897. /**
  11898. * The immediate `DebugElement` children. Walk the tree by descending through `children`.
  11899. */
  11900. get children(): DebugElement[];
  11901. /**
  11902. * @returns the first `DebugElement` that matches the predicate at any depth in the subtree.
  11903. */
  11904. query(predicate: Predicate<DebugElement>): DebugElement;
  11905. /**
  11906. * @returns All `DebugElement` matches for the predicate at any depth in the subtree.
  11907. */
  11908. queryAll(predicate: Predicate<DebugElement>): DebugElement[];
  11909. /**
  11910. * @returns All `DebugNode` matches for the predicate at any depth in the subtree.
  11911. */
  11912. queryAllNodes(predicate: Predicate<DebugNode>): DebugNode[];
  11913. /**
  11914. * Triggers the event by its name if there is a corresponding listener in the element's
  11915. * `listeners` collection.
  11916. *
  11917. * If the event lacks a listener or there's some other problem, consider
  11918. * calling `nativeElement.dispatchEvent(eventObject)`.
  11919. *
  11920. * @param eventName The name of the event to trigger
  11921. * @param eventObj The _event object_ expected by the handler
  11922. *
  11923. * @see [Testing components scenarios](guide/testing/components-scenarios#trigger-event-handler)
  11924. */
  11925. triggerEventHandler(eventName: string, eventObj?: any): void;
  11926. }
  11927. /**
  11928. * @publicApi
  11929. */
  11930. declare function getDebugNode(nativeNode: any): DebugNode | null;
  11931. /**
  11932. * A boolean-valued function over a value, possibly including context information
  11933. * regarding that value's position in an array.
  11934. *
  11935. * @publicApi
  11936. */
  11937. type Predicate<T> = (value: T) => boolean;
  11938. /**
  11939. * Testability API.
  11940. * `declare` keyword causes tsickle to generate externs, so these methods are
  11941. * not renamed by Closure Compiler.
  11942. * @publicApi
  11943. */
  11944. declare interface PublicTestability {
  11945. isStable(): boolean;
  11946. whenStable(callback: Function, timeout?: number, updateCallback?: Function): void;
  11947. findProviders(using: any, provider: string, exactMatch: boolean): any[];
  11948. }
  11949. /**
  11950. * Internal injection token that can used to access an instance of a Testability class.
  11951. *
  11952. * This token acts as a bridge between the core bootstrap code and the `Testability` class. This is
  11953. * needed to ensure that there are no direct references to the `Testability` class, so it can be
  11954. * tree-shaken away (if not referenced). For the environments/setups when the `Testability` class
  11955. * should be available, this token is used to add a provider that references the `Testability`
  11956. * class. Otherwise, only this token is retained in a bundle, but the `Testability` class is not.
  11957. */
  11958. declare const TESTABILITY: InjectionToken<Testability>;
  11959. /**
  11960. * Internal injection token to retrieve Testability getter class instance.
  11961. */
  11962. declare const TESTABILITY_GETTER: InjectionToken<GetTestability>;
  11963. /**
  11964. * The Testability service provides testing hooks that can be accessed from
  11965. * the browser.
  11966. *
  11967. * Angular applications bootstrapped using an NgModule (via `@NgModule.bootstrap` field) will also
  11968. * instantiate Testability by default (in both development and production modes).
  11969. *
  11970. * For applications bootstrapped using the `bootstrapApplication` function, Testability is not
  11971. * included by default. You can include it into your applications by getting the list of necessary
  11972. * providers using the `provideProtractorTestingSupport()` function and adding them into the
  11973. * `options.providers` array. Example:
  11974. *
  11975. * ```ts
  11976. * import {provideProtractorTestingSupport} from '@angular/platform-browser';
  11977. *
  11978. * await bootstrapApplication(RootComponent, providers: [provideProtractorTestingSupport()]);
  11979. * ```
  11980. *
  11981. * @publicApi
  11982. */
  11983. declare class Testability implements PublicTestability {
  11984. private _ngZone;
  11985. private registry;
  11986. private _isZoneStable;
  11987. private _callbacks;
  11988. private _taskTrackingZone;
  11989. private _destroyRef?;
  11990. constructor(_ngZone: NgZone, registry: TestabilityRegistry, testabilityGetter: GetTestability);
  11991. private _watchAngularEvents;
  11992. /**
  11993. * Whether an associated application is stable
  11994. */
  11995. isStable(): boolean;
  11996. private _runCallbacksIfReady;
  11997. private getPendingTasks;
  11998. private addCallback;
  11999. /**
  12000. * Wait for the application to be stable with a timeout. If the timeout is reached before that
  12001. * happens, the callback receives a list of the macro tasks that were pending, otherwise null.
  12002. *
  12003. * @param doneCb The callback to invoke when Angular is stable or the timeout expires
  12004. * whichever comes first.
  12005. * @param timeout Optional. The maximum time to wait for Angular to become stable. If not
  12006. * specified, whenStable() will wait forever.
  12007. * @param updateCb Optional. If specified, this callback will be invoked whenever the set of
  12008. * pending macrotasks changes. If this callback returns true doneCb will not be invoked
  12009. * and no further updates will be issued.
  12010. */
  12011. whenStable(doneCb: Function, timeout?: number, updateCb?: Function): void;
  12012. /**
  12013. * Find providers by name
  12014. * @param using The root element to search from
  12015. * @param provider The name of binding variable
  12016. * @param exactMatch Whether using exactMatch
  12017. */
  12018. findProviders(using: any, provider: string, exactMatch: boolean): any[];
  12019. static ɵfac: ɵɵFactoryDeclaration<Testability, never>;
  12020. static ɵprov: ɵɵInjectableDeclaration<Testability>;
  12021. }
  12022. /**
  12023. * A global registry of {@link Testability} instances for specific elements.
  12024. * @publicApi
  12025. */
  12026. declare class TestabilityRegistry {
  12027. /**
  12028. * Registers an application with a testability hook so that it can be tracked
  12029. * @param token token of application, root element
  12030. * @param testability Testability hook
  12031. */
  12032. registerApplication(token: any, testability: Testability): void;
  12033. /**
  12034. * Unregisters an application.
  12035. * @param token token of application, root element
  12036. */
  12037. unregisterApplication(token: any): void;
  12038. /**
  12039. * Unregisters all applications
  12040. */
  12041. unregisterAllApplications(): void;
  12042. /**
  12043. * Get a testability hook associated with the application
  12044. * @param elem root element
  12045. */
  12046. getTestability(elem: any): Testability | null;
  12047. /**
  12048. * Get all registered testabilities
  12049. */
  12050. getAllTestabilities(): Testability[];
  12051. /**
  12052. * Get all registered applications(root elements)
  12053. */
  12054. getAllRootElements(): any[];
  12055. /**
  12056. * Find testability of a node in the Tree
  12057. * @param elem node
  12058. * @param findInAncestors whether finding testability in ancestors if testability was not found in
  12059. * current node
  12060. */
  12061. findTestabilityInTree(elem: Node, findInAncestors?: boolean): Testability | null;
  12062. static ɵfac: ɵɵFactoryDeclaration<TestabilityRegistry, never>;
  12063. static ɵprov: ɵɵInjectableDeclaration<TestabilityRegistry>;
  12064. }
  12065. /**
  12066. * Adapter interface for retrieving the `Testability` service associated for a
  12067. * particular context.
  12068. *
  12069. * @publicApi
  12070. */
  12071. interface GetTestability {
  12072. addToWindow(registry: TestabilityRegistry): void;
  12073. findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null;
  12074. }
  12075. /**
  12076. * Set the {@link GetTestability} implementation used by the Angular testing framework.
  12077. * @publicApi
  12078. */
  12079. declare function setTestabilityGetter(getter: GetTestability): void;
  12080. /**
  12081. * This platform has to be included in any other platform
  12082. *
  12083. * @publicApi
  12084. */
  12085. declare const platformCore: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
  12086. /**
  12087. * Provide this token to set the locale of your application.
  12088. * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
  12089. * DecimalPipe and PercentPipe) and by ICU expressions.
  12090. *
  12091. * See the [i18n guide](guide/i18n/locale-id) for more information.
  12092. *
  12093. * @usageNotes
  12094. * ### Example
  12095. *
  12096. * ```ts
  12097. * import { LOCALE_ID } from '@angular/core';
  12098. * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  12099. * import { AppModule } from './app/app.module';
  12100. *
  12101. * platformBrowserDynamic().bootstrapModule(AppModule, {
  12102. * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
  12103. * });
  12104. * ```
  12105. *
  12106. * @publicApi
  12107. */
  12108. declare const LOCALE_ID: InjectionToken<string>;
  12109. /**
  12110. * Provide this token to set the default currency code your application uses for
  12111. * CurrencyPipe when there is no currency code passed into it. This is only used by
  12112. * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.
  12113. *
  12114. * See the [i18n guide](guide/i18n/locale-id) for more information.
  12115. *
  12116. * <div class="docs-alert docs-alert-helpful">
  12117. *
  12118. * The default currency code is currently always `USD`.
  12119. *
  12120. * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in
  12121. * your application `NgModule`:
  12122. *
  12123. * ```ts
  12124. * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
  12125. * ```
  12126. *
  12127. * </div>
  12128. *
  12129. * @usageNotes
  12130. * ### Example
  12131. *
  12132. * ```ts
  12133. * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  12134. * import { AppModule } from './app/app.module';
  12135. *
  12136. * platformBrowserDynamic().bootstrapModule(AppModule, {
  12137. * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]
  12138. * });
  12139. * ```
  12140. *
  12141. * @publicApi
  12142. */
  12143. declare const DEFAULT_CURRENCY_CODE: InjectionToken<string>;
  12144. /**
  12145. * Use this token at bootstrap to provide the content of your translation file (`xtb`,
  12146. * `xlf` or `xlf2`) when you want to translate your application in another language.
  12147. *
  12148. * See the [i18n guide](guide/i18n/merge) for more information.
  12149. *
  12150. * @usageNotes
  12151. * ### Example
  12152. *
  12153. * ```ts
  12154. * import { TRANSLATIONS } from '@angular/core';
  12155. * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  12156. * import { AppModule } from './app/app.module';
  12157. *
  12158. * // content of your translation file
  12159. * const translations = '....';
  12160. *
  12161. * platformBrowserDynamic().bootstrapModule(AppModule, {
  12162. * providers: [{provide: TRANSLATIONS, useValue: translations }]
  12163. * });
  12164. * ```
  12165. *
  12166. * @publicApi
  12167. */
  12168. declare const TRANSLATIONS: InjectionToken<string>;
  12169. /**
  12170. * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
  12171. * `xlf` or `xlf2`.
  12172. *
  12173. * See the [i18n guide](guide/i18n/merge) for more information.
  12174. *
  12175. * @usageNotes
  12176. * ### Example
  12177. *
  12178. * ```ts
  12179. * import { TRANSLATIONS_FORMAT } from '@angular/core';
  12180. * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  12181. * import { AppModule } from './app/app.module';
  12182. *
  12183. * platformBrowserDynamic().bootstrapModule(AppModule, {
  12184. * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
  12185. * });
  12186. * ```
  12187. *
  12188. * @publicApi
  12189. */
  12190. declare const TRANSLATIONS_FORMAT: InjectionToken<string>;
  12191. /**
  12192. * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
  12193. * that the compiler should use in case of missing translations:
  12194. * - Error: throw if you have missing translations.
  12195. * - Warning (default): show a warning in the console and/or shell.
  12196. * - Ignore: do nothing.
  12197. *
  12198. * See the [i18n guide](guide/i18n/merge#report-missing-translations) for more information.
  12199. *
  12200. * @usageNotes
  12201. * ### Example
  12202. * ```ts
  12203. * import { MissingTranslationStrategy } from '@angular/core';
  12204. * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  12205. * import { AppModule } from './app/app.module';
  12206. *
  12207. * platformBrowserDynamic().bootstrapModule(AppModule, {
  12208. * missingTranslation: MissingTranslationStrategy.Error
  12209. * });
  12210. * ```
  12211. *
  12212. * @publicApi
  12213. */
  12214. declare enum MissingTranslationStrategy {
  12215. Error = 0,
  12216. Warning = 1,
  12217. Ignore = 2
  12218. }
  12219. /**
  12220. * Re-exported by `BrowserModule`, which is included automatically in the root
  12221. * `AppModule` when you create a new app with the CLI `new` command. Eagerly injects
  12222. * `ApplicationRef` to instantiate it.
  12223. *
  12224. * @publicApi
  12225. */
  12226. declare class ApplicationModule {
  12227. constructor(appRef: ApplicationRef);
  12228. static ɵfac: ɵɵFactoryDeclaration<ApplicationModule, never>;
  12229. static ɵmod: ɵɵNgModuleDeclaration<ApplicationModule, never, never, never>;
  12230. static ɵinj: ɵɵInjectorDeclaration<ApplicationModule>;
  12231. }
  12232. /**
  12233. * Provides a hook for centralized exception handling.
  12234. *
  12235. * The default implementation of `ErrorHandler` prints error messages to the `console`. To
  12236. * intercept error handling, write a custom exception handler that replaces this default as
  12237. * appropriate for your app.
  12238. *
  12239. * @usageNotes
  12240. * ### Example
  12241. *
  12242. * ```ts
  12243. * class MyErrorHandler implements ErrorHandler {
  12244. * handleError(error) {
  12245. * // do something with the exception
  12246. * }
  12247. * }
  12248. *
  12249. * // Provide in standalone apps
  12250. * bootstrapApplication(AppComponent, {
  12251. * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
  12252. * })
  12253. *
  12254. * // Provide in module-based apps
  12255. * @NgModule({
  12256. * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
  12257. * })
  12258. * class MyModule {}
  12259. * ```
  12260. *
  12261. * @publicApi
  12262. */
  12263. declare class ErrorHandler {
  12264. handleError(error: any): void;
  12265. }
  12266. /**
  12267. * `InjectionToken` used to configure how to call the `ErrorHandler`.
  12268. *
  12269. * `NgZone` is provided by default today so the default (and only) implementation for this
  12270. * is calling `ErrorHandler.handleError` outside of the Angular zone.
  12271. */
  12272. declare const INTERNAL_APPLICATION_ERROR_HANDLER: InjectionToken<(e: any) => void>;
  12273. /**
  12274. * Internal create application API that implements the core application creation logic and optional
  12275. * bootstrap logic.
  12276. *
  12277. * Platforms (such as `platform-browser`) may require different set of application and platform
  12278. * providers for an application to function correctly. As a result, platforms may use this function
  12279. * internally and supply the necessary providers during the bootstrap, while exposing
  12280. * platform-specific APIs as a part of their public API.
  12281. *
  12282. * @returns A promise that returns an `ApplicationRef` instance once resolved.
  12283. */
  12284. declare function internalCreateApplication(config: {
  12285. rootComponent?: Type$1<unknown>;
  12286. appProviders?: Array<Provider | EnvironmentProviders>;
  12287. platformProviders?: Provider[];
  12288. }): Promise<ApplicationRef>;
  12289. declare class Console {
  12290. log(message: string): void;
  12291. warn(message: string): void;
  12292. static ɵfac: ɵɵFactoryDeclaration<Console, never>;
  12293. static ɵprov: ɵɵInjectableDeclaration<Console>;
  12294. }
  12295. /**
  12296. * Defer block instance for testing.
  12297. */
  12298. interface DeferBlockDetails extends DehydratedDeferBlock {
  12299. tDetails: TDeferBlockDetails;
  12300. }
  12301. /**
  12302. * Retrieves all defer blocks in a given LView.
  12303. *
  12304. * @param lView lView with defer blocks
  12305. * @param deferBlocks defer block aggregator array
  12306. */
  12307. declare function getDeferBlocks$1(lView: LView, deferBlocks: DeferBlockDetails[]): void;
  12308. /**
  12309. * **INTERNAL**, avoid referencing it in application code.
  12310. * *
  12311. * Injector token that allows to provide `DeferBlockDependencyInterceptor` class
  12312. * implementation.
  12313. *
  12314. * This token is only injected in devMode
  12315. */
  12316. declare const DEFER_BLOCK_DEPENDENCY_INTERCEPTOR: InjectionToken<DeferBlockDependencyInterceptor>;
  12317. /**
  12318. * **INTERNAL**, token used for configuring defer block behavior.
  12319. */
  12320. declare const DEFER_BLOCK_CONFIG: InjectionToken<DeferBlockConfig>;
  12321. /** Rendering Helpers */
  12322. /**
  12323. * Transitions a defer block to the new state. Updates the necessary
  12324. * data structures and renders corresponding block.
  12325. *
  12326. * @param newState New state that should be applied to the defer block.
  12327. * @param tNode TNode that represents a defer block.
  12328. * @param lContainer Represents an instance of a defer block.
  12329. * @param skipTimerScheduling Indicates that `@loading` and `@placeholder` block
  12330. * should be rendered immediately, even if they have `after` or `minimum` config
  12331. * options setup. This flag to needed for testing APIs to transition defer block
  12332. * between states via `DeferFixture.render` method.
  12333. */
  12334. declare function renderDeferBlockState(newState: DeferBlockState, tNode: TNode, lContainer: LContainer, skipTimerScheduling?: boolean): void;
  12335. /**
  12336. * Enables timer-related scheduling if `after` or `minimum` parameters are setup
  12337. * on the `@loading` or `@placeholder` blocks.
  12338. */
  12339. declare function ɵɵdeferEnableTimerScheduling(tView: TView, tDetails: TDeferBlockDetails, placeholderConfigIndex?: number | null, loadingConfigIndex?: number | null): void;
  12340. /**
  12341. * Trigger loading of defer block dependencies if the process hasn't started yet.
  12342. *
  12343. * @param tDetails Static information about this defer block.
  12344. * @param lView LView of a host view.
  12345. */
  12346. declare function triggerResourceLoading(tDetails: TDeferBlockDetails, lView: LView, tNode: TNode): Promise<unknown>;
  12347. /**
  12348. * Tell ivy what the `document` is for this platform.
  12349. *
  12350. * It is only necessary to call this if the current platform is not a browser.
  12351. *
  12352. * @param document The object representing the global `document` in this environment.
  12353. */
  12354. declare function setDocument(document: Document | undefined): void;
  12355. /**
  12356. * Access the object that represents the `document` for this platform.
  12357. *
  12358. * Ivy calls this whenever it needs to access the `document` object.
  12359. * For example to create the renderer or to do sanitization.
  12360. */
  12361. declare function getDocument(): Document;
  12362. /**
  12363. * URL for the XSS security documentation.
  12364. */
  12365. declare const XSS_SECURITY_URL = "https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss";
  12366. /**
  12367. * The list of error codes used in runtime code of the `core` package.
  12368. * Reserved error code range: 100-999.
  12369. *
  12370. * Note: the minus sign denotes the fact that a particular code has a detailed guide on
  12371. * angular.io. This extra annotation is needed to avoid introducing a separate set to store
  12372. * error codes which have guides, which might leak into runtime code.
  12373. *
  12374. * Full list of available error guides can be found at https://angular.dev/errors.
  12375. *
  12376. * Error code ranges per package:
  12377. * - core (this package): 100-999
  12378. * - forms: 1000-1999
  12379. * - common: 2000-2999
  12380. * - animations: 3000-3999
  12381. * - router: 4000-4999
  12382. * - platform-browser: 5000-5500
  12383. */
  12384. declare const enum RuntimeErrorCode {
  12385. EXPRESSION_CHANGED_AFTER_CHECKED = -100,
  12386. RECURSIVE_APPLICATION_REF_TICK = 101,
  12387. INFINITE_CHANGE_DETECTION = 103,
  12388. CYCLIC_DI_DEPENDENCY = -200,
  12389. PROVIDER_NOT_FOUND = -201,
  12390. INVALID_FACTORY_DEPENDENCY = 202,
  12391. MISSING_INJECTION_CONTEXT = -203,
  12392. INVALID_INJECTION_TOKEN = 204,
  12393. INJECTOR_ALREADY_DESTROYED = 205,
  12394. PROVIDER_IN_WRONG_CONTEXT = 207,
  12395. MISSING_INJECTION_TOKEN = 208,
  12396. INVALID_MULTI_PROVIDER = -209,
  12397. MISSING_DOCUMENT = 210,
  12398. MULTIPLE_COMPONENTS_MATCH = -300,
  12399. EXPORT_NOT_FOUND = -301,
  12400. PIPE_NOT_FOUND = -302,
  12401. UNKNOWN_BINDING = 303,
  12402. UNKNOWN_ELEMENT = 304,
  12403. TEMPLATE_STRUCTURE_ERROR = 305,
  12404. INVALID_EVENT_BINDING = 306,
  12405. HOST_DIRECTIVE_UNRESOLVABLE = 307,
  12406. HOST_DIRECTIVE_NOT_STANDALONE = 308,
  12407. DUPLICATE_DIRECTIVE = 309,
  12408. HOST_DIRECTIVE_COMPONENT = 310,
  12409. HOST_DIRECTIVE_UNDEFINED_BINDING = 311,
  12410. HOST_DIRECTIVE_CONFLICTING_ALIAS = 312,
  12411. MULTIPLE_MATCHING_PIPES = 313,
  12412. UNINITIALIZED_LET_ACCESS = 314,
  12413. MULTIPLE_PLATFORMS = 400,
  12414. PLATFORM_NOT_FOUND = 401,
  12415. MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP = 402,
  12416. BOOTSTRAP_COMPONENTS_NOT_FOUND = -403,
  12417. PLATFORM_ALREADY_DESTROYED = 404,
  12418. ASYNC_INITIALIZERS_STILL_RUNNING = 405,
  12419. APPLICATION_REF_ALREADY_DESTROYED = 406,
  12420. RENDERER_NOT_FOUND = 407,
  12421. PROVIDED_BOTH_ZONE_AND_ZONELESS = 408,
  12422. HYDRATION_NODE_MISMATCH = -500,
  12423. HYDRATION_MISSING_SIBLINGS = -501,
  12424. HYDRATION_MISSING_NODE = -502,
  12425. UNSUPPORTED_PROJECTION_DOM_NODES = -503,
  12426. INVALID_SKIP_HYDRATION_HOST = -504,
  12427. MISSING_HYDRATION_ANNOTATIONS = -505,
  12428. HYDRATION_STABLE_TIMEDOUT = -506,
  12429. MISSING_SSR_CONTENT_INTEGRITY_MARKER = -507,
  12430. MISCONFIGURED_INCREMENTAL_HYDRATION = 508,
  12431. SIGNAL_WRITE_FROM_ILLEGAL_CONTEXT = 600,
  12432. REQUIRE_SYNC_WITHOUT_SYNC_EMIT = 601,
  12433. ASSERTION_NOT_INSIDE_REACTIVE_CONTEXT = -602,
  12434. INVALID_I18N_STRUCTURE = 700,
  12435. MISSING_LOCALE_DATA = 701,
  12436. DEFER_LOADING_FAILED = -750,
  12437. DEFER_IN_HMR_MODE = -751,
  12438. IMPORT_PROVIDERS_FROM_STANDALONE = 800,
  12439. INVALID_DIFFER_INPUT = 900,
  12440. NO_SUPPORTING_DIFFER_FACTORY = 901,
  12441. VIEW_ALREADY_ATTACHED = 902,
  12442. INVALID_INHERITANCE = 903,
  12443. UNSAFE_VALUE_IN_RESOURCE_URL = 904,
  12444. UNSAFE_VALUE_IN_SCRIPT = 905,
  12445. MISSING_GENERATED_DEF = 906,
  12446. TYPE_IS_NOT_STANDALONE = 907,
  12447. MISSING_ZONEJS = 908,
  12448. UNEXPECTED_ZONE_STATE = 909,
  12449. UNSAFE_IFRAME_ATTRS = -910,
  12450. VIEW_ALREADY_DESTROYED = 911,
  12451. COMPONENT_ID_COLLISION = -912,
  12452. IMAGE_PERFORMANCE_WARNING = -913,
  12453. UNEXPECTED_ZONEJS_PRESENT_IN_ZONELESS_MODE = 914,
  12454. REQUIRED_INPUT_NO_VALUE = -950,
  12455. REQUIRED_QUERY_NO_VALUE = -951,
  12456. REQUIRED_MODEL_NO_VALUE = 952,
  12457. OUTPUT_REF_DESTROYED = 953,
  12458. LOOP_TRACK_DUPLICATE_KEYS = -955,
  12459. LOOP_TRACK_RECREATE = -956,
  12460. RUNTIME_DEPS_INVALID_IMPORTED_TYPE = 980,
  12461. RUNTIME_DEPS_ORPHAN_COMPONENT = 981
  12462. }
  12463. /**
  12464. * Class that represents a runtime error.
  12465. * Formats and outputs the error message in a consistent way.
  12466. *
  12467. * Example:
  12468. * ```ts
  12469. * throw new RuntimeError(
  12470. * RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED,
  12471. * ngDevMode && 'Injector has already been destroyed.');
  12472. * ```
  12473. *
  12474. * Note: the `message` argument contains a descriptive error message as a string in development
  12475. * mode (when the `ngDevMode` is defined). In production mode (after tree-shaking pass), the
  12476. * `message` argument becomes `false`, thus we account for it in the typings and the runtime
  12477. * logic.
  12478. */
  12479. declare class RuntimeError<T extends number = RuntimeErrorCode> extends Error {
  12480. code: T;
  12481. constructor(code: T, message: null | false | string);
  12482. }
  12483. /**
  12484. * Called to format a runtime error.
  12485. * See additional info on the `message` argument type in the `RuntimeError` class description.
  12486. */
  12487. declare function formatRuntimeError<T extends number = RuntimeErrorCode>(code: T, message: null | false | string): string;
  12488. /**
  12489. * A type-safe key to use with `TransferState`.
  12490. *
  12491. * Example:
  12492. *
  12493. * ```ts
  12494. * const COUNTER_KEY = makeStateKey<number>('counter');
  12495. * let value = 10;
  12496. *
  12497. * transferState.set(COUNTER_KEY, value);
  12498. * ```
  12499. *
  12500. * @publicApi
  12501. */
  12502. type StateKey<T> = string & {
  12503. __not_a_string: never;
  12504. __value_type?: T;
  12505. };
  12506. /**
  12507. * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
  12508. *
  12509. * Example:
  12510. *
  12511. * ```ts
  12512. * const COUNTER_KEY = makeStateKey<number>('counter');
  12513. * let value = 10;
  12514. *
  12515. * transferState.set(COUNTER_KEY, value);
  12516. * ```
  12517. *
  12518. * @publicApi
  12519. */
  12520. declare function makeStateKey<T = void>(key: string): StateKey<T>;
  12521. /**
  12522. * A key value store that is transferred from the application on the server side to the application
  12523. * on the client side.
  12524. *
  12525. * The `TransferState` is available as an injectable token.
  12526. * On the client, just inject this token using DI and use it, it will be lazily initialized.
  12527. * On the server it's already included if `renderApplication` function is used. Otherwise, import
  12528. * the `ServerTransferStateModule` module to make the `TransferState` available.
  12529. *
  12530. * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
  12531. * boolean, number, string, null and non-class objects will be serialized and deserialized in a
  12532. * non-lossy manner.
  12533. *
  12534. * @publicApi
  12535. */
  12536. declare class TransferState {
  12537. /** @nocollapse */
  12538. static ɵprov: unknown;
  12539. private onSerializeCallbacks;
  12540. /**
  12541. * Get the value corresponding to a key. Return `defaultValue` if key is not found.
  12542. */
  12543. get<T>(key: StateKey<T>, defaultValue: T): T;
  12544. /**
  12545. * Set the value corresponding to a key.
  12546. */
  12547. set<T>(key: StateKey<T>, value: T): void;
  12548. /**
  12549. * Remove a key from the store.
  12550. */
  12551. remove<T>(key: StateKey<T>): void;
  12552. /**
  12553. * Test whether a key exists in the store.
  12554. */
  12555. hasKey<T>(key: StateKey<T>): boolean;
  12556. /**
  12557. * Indicates whether the state is empty.
  12558. */
  12559. get isEmpty(): boolean;
  12560. /**
  12561. * Register a callback to provide the value for a key when `toJson` is called.
  12562. */
  12563. onSerialize<T>(key: StateKey<T>, callback: () => T): void;
  12564. /**
  12565. * Serialize the current state of the store to JSON.
  12566. */
  12567. toJson(): string;
  12568. }
  12569. /**
  12570. * Marker used in a comment node to ensure hydration content integrity
  12571. */
  12572. declare const SSR_CONTENT_INTEGRITY_MARKER = "nghm";
  12573. /**
  12574. * Internal type that represents a claimed node.
  12575. * Only used in dev mode.
  12576. */
  12577. declare enum HydrationStatus {
  12578. Hydrated = "hydrated",
  12579. Skipped = "skipped",
  12580. Mismatched = "mismatched"
  12581. }
  12582. type HydrationInfo = {
  12583. status: HydrationStatus.Hydrated | HydrationStatus.Skipped;
  12584. } | {
  12585. status: HydrationStatus.Mismatched;
  12586. actualNodeDetails: string | null;
  12587. expectedNodeDetails: string | null;
  12588. };
  12589. declare const HYDRATION_INFO_KEY = "__ngDebugHydrationInfo__";
  12590. type HydratedNode = {
  12591. [HYDRATION_INFO_KEY]?: HydrationInfo;
  12592. };
  12593. declare function readHydrationInfo(node: RNode): HydrationInfo | null;
  12594. /**
  12595. * Annotates all components bootstrapped in a given ApplicationRef
  12596. * with info needed for hydration.
  12597. *
  12598. * @param appRef An instance of an ApplicationRef.
  12599. * @param doc A reference to the current Document instance.
  12600. * @return event types that need to be replayed
  12601. */
  12602. declare function annotateForHydration(appRef: ApplicationRef, doc: Document): {
  12603. regular: Set<string>;
  12604. capture: Set<string>;
  12605. };
  12606. /**
  12607. * Defines a name of an attribute that is added to the <body> tag
  12608. * in the `index.html` file in case a given route was configured
  12609. * with `RenderMode.Client`. 'cm' is an abbreviation for "Client Mode".
  12610. */
  12611. declare const CLIENT_RENDER_MODE_FLAG = "ngcm";
  12612. /**
  12613. * Returns a set of providers required to setup hydration support
  12614. * for an application that is server side rendered. This function is
  12615. * included into the `provideClientHydration` public API function from
  12616. * the `platform-browser` package.
  12617. *
  12618. * The function sets up an internal flag that would be recognized during
  12619. * the server side rendering time as well, so there is no need to
  12620. * configure or change anything in NgUniversal to enable the feature.
  12621. */
  12622. declare function withDomHydration(): EnvironmentProviders;
  12623. /**
  12624. * Returns a set of providers required to setup support for i18n hydration.
  12625. * Requires hydration to be enabled separately.
  12626. */
  12627. declare function withI18nSupport(): Provider[];
  12628. /**
  12629. * Returns a set of providers required to setup support for incremental hydration.
  12630. * Requires hydration to be enabled separately.
  12631. * Enabling incremental hydration also enables event replay for the entire app.
  12632. *
  12633. * @developerPreview
  12634. */
  12635. declare function withIncrementalHydration(): Provider[];
  12636. /**
  12637. * Returns a set of providers required to setup support for event replay.
  12638. * Requires hydration to be enabled separately.
  12639. */
  12640. declare function withEventReplay(): Provider[];
  12641. declare global {
  12642. interface Element {
  12643. __jsaction_fns: Map<string, Function[]> | undefined;
  12644. }
  12645. }
  12646. interface EventContractDetails {
  12647. instance?: EventContract;
  12648. }
  12649. declare const JSACTION_EVENT_CONTRACT: InjectionToken<EventContractDetails>;
  12650. /**
  12651. * Internal token that specifies whether DOM reuse logic
  12652. * during hydration is enabled.
  12653. */
  12654. declare const IS_HYDRATION_DOM_REUSE_ENABLED: InjectionToken<boolean>;
  12655. /**
  12656. * Internal token that indicates whether incremental hydration support
  12657. * is enabled.
  12658. */
  12659. declare const IS_INCREMENTAL_HYDRATION_ENABLED: InjectionToken<boolean>;
  12660. /**
  12661. * A map of DOM elements with `jsaction` attributes grouped by action names.
  12662. */
  12663. declare const JSACTION_BLOCK_ELEMENT_MAP: InjectionToken<Map<string, Set<Element>>>;
  12664. /**
  12665. * Register locale data to be used internally by Angular. See the
  12666. * ["I18n guide"](guide/i18n/format-data-locale) to know how to import additional locale
  12667. * data.
  12668. *
  12669. * The signature `registerLocaleData(data: any, extraData?: any)` is deprecated since v5.1
  12670. */
  12671. declare function registerLocaleData(data: any, localeId?: string | any, extraData?: any): void;
  12672. /**
  12673. * Finds the locale data for a given locale.
  12674. *
  12675. * @param locale The locale code.
  12676. * @returns The locale data.
  12677. * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
  12678. */
  12679. declare function findLocaleData(locale: string): any;
  12680. /**
  12681. * Retrieves the default currency code for the given locale.
  12682. *
  12683. * The default is defined as the first currency which is still in use.
  12684. *
  12685. * @param locale The code of the locale whose currency code we want.
  12686. * @returns The code of the default currency for the given locale.
  12687. *
  12688. */
  12689. declare function getLocaleCurrencyCode(locale: string): string | null;
  12690. /**
  12691. * Retrieves the plural function used by ICU expressions to determine the plural case to use
  12692. * for a given locale.
  12693. * @param locale A locale code for the locale format rules to use.
  12694. * @returns The plural function for the locale.
  12695. * @see {@link NgPlural}
  12696. * @see [Internationalization (i18n) Guide](guide/i18n)
  12697. */
  12698. declare function getLocalePluralCase(locale: string): (value: number) => number;
  12699. /**
  12700. * Helper function to remove all the locale data from `LOCALE_DATA`.
  12701. */
  12702. declare function unregisterAllLocaleData(): void;
  12703. /**
  12704. * Index of each type of locale data from the locale data array
  12705. */
  12706. declare enum LocaleDataIndex {
  12707. LocaleId = 0,
  12708. DayPeriodsFormat = 1,
  12709. DayPeriodsStandalone = 2,
  12710. DaysFormat = 3,
  12711. DaysStandalone = 4,
  12712. MonthsFormat = 5,
  12713. MonthsStandalone = 6,
  12714. Eras = 7,
  12715. FirstDayOfWeek = 8,
  12716. WeekendRange = 9,
  12717. DateFormat = 10,
  12718. TimeFormat = 11,
  12719. DateTimeFormat = 12,
  12720. NumberSymbols = 13,
  12721. NumberFormats = 14,
  12722. CurrencyCode = 15,
  12723. CurrencySymbol = 16,
  12724. CurrencyName = 17,
  12725. Currencies = 18,
  12726. Directionality = 19,
  12727. PluralCase = 20,
  12728. ExtraData = 21
  12729. }
  12730. /**
  12731. * Index of each type of locale data from the extra locale data array
  12732. */
  12733. declare const enum ExtraLocaleDataIndex {
  12734. ExtraDayPeriodFormats = 0,
  12735. ExtraDayPeriodStandalone = 1,
  12736. ExtraDayPeriodsRules = 2
  12737. }
  12738. /**
  12739. * Index of each value in currency data (used to describe CURRENCIES_EN in currencies.ts)
  12740. */
  12741. declare const enum CurrencyIndex {
  12742. Symbol = 0,
  12743. SymbolNarrow = 1,
  12744. NbOfDigits = 2
  12745. }
  12746. /**
  12747. * The locale id that the application is using by default (for translations and ICU expressions).
  12748. */
  12749. declare const DEFAULT_LOCALE_ID = "en-US";
  12750. /**
  12751. * Used to resolve resource URLs on `@Component` when used with JIT compilation.
  12752. *
  12753. * Example:
  12754. * ```ts
  12755. * @Component({
  12756. * selector: 'my-comp',
  12757. * templateUrl: 'my-comp.html', // This requires asynchronous resolution
  12758. * })
  12759. * class MyComponent{
  12760. * }
  12761. *
  12762. * // Calling `renderComponent` will fail because `renderComponent` is a synchronous process
  12763. * // and `MyComponent`'s `@Component.templateUrl` needs to be resolved asynchronously.
  12764. *
  12765. * // Calling `resolveComponentResources()` will resolve `@Component.templateUrl` into
  12766. * // `@Component.template`, which allows `renderComponent` to proceed in a synchronous manner.
  12767. *
  12768. * // Use browser's `fetch()` function as the default resource resolution strategy.
  12769. * resolveComponentResources(fetch).then(() => {
  12770. * // After resolution all URLs have been converted into `template` strings.
  12771. * renderComponent(MyComponent);
  12772. * });
  12773. *
  12774. * ```
  12775. *
  12776. * NOTE: In AOT the resolution happens during compilation, and so there should be no need
  12777. * to call this method outside JIT mode.
  12778. *
  12779. * @param resourceResolver a function which is responsible for returning a `Promise` to the
  12780. * contents of the resolved URL. Browser's `fetch()` method is a good default implementation.
  12781. */
  12782. declare function resolveComponentResources(resourceResolver: (url: string) => Promise<string | {
  12783. text(): Promise<string>;
  12784. }>): Promise<void>;
  12785. declare function isComponentDefPendingResolution(type: Type$1<any>): boolean;
  12786. declare function clearResolutionOfComponentResourcesQueue(): Map<Type$1<any>, Component>;
  12787. declare function restoreComponentResolutionQueue(queue: Map<Type$1<any>, Component>): void;
  12788. /**
  12789. * InjectionToken to control root component bootstrap behavior.
  12790. *
  12791. * This token is primarily used in Angular's server-side rendering (SSR) scenarios,
  12792. * particularly by the `@angular/ssr` package, to manage whether the root component
  12793. * should be bootstrapped during the application initialization process.
  12794. *
  12795. * ## Purpose:
  12796. * During SSR route extraction, setting this token to `false` prevents Angular from
  12797. * bootstrapping the root component. This avoids unnecessary component rendering,
  12798. * enabling route extraction without requiring additional APIs or triggering
  12799. * component logic.
  12800. *
  12801. * ## Behavior:
  12802. * - **`false`**: Prevents the root component from being bootstrapped.
  12803. * - **`true`** (default): Proceeds with the normal root component bootstrap process.
  12804. *
  12805. * This mechanism ensures SSR can efficiently separate route extraction logic
  12806. * from component rendering.
  12807. */
  12808. declare const ENABLE_ROOT_COMPONENT_BOOTSTRAP: InjectionToken<boolean>;
  12809. interface PlatformReflectionCapabilities {
  12810. factory(type: Type$1<any>): Function;
  12811. hasLifecycleHook(type: any, lcProperty: string): boolean;
  12812. /**
  12813. * Return a list of annotations/types for constructor parameters
  12814. */
  12815. parameters(type: Type$1<any>): any[][];
  12816. /**
  12817. * Return a list of annotations declared on the class
  12818. */
  12819. annotations(type: Type$1<any>): any[];
  12820. /**
  12821. * Return a object literal which describes the annotations on Class fields/properties.
  12822. */
  12823. propMetadata(typeOrFunc: Type$1<any>): {
  12824. [key: string]: any[];
  12825. };
  12826. }
  12827. declare class ReflectionCapabilities implements PlatformReflectionCapabilities {
  12828. private _reflect;
  12829. constructor(reflect?: any);
  12830. factory<T>(t: Type$1<T>): (args: any[]) => T;
  12831. private _ownParameters;
  12832. parameters(type: Type$1<any>): any[][];
  12833. private _ownAnnotations;
  12834. annotations(typeOrFunc: Type$1<any>): any[];
  12835. private _ownPropMetadata;
  12836. propMetadata(typeOrFunc: any): {
  12837. [key: string]: any[];
  12838. };
  12839. ownPropMetadata(typeOrFunc: any): {
  12840. [key: string]: any[];
  12841. };
  12842. hasLifecycleHook(type: any, lcProperty: string): boolean;
  12843. }
  12844. /**
  12845. * An object that defines an injection context for the injector profiler.
  12846. */
  12847. interface InjectorProfilerContext {
  12848. /**
  12849. * The Injector that service is being injected into.
  12850. * - Example: if ModuleA --provides--> ServiceA --injects--> ServiceB
  12851. * then inject(ServiceB) in ServiceA has ModuleA as an injector context
  12852. */
  12853. injector: Injector;
  12854. /**
  12855. * The class where the constructor that is calling `inject` is located
  12856. * - Example: if ModuleA --provides--> ServiceA --injects--> ServiceB
  12857. * then inject(ServiceB) in ServiceA has ServiceA as a construction context
  12858. */
  12859. token: Type$1<unknown> | null;
  12860. }
  12861. /**
  12862. * An object that contains information about a provider that has been configured
  12863. *
  12864. * TODO: rename to indicate that it is a debug structure eg. ProviderDebugInfo.
  12865. */
  12866. interface ProviderRecord {
  12867. /**
  12868. * DI token that this provider is configuring
  12869. */
  12870. token: Type$1<unknown> | InjectionToken<unknown>;
  12871. /**
  12872. * Determines if provider is configured as view provider.
  12873. */
  12874. isViewProvider: boolean;
  12875. /**
  12876. * The raw provider associated with this ProviderRecord.
  12877. */
  12878. provider: SingleProvider;
  12879. /**
  12880. * The path of DI containers that were followed to import this provider
  12881. */
  12882. importPath?: Type$1<unknown>[];
  12883. }
  12884. /**
  12885. * An object that contains information a service that has been injected within an
  12886. * InjectorProfilerContext
  12887. */
  12888. interface InjectedService {
  12889. /**
  12890. * DI token of the Service that is injected
  12891. */
  12892. token?: Type$1<unknown> | InjectionToken<unknown>;
  12893. /**
  12894. * Value of the injected service
  12895. */
  12896. value: unknown;
  12897. /**
  12898. * Flags that this service was injected with
  12899. */
  12900. flags?: InternalInjectFlags | InjectFlags | InjectOptions;
  12901. /**
  12902. * Injector that this service was provided in.
  12903. */
  12904. providedIn?: Injector;
  12905. /**
  12906. * In NodeInjectors, the LView and TNode that serviced this injection.
  12907. */
  12908. injectedIn?: {
  12909. lView: LView;
  12910. tNode: TNode;
  12911. };
  12912. }
  12913. declare function setInjectorProfilerContext(context: InjectorProfilerContext): InjectorProfilerContext;
  12914. declare const enum BypassType {
  12915. Url = "URL",
  12916. Html = "HTML",
  12917. ResourceUrl = "ResourceURL",
  12918. Script = "Script",
  12919. Style = "Style"
  12920. }
  12921. /**
  12922. * Marker interface for a value that's safe to use in a particular context.
  12923. *
  12924. * @publicApi
  12925. */
  12926. interface SafeValue {
  12927. }
  12928. /**
  12929. * Marker interface for a value that's safe to use as HTML.
  12930. *
  12931. * @publicApi
  12932. */
  12933. interface SafeHtml extends SafeValue {
  12934. }
  12935. /**
  12936. * Marker interface for a value that's safe to use as style (CSS).
  12937. *
  12938. * @publicApi
  12939. */
  12940. interface SafeStyle extends SafeValue {
  12941. }
  12942. /**
  12943. * Marker interface for a value that's safe to use as JavaScript.
  12944. *
  12945. * @publicApi
  12946. */
  12947. interface SafeScript extends SafeValue {
  12948. }
  12949. /**
  12950. * Marker interface for a value that's safe to use as a URL linking to a document.
  12951. *
  12952. * @publicApi
  12953. */
  12954. interface SafeUrl extends SafeValue {
  12955. }
  12956. /**
  12957. * Marker interface for a value that's safe to use as a URL to load executable code from.
  12958. *
  12959. * @publicApi
  12960. */
  12961. interface SafeResourceUrl extends SafeValue {
  12962. }
  12963. declare function unwrapSafeValue(value: SafeValue): string;
  12964. declare function unwrapSafeValue<T>(value: T): T;
  12965. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Html): value is SafeHtml;
  12966. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.ResourceUrl): value is SafeResourceUrl;
  12967. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Script): value is SafeScript;
  12968. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Style): value is SafeStyle;
  12969. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Url): value is SafeUrl;
  12970. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType): boolean;
  12971. declare function getSanitizationBypassType(value: any): BypassType | null;
  12972. /**
  12973. * Mark `html` string as trusted.
  12974. *
  12975. * This function wraps the trusted string in `String` and brands it in a way which makes it
  12976. * recognizable to {@link htmlSanitizer} to be trusted implicitly.
  12977. *
  12978. * @param trustedHtml `html` string which needs to be implicitly trusted.
  12979. * @returns a `html` which has been branded to be implicitly trusted.
  12980. */
  12981. declare function bypassSanitizationTrustHtml(trustedHtml: string): SafeHtml;
  12982. /**
  12983. * Mark `style` string as trusted.
  12984. *
  12985. * This function wraps the trusted string in `String` and brands it in a way which makes it
  12986. * recognizable to {@link styleSanitizer} to be trusted implicitly.
  12987. *
  12988. * @param trustedStyle `style` string which needs to be implicitly trusted.
  12989. * @returns a `style` hich has been branded to be implicitly trusted.
  12990. */
  12991. declare function bypassSanitizationTrustStyle(trustedStyle: string): SafeStyle;
  12992. /**
  12993. * Mark `script` string as trusted.
  12994. *
  12995. * This function wraps the trusted string in `String` and brands it in a way which makes it
  12996. * recognizable to {@link scriptSanitizer} to be trusted implicitly.
  12997. *
  12998. * @param trustedScript `script` string which needs to be implicitly trusted.
  12999. * @returns a `script` which has been branded to be implicitly trusted.
  13000. */
  13001. declare function bypassSanitizationTrustScript(trustedScript: string): SafeScript;
  13002. /**
  13003. * Mark `url` string as trusted.
  13004. *
  13005. * This function wraps the trusted string in `String` and brands it in a way which makes it
  13006. * recognizable to {@link urlSanitizer} to be trusted implicitly.
  13007. *
  13008. * @param trustedUrl `url` string which needs to be implicitly trusted.
  13009. * @returns a `url` which has been branded to be implicitly trusted.
  13010. */
  13011. declare function bypassSanitizationTrustUrl(trustedUrl: string): SafeUrl;
  13012. /**
  13013. * Mark `url` string as trusted.
  13014. *
  13015. * This function wraps the trusted string in `String` and brands it in a way which makes it
  13016. * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.
  13017. *
  13018. * @param trustedResourceUrl `url` string which needs to be implicitly trusted.
  13019. * @returns a `url` which has been branded to be implicitly trusted.
  13020. */
  13021. declare function bypassSanitizationTrustResourceUrl(trustedResourceUrl: string): SafeResourceUrl;
  13022. /**
  13023. * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to
  13024. * the DOM in a browser environment.
  13025. */
  13026. declare function _sanitizeHtml(defaultDoc: any, unsafeHtmlInput: string): TrustedHTML | string;
  13027. declare function _sanitizeUrl(url: string): string;
  13028. /**
  13029. * Transforms a value (typically a string) to a boolean.
  13030. * Intended to be used as a transform function of an input.
  13031. *
  13032. * @usageNotes
  13033. * ```ts
  13034. * @Input({ transform: booleanAttribute }) status!: boolean;
  13035. * ```
  13036. * @param value Value to be transformed.
  13037. *
  13038. * @publicApi
  13039. */
  13040. declare function booleanAttribute(value: unknown): boolean;
  13041. /**
  13042. * Transforms a value (typically a string) to a number.
  13043. * Intended to be used as a transform function of an input.
  13044. * @param value Value to be transformed.
  13045. * @param fallbackValue Value to use if the provided value can't be parsed as a number.
  13046. *
  13047. * @usageNotes
  13048. * ```ts
  13049. * @Input({ transform: numberAttribute }) id!: number;
  13050. * ```
  13051. *
  13052. * @publicApi
  13053. */
  13054. declare function numberAttribute(value: unknown, fallbackValue?: number): number;
  13055. declare const _global: any;
  13056. /**
  13057. * Determine if the argument is shaped like a Promise
  13058. */
  13059. declare function isPromise<T = any>(obj: any): obj is Promise<T>;
  13060. /**
  13061. * Determine if the argument is a Subscribable
  13062. */
  13063. declare function isSubscribable<T>(obj: any | Subscribable<T>): obj is Subscribable<T>;
  13064. /**
  13065. * A guarded `performance.mark` for feature marking.
  13066. *
  13067. * This method exists because while all supported browser and node.js version supported by Angular
  13068. * support performance.mark API. This is not the case for other environments such as JSDOM and
  13069. * Cloudflare workers.
  13070. */
  13071. declare function performanceMarkFeature(feature: string): void;
  13072. declare function stringify(token: any): string;
  13073. /**
  13074. * Ellipses the string in the middle when longer than the max length
  13075. *
  13076. * @param string
  13077. * @param maxLength of the output string
  13078. * @returns ellipsed string with ... in the middle
  13079. */
  13080. declare function truncateMiddle(str: string, maxLength?: number): string;
  13081. declare const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR: {};
  13082. declare const PERFORMANCE_MARK_PREFIX = "\uD83C\uDD70\uFE0F";
  13083. /**
  13084. * Function that will start measuring against the performance API
  13085. * Should be used in pair with stopMeasuring
  13086. */
  13087. declare function startMeasuring<T>(label: string): void;
  13088. /**
  13089. * Function that will stop measuring against the performance API
  13090. * Should be used in pair with stopMeasuring
  13091. */
  13092. declare function stopMeasuring(label: string): void;
  13093. /**
  13094. * This enables an internal performance profiler
  13095. *
  13096. * It should not be imported in application code
  13097. */
  13098. declare function enableProfiling(): void;
  13099. declare function disableProfiling(): void;
  13100. /**
  13101. * Status of a `Resource`.
  13102. *
  13103. * @experimental
  13104. */
  13105. declare enum ResourceStatus {
  13106. /**
  13107. * The resource has no valid request and will not perform any loading.
  13108. *
  13109. * `value()` will be `undefined`.
  13110. */
  13111. Idle = 0,
  13112. /**
  13113. * Loading failed with an error.
  13114. *
  13115. * `value()` will be `undefined`.
  13116. */
  13117. Error = 1,
  13118. /**
  13119. * The resource is currently loading a new value as a result of a change in its `request`.
  13120. *
  13121. * `value()` will be `undefined`.
  13122. */
  13123. Loading = 2,
  13124. /**
  13125. * The resource is currently reloading a fresh value for the same request.
  13126. *
  13127. * `value()` will continue to return the previously fetched value during the reloading operation.
  13128. */
  13129. Reloading = 3,
  13130. /**
  13131. * Loading has completed and the resource has the value returned from the loader.
  13132. */
  13133. Resolved = 4,
  13134. /**
  13135. * The resource's value was set locally via `.set()` or `.update()`.
  13136. */
  13137. Local = 5
  13138. }
  13139. /**
  13140. * A Resource is an asynchronous dependency (for example, the results of an API call) that is
  13141. * managed and delivered through signals.
  13142. *
  13143. * The usual way of creating a `Resource` is through the `resource` function, but various other APIs
  13144. * may present `Resource` instances to describe their own concepts.
  13145. *
  13146. * @experimental
  13147. */
  13148. interface Resource<T> {
  13149. /**
  13150. * The current value of the `Resource`, or `undefined` if there is no current value.
  13151. */
  13152. readonly value: Signal<T>;
  13153. /**
  13154. * The current status of the `Resource`, which describes what the resource is currently doing and
  13155. * what can be expected of its `value`.
  13156. */
  13157. readonly status: Signal<ResourceStatus>;
  13158. /**
  13159. * When in the `error` state, this returns the last known error from the `Resource`.
  13160. */
  13161. readonly error: Signal<unknown>;
  13162. /**
  13163. * Whether this resource is loading a new value (or reloading the existing one).
  13164. */
  13165. readonly isLoading: Signal<boolean>;
  13166. /**
  13167. * Whether this resource has a valid current value.
  13168. *
  13169. * This function is reactive.
  13170. */
  13171. hasValue(): this is Resource<Exclude<T, undefined>>;
  13172. /**
  13173. * Instructs the resource to re-load any asynchronous dependency it may have.
  13174. *
  13175. * Note that the resource will not enter its reloading state until the actual backend request is
  13176. * made.
  13177. *
  13178. * @returns true if a reload was initiated, false if a reload was unnecessary or unsupported
  13179. */
  13180. reload(): boolean;
  13181. }
  13182. /**
  13183. * A `Resource` with a mutable value.
  13184. *
  13185. * Overwriting the value of a resource sets it to the 'local' state.
  13186. *
  13187. * @experimental
  13188. */
  13189. interface WritableResource<T> extends Resource<T> {
  13190. readonly value: WritableSignal<T>;
  13191. hasValue(): this is WritableResource<Exclude<T, undefined>>;
  13192. /**
  13193. * Convenience wrapper for `value.set`.
  13194. */
  13195. set(value: T): void;
  13196. /**
  13197. * Convenience wrapper for `value.update`.
  13198. */
  13199. update(updater: (value: T) => T): void;
  13200. asReadonly(): Resource<T>;
  13201. }
  13202. /**
  13203. * A `WritableResource` created through the `resource` function.
  13204. *
  13205. * @experimental
  13206. */
  13207. interface ResourceRef<T> extends WritableResource<T> {
  13208. hasValue(): this is ResourceRef<Exclude<T, undefined>>;
  13209. /**
  13210. * Manually destroy the resource, which cancels pending requests and returns it to `idle` state.
  13211. */
  13212. destroy(): void;
  13213. }
  13214. /**
  13215. * Parameter to a `ResourceLoader` which gives the request and other options for the current loading
  13216. * operation.
  13217. *
  13218. * @experimental
  13219. */
  13220. interface ResourceLoaderParams<R> {
  13221. request: Exclude<NoInfer<R>, undefined>;
  13222. abortSignal: AbortSignal;
  13223. previous: {
  13224. status: ResourceStatus;
  13225. };
  13226. }
  13227. /**
  13228. * Loading function for a `Resource`.
  13229. *
  13230. * @experimental
  13231. */
  13232. type ResourceLoader<T, R> = (param: ResourceLoaderParams<R>) => PromiseLike<T>;
  13233. /**
  13234. * Streaming loader for a `Resource`.
  13235. *
  13236. * @experimental
  13237. */
  13238. type ResourceStreamingLoader<T, R> = (param: ResourceLoaderParams<R>) => PromiseLike<Signal<ResourceStreamItem<T>>>;
  13239. /**
  13240. * Options to the `resource` function, for creating a resource.
  13241. *
  13242. * @experimental
  13243. */
  13244. interface BaseResourceOptions<T, R> {
  13245. /**
  13246. * A reactive function which determines the request to be made. Whenever the request changes, the
  13247. * loader will be triggered to fetch a new value for the resource.
  13248. *
  13249. * If a request function isn't provided, the loader won't rerun unless the resource is reloaded.
  13250. */
  13251. request?: () => R;
  13252. /**
  13253. * The value which will be returned from the resource when a server value is unavailable, such as
  13254. * when the resource is still loading, or in an error state.
  13255. */
  13256. defaultValue?: NoInfer<T>;
  13257. /**
  13258. * Equality function used to compare the return value of the loader.
  13259. */
  13260. equal?: ValueEqualityFn<T>;
  13261. /**
  13262. * Overrides the `Injector` used by `resource`.
  13263. */
  13264. injector?: Injector;
  13265. }
  13266. /**
  13267. * Options to the `resource` function, for creating a resource.
  13268. *
  13269. * @experimental
  13270. */
  13271. interface PromiseResourceOptions<T, R> extends BaseResourceOptions<T, R> {
  13272. /**
  13273. * Loading function which returns a `Promise` of the resource's value for a given request.
  13274. */
  13275. loader: ResourceLoader<T, R>;
  13276. /**
  13277. * Cannot specify `stream` and `loader` at the same time.
  13278. */
  13279. stream?: never;
  13280. }
  13281. /**
  13282. * Options to the `resource` function, for creating a resource.
  13283. *
  13284. * @experimental
  13285. */
  13286. interface StreamingResourceOptions<T, R> extends BaseResourceOptions<T, R> {
  13287. /**
  13288. * Loading function which returns a `Promise` of a signal of the resource's value for a given
  13289. * request, which can change over time as new values are received from a stream.
  13290. */
  13291. stream: ResourceStreamingLoader<T, R>;
  13292. /**
  13293. * Cannot specify `stream` and `loader` at the same time.
  13294. */
  13295. loader?: never;
  13296. }
  13297. /**
  13298. * @experimental
  13299. */
  13300. type ResourceOptions<T, R> = PromiseResourceOptions<T, R> | StreamingResourceOptions<T, R>;
  13301. /**
  13302. * @experimental
  13303. */
  13304. type ResourceStreamItem<T> = {
  13305. value: T;
  13306. } | {
  13307. error: unknown;
  13308. };
  13309. /**
  13310. * Constructs a `Resource` that projects a reactive request to an asynchronous operation defined by
  13311. * a loader function, which exposes the result of the loading operation via signals.
  13312. *
  13313. * Note that `resource` is intended for _read_ operations, not operations which perform mutations.
  13314. * `resource` will cancel in-progress loads via the `AbortSignal` when destroyed or when a new
  13315. * request object becomes available, which could prematurely abort mutations.
  13316. *
  13317. * @experimental
  13318. */
  13319. declare function resource<T, R>(options: ResourceOptions<T, R> & {
  13320. defaultValue: NoInfer<T>;
  13321. }): ResourceRef<T>;
  13322. /**
  13323. * Constructs a `Resource` that projects a reactive request to an asynchronous operation defined by
  13324. * a loader function, which exposes the result of the loading operation via signals.
  13325. *
  13326. * Note that `resource` is intended for _read_ operations, not operations which perform mutations.
  13327. * `resource` will cancel in-progress loads via the `AbortSignal` when destroyed or when a new
  13328. * request object becomes available, which could prematurely abort mutations.
  13329. *
  13330. * @experimental
  13331. */
  13332. declare function resource<T, R>(options: ResourceOptions<T, R>): ResourceRef<T | undefined>;
  13333. type WrappedRequest = {
  13334. request: unknown;
  13335. reload: number;
  13336. };
  13337. /**
  13338. * Base class which implements `.value` as a `WritableSignal` by delegating `.set` and `.update`.
  13339. */
  13340. declare abstract class BaseWritableResource<T> implements WritableResource<T> {
  13341. readonly value: WritableSignal<T>;
  13342. abstract readonly status: Signal<ResourceStatus>;
  13343. abstract readonly error: Signal<unknown>;
  13344. abstract reload(): boolean;
  13345. constructor(value: Signal<T>);
  13346. abstract set(value: T): void;
  13347. update(updateFn: (value: T) => T): void;
  13348. readonly isLoading: Signal<boolean>;
  13349. hasValue(): this is ResourceRef<Exclude<T, undefined>>;
  13350. asReadonly(): Resource<T>;
  13351. }
  13352. /**
  13353. * Implementation for `resource()` which uses a `linkedSignal` to manage the resource's state.
  13354. */
  13355. declare class ResourceImpl<T, R> extends BaseWritableResource<T> implements ResourceRef<T> {
  13356. private readonly loaderFn;
  13357. private readonly defaultValue;
  13358. private readonly equal;
  13359. private readonly pendingTasks;
  13360. /**
  13361. * The current state of the resource. Status, value, and error are derived from this.
  13362. */
  13363. private readonly state;
  13364. /**
  13365. * Combines the current request with a reload counter which allows the resource to be reloaded on
  13366. * imperative command.
  13367. */
  13368. protected readonly extRequest: WritableSignal<WrappedRequest>;
  13369. private readonly effectRef;
  13370. private pendingController;
  13371. private resolvePendingTask;
  13372. private destroyed;
  13373. constructor(request: () => R, loaderFn: ResourceStreamingLoader<T, R>, defaultValue: T, equal: ValueEqualityFn$1<T> | undefined, injector: Injector);
  13374. readonly status: Signal<ResourceStatus>;
  13375. readonly error: Signal<unknown>;
  13376. /**
  13377. * Called either directly via `WritableResource.set` or via `.value.set()`.
  13378. */
  13379. set(value: T): void;
  13380. reload(): boolean;
  13381. destroy(): void;
  13382. private loadEffect;
  13383. private abortInProgressLoad;
  13384. }
  13385. /*!
  13386. * @license
  13387. * Copyright Google LLC All Rights Reserved.
  13388. *
  13389. * Use of this source code is governed by an MIT-style license that can be
  13390. * found in the LICENSE file at https://angular.dev/license
  13391. */
  13392. /**
  13393. * Gets the class name of the closest component to a node.
  13394. * Warning! this function will return minified names if the name of the component is minified. The
  13395. * consumer of the function is responsible for resolving the minified name to its original name.
  13396. * @param node Node from which to start the search.
  13397. */
  13398. declare function getClosestComponentName(node: Node): string | null;
  13399. /**
  13400. * The following getter methods retrieve the definition from the type. Currently the retrieval
  13401. * honors inheritance, but in the future we may change the rule to require that definitions are
  13402. * explicit. This would require some sort of migration strategy.
  13403. */
  13404. declare function getComponentDef<T>(type: any): ComponentDef<T> | null;
  13405. /**
  13406. * Checks whether a given Component, Directive or Pipe is marked as standalone.
  13407. * This will return false if passed anything other than a Component, Directive, or Pipe class
  13408. * See [this guide](guide/components/importing) for additional information:
  13409. *
  13410. * @param type A reference to a Component, Directive or Pipe.
  13411. * @publicApi
  13412. */
  13413. declare function isStandalone(type: Type$1<unknown>): boolean;
  13414. /**
  13415. * TODO(incremental-hydration): Remove this file entirely once PromiseWithResolvers lands in stable
  13416. * node / TS.
  13417. */
  13418. interface PromiseWithResolvers<T> {
  13419. promise: Promise<T>;
  13420. resolve: (value: T | PromiseLike<T>) => void;
  13421. reject: (reason?: any) => void;
  13422. }
  13423. /**
  13424. * An internal injection token to reference `DehydratedBlockRegistry` implementation
  13425. * in a tree-shakable way.
  13426. */
  13427. declare const DEHYDRATED_BLOCK_REGISTRY: InjectionToken<DehydratedBlockRegistry>;
  13428. /**
  13429. * The DehydratedBlockRegistry is used for incremental hydration purposes. It keeps
  13430. * track of the Defer Blocks that need hydration so we can effectively
  13431. * navigate up to the top dehydrated defer block and fire appropriate cleanup
  13432. * functions post hydration.
  13433. */
  13434. declare class DehydratedBlockRegistry {
  13435. private registry;
  13436. private cleanupFns;
  13437. private jsActionMap;
  13438. private contract;
  13439. add(blockId: string, info: DehydratedDeferBlock): void;
  13440. get(blockId: string): DehydratedDeferBlock | null;
  13441. has(blockId: string): boolean;
  13442. cleanup(hydratedBlocks: string[]): void;
  13443. get size(): number;
  13444. addCleanupFn(blockId: string, fn: Function): void;
  13445. invokeTriggerCleanupFns(blockId: string): void;
  13446. hydrating: Map<string, PromiseWithResolvers<void>>;
  13447. private awaitingCallbacks;
  13448. awaitParentBlock(topmostParentBlock: string, callback: Function): void;
  13449. /** @nocollapse */
  13450. static ɵprov: unknown;
  13451. }
  13452. /**
  13453. * Helper service to schedule `setTimeout`s for batches of defer blocks,
  13454. * to avoid calling `setTimeout` for each defer block (e.g. if defer blocks
  13455. * are created inside a for loop).
  13456. */
  13457. declare class TimerScheduler {
  13458. executingCallbacks: boolean;
  13459. timeoutId: number | null;
  13460. invokeTimerAt: number | null;
  13461. current: Array<number | VoidFunction>;
  13462. deferred: Array<number | VoidFunction>;
  13463. add(delay: number, callback: VoidFunction, ngZone: NgZone): void;
  13464. remove(callback: VoidFunction): void;
  13465. private addToQueue;
  13466. private removeFromQueue;
  13467. private scheduleTimer;
  13468. private clearTimeout;
  13469. ngOnDestroy(): void;
  13470. /** @nocollapse */
  13471. static ɵprov: unknown;
  13472. }
  13473. declare function compileNgModuleFactory<M>(injector: Injector, options: CompilerOptions, moduleType: Type$1<M>): Promise<NgModuleFactory$1<M>>;
  13474. /**
  13475. * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.
  13476. */
  13477. declare function createInjector(defType: any, parent?: Injector | null, additionalProviders?: Array<Provider | StaticProvider> | null, name?: string): Injector;
  13478. /**
  13479. * Adds the given NgModule type to Angular's NgModule registry.
  13480. *
  13481. * This is generated as a side-effect of NgModule compilation. Note that the `id` is passed in
  13482. * explicitly and not read from the NgModule definition. This is for two reasons: it avoids a
  13483. * megamorphic read, and in JIT there's a chicken-and-egg problem where the NgModule may not be
  13484. * fully resolved when it's registered.
  13485. *
  13486. * @codeGenApi
  13487. */
  13488. declare function registerNgModuleType(ngModuleType: NgModuleType, id: string): void;
  13489. /**
  13490. * Control whether the NgModule registration system enforces that each NgModule type registered has
  13491. * a unique id.
  13492. *
  13493. * This is useful for testing as the NgModule registry cannot be properly reset between tests with
  13494. * Angular's current API.
  13495. */
  13496. declare function setAllowDuplicateNgModuleIdsForTest(allowDuplicates: boolean): void;
  13497. /**
  13498. * The internal view context which is specific to a given DOM element, directive or
  13499. * component instance. Each value in here (besides the LView and element node details)
  13500. * can be present, null or undefined. If undefined then it implies the value has not been
  13501. * looked up yet, otherwise, if null, then a lookup was executed and nothing was found.
  13502. *
  13503. * Each value will get filled when the respective value is examined within the getContext
  13504. * function. The component, element and each directive instance will share the same instance
  13505. * of the context.
  13506. */
  13507. declare class LContext {
  13508. /**
  13509. * ID of the component's parent view data.
  13510. */
  13511. private lViewId;
  13512. /**
  13513. * The index instance of the node.
  13514. */
  13515. nodeIndex: number;
  13516. /**
  13517. * The instance of the DOM node that is attached to the lNode.
  13518. */
  13519. native: RNode;
  13520. /**
  13521. * The instance of the Component node.
  13522. */
  13523. component: {} | null | undefined;
  13524. /**
  13525. * The list of active directives that exist on this element.
  13526. */
  13527. directives: any[] | null | undefined;
  13528. /**
  13529. * The map of local references (local reference name => element or directive instance) that
  13530. * exist on this element.
  13531. */
  13532. localRefs: {
  13533. [key: string]: any;
  13534. } | null | undefined;
  13535. /** Component's parent view data. */
  13536. get lView(): LView | null;
  13537. constructor(
  13538. /**
  13539. * ID of the component's parent view data.
  13540. */
  13541. lViewId: number,
  13542. /**
  13543. * The index instance of the node.
  13544. */
  13545. nodeIndex: number,
  13546. /**
  13547. * The instance of the DOM node that is attached to the lNode.
  13548. */
  13549. native: RNode);
  13550. }
  13551. /**
  13552. * Returns the matching `LContext` data for a given DOM node, directive or component instance.
  13553. *
  13554. * This function will examine the provided DOM element, component, or directive instance\'s
  13555. * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched
  13556. * value will be that of the newly created `LContext`.
  13557. *
  13558. * If the monkey-patched value is the `LView` instance then the context value for that
  13559. * target will be created and the monkey-patch reference will be updated. Therefore when this
  13560. * function is called it may mutate the provided element\'s, component\'s or any of the associated
  13561. * directive\'s monkey-patch values.
  13562. *
  13563. * If the monkey-patch value is not detected then the code will walk up the DOM until an element
  13564. * is found which contains a monkey-patch reference. When that occurs then the provided element
  13565. * will be updated with a new context (which is then returned). If the monkey-patch value is not
  13566. * detected for a component/directive instance then it will throw an error (all components and
  13567. * directives should be automatically monkey-patched by ivy).
  13568. *
  13569. * @param target Component, Directive or DOM Node.
  13570. */
  13571. declare function getLContext(target: any): LContext | null;
  13572. declare const NG_COMP_DEF: string;
  13573. declare const NG_DIR_DEF: string;
  13574. declare const NG_PIPE_DEF: string;
  13575. declare const NG_MOD_DEF: string;
  13576. /**
  13577. * If a directive is diPublic, bloomAdd sets a property on the type with this constant as
  13578. * the key and the directive's unique ID as the value. This allows us to map directives to their
  13579. * bloom filter bit for DI.
  13580. */
  13581. declare const NG_ELEMENT_ID: string;
  13582. /**
  13583. * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
  13584. * definition.
  13585. *
  13586. * This exists primarily to support ngcc migration of an existing View Engine pattern, where an
  13587. * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
  13588. * generates a skeleton definition on the child class, and applies this feature.
  13589. *
  13590. * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
  13591. * including things like the component template function.
  13592. *
  13593. * @param definition The definition of a child class which inherits from a parent class with its
  13594. * own definition.
  13595. *
  13596. * @codeGenApi
  13597. */
  13598. declare function ɵɵCopyDefinitionFeature(definition: DirectiveDef<any> | ComponentDef<any>): void;
  13599. /**
  13600. * This feature adds the host directives behavior to a directive definition by patching a
  13601. * function onto it. The expectation is that the runtime will invoke the function during
  13602. * directive matching.
  13603. *
  13604. * For example:
  13605. * ```ts
  13606. * class ComponentWithHostDirective {
  13607. * static ɵcmp = defineComponent({
  13608. * type: ComponentWithHostDirective,
  13609. * features: [ɵɵHostDirectivesFeature([
  13610. * SimpleHostDirective,
  13611. * {directive: AdvancedHostDirective, inputs: ['foo: alias'], outputs: ['bar']},
  13612. * ])]
  13613. * });
  13614. * }
  13615. * ```
  13616. *
  13617. * @codeGenApi
  13618. */
  13619. declare function ɵɵHostDirectivesFeature(rawHostDirectives: HostDirectiveConfig[] | (() => HostDirectiveConfig[])): DirectiveDefFeature;
  13620. /**
  13621. * Merges the definition from a super class to a sub class.
  13622. * @param definition The definition that is a SubClass of another directive of component
  13623. *
  13624. * @codeGenApi
  13625. */
  13626. declare function ɵɵInheritDefinitionFeature(definition: DirectiveDef<any> | ComponentDef<any>): void;
  13627. /**
  13628. * The NgOnChangesFeature decorates a component with support for the ngOnChanges
  13629. * lifecycle hook, so it should be included in any component that implements
  13630. * that hook.
  13631. *
  13632. * If the component or directive uses inheritance, the NgOnChangesFeature MUST
  13633. * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise
  13634. * inherited properties will not be propagated to the ngOnChanges lifecycle
  13635. * hook.
  13636. *
  13637. * Example usage:
  13638. *
  13639. * ```ts
  13640. * static ɵcmp = defineComponent({
  13641. * ...
  13642. * inputs: {name: 'publicName'},
  13643. * features: [NgOnChangesFeature]
  13644. * });
  13645. * ```
  13646. *
  13647. * @codeGenApi
  13648. */
  13649. declare const ɵɵNgOnChangesFeature: () => DirectiveDefFeature;
  13650. /**
  13651. * This feature resolves the providers of a directive (or component),
  13652. * and publish them into the DI system, making it visible to others for injection.
  13653. *
  13654. * For example:
  13655. * ```ts
  13656. * class ComponentWithProviders {
  13657. * constructor(private greeter: GreeterDE) {}
  13658. *
  13659. * static ɵcmp = defineComponent({
  13660. * type: ComponentWithProviders,
  13661. * selectors: [['component-with-providers']],
  13662. * factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)),
  13663. * decls: 1,
  13664. * vars: 1,
  13665. * template: function(fs: RenderFlags, ctx: ComponentWithProviders) {
  13666. * if (fs & RenderFlags.Create) {
  13667. * ɵɵtext(0);
  13668. * }
  13669. * if (fs & RenderFlags.Update) {
  13670. * ɵɵtextInterpolate(ctx.greeter.greet());
  13671. * }
  13672. * },
  13673. * features: [ɵɵProvidersFeature([GreeterDE])]
  13674. * });
  13675. * }
  13676. * ```
  13677. *
  13678. * @param definition
  13679. *
  13680. * @codeGenApi
  13681. */
  13682. declare function ɵɵProvidersFeature<T>(providers: Provider[], viewProviders?: Provider[]): (definition: DirectiveDef<T>) => void;
  13683. /**
  13684. * A feature that adds support for external runtime styles for a component.
  13685. * An external runtime style is a URL to a CSS stylesheet that contains the styles
  13686. * for a given component. For browsers, this URL will be used in an appended `link` element
  13687. * when the component is rendered. This feature is typically used for Hot Module Replacement
  13688. * (HMR) of component stylesheets by leveraging preexisting global stylesheet HMR available
  13689. * in most development servers.
  13690. *
  13691. * @codeGenApi
  13692. */
  13693. declare function ɵɵExternalStylesFeature(styleUrls: string[]): ComponentDefFeature;
  13694. /**
  13695. * Generated next to NgModules to monkey-patch directive and pipe references onto a component's
  13696. * definition, when generating a direct reference in the component file would otherwise create an
  13697. * import cycle.
  13698. *
  13699. * See [this explanation](https://hackmd.io/Odw80D0pR6yfsOjg_7XCJg?view) for more details.
  13700. *
  13701. * @codeGenApi
  13702. */
  13703. declare function ɵɵsetComponentScope(type: ComponentType<any>, directives: Type$1<any>[] | (() => Type$1<any>[]), pipes: Type$1<any>[] | (() => Type$1<any>[])): void;
  13704. /**
  13705. * Adds the module metadata that is necessary to compute the module's transitive scope to an
  13706. * existing module definition.
  13707. *
  13708. * Scope metadata of modules is not used in production builds, so calls to this function can be
  13709. * marked pure to tree-shake it from the bundle, allowing for all referenced declarations
  13710. * to become eligible for tree-shaking as well.
  13711. *
  13712. * @codeGenApi
  13713. */
  13714. declare function ɵɵsetNgModuleScope(type: any, scope: NgModuleScopeInfoFromDecorator): unknown;
  13715. /**
  13716. * Retrieves the component instance associated with a given DOM element.
  13717. *
  13718. * @usageNotes
  13719. * Given the following DOM structure:
  13720. *
  13721. * ```html
  13722. * <app-root>
  13723. * <div>
  13724. * <child-comp></child-comp>
  13725. * </div>
  13726. * </app-root>
  13727. * ```
  13728. *
  13729. * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
  13730. * associated with this DOM element.
  13731. *
  13732. * Calling the function on `<app-root>` will return the `MyApp` instance.
  13733. *
  13734. *
  13735. * @param element DOM element from which the component should be retrieved.
  13736. * @returns Component instance associated with the element or `null` if there
  13737. * is no component associated with it.
  13738. *
  13739. * @publicApi
  13740. */
  13741. declare function getComponent<T>(element: Element): T | null;
  13742. /**
  13743. * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
  13744. * view that the element is part of. Otherwise retrieves the instance of the component whose view
  13745. * owns the element (in this case, the result is the same as calling `getOwningComponent`).
  13746. *
  13747. * @param element Element for which to get the surrounding component instance.
  13748. * @returns Instance of the component that is around the element or null if the element isn't
  13749. * inside any component.
  13750. *
  13751. * @publicApi
  13752. */
  13753. declare function getContext<T extends {}>(element: Element): T | null;
  13754. /**
  13755. * Retrieves the component instance whose view contains the DOM element.
  13756. *
  13757. * For example, if `<child-comp>` is used in the template of `<app-comp>`
  13758. * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
  13759. * would return `<app-comp>`.
  13760. *
  13761. * @param elementOrDir DOM element, component or directive instance
  13762. * for which to retrieve the root components.
  13763. * @returns Component instance whose view owns the DOM element or null if the element is not
  13764. * part of a component view.
  13765. *
  13766. * @publicApi
  13767. */
  13768. declare function getOwningComponent<T>(elementOrDir: Element | {}): T | null;
  13769. /**
  13770. * Retrieves all root components associated with a DOM element, directive or component instance.
  13771. * Root components are those which have been bootstrapped by Angular.
  13772. *
  13773. * @param elementOrDir DOM element, component or directive instance
  13774. * for which to retrieve the root components.
  13775. * @returns Root components associated with the target object.
  13776. *
  13777. * @publicApi
  13778. */
  13779. declare function getRootComponents(elementOrDir: Element | {}): {}[];
  13780. /**
  13781. * Retrieves an `Injector` associated with an element, component or directive instance.
  13782. *
  13783. * @param elementOrDir DOM element, component or directive instance for which to
  13784. * retrieve the injector.
  13785. * @returns Injector associated with the element, component or directive instance.
  13786. *
  13787. * @publicApi
  13788. */
  13789. declare function getInjector(elementOrDir: Element | {}): Injector;
  13790. /**
  13791. * Retrieves directive instances associated with a given DOM node. Does not include
  13792. * component instances.
  13793. *
  13794. * @usageNotes
  13795. * Given the following DOM structure:
  13796. *
  13797. * ```html
  13798. * <app-root>
  13799. * <button my-button></button>
  13800. * <my-comp></my-comp>
  13801. * </app-root>
  13802. * ```
  13803. *
  13804. * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
  13805. * directive that is associated with the DOM node.
  13806. *
  13807. * Calling `getDirectives` on `<my-comp>` will return an empty array.
  13808. *
  13809. * @param node DOM node for which to get the directives.
  13810. * @returns Array of directives associated with the node.
  13811. *
  13812. * @publicApi
  13813. */
  13814. declare function getDirectives(node: Node): {}[];
  13815. /**
  13816. * Partial metadata for a given directive instance.
  13817. * This information might be useful for debugging purposes or tooling.
  13818. * Currently only `inputs` and `outputs` metadata is available.
  13819. *
  13820. * @publicApi
  13821. */
  13822. interface DirectiveDebugMetadata {
  13823. inputs: Record<string, string>;
  13824. outputs: Record<string, string>;
  13825. }
  13826. /**
  13827. * Partial metadata for a given component instance.
  13828. * This information might be useful for debugging purposes or tooling.
  13829. * Currently the following fields are available:
  13830. * - inputs
  13831. * - outputs
  13832. * - encapsulation
  13833. * - changeDetection
  13834. *
  13835. * @publicApi
  13836. */
  13837. interface ComponentDebugMetadata extends DirectiveDebugMetadata {
  13838. encapsulation: ViewEncapsulation$1;
  13839. changeDetection: ChangeDetectionStrategy$1;
  13840. }
  13841. /**
  13842. * Returns the debug (partial) metadata for a particular directive or component instance.
  13843. * The function accepts an instance of a directive or component and returns the corresponding
  13844. * metadata.
  13845. *
  13846. * @param directiveOrComponentInstance Instance of a directive or component
  13847. * @returns metadata of the passed directive or component
  13848. *
  13849. * @publicApi
  13850. */
  13851. declare function getDirectiveMetadata(directiveOrComponentInstance: any): ComponentDebugMetadata | DirectiveDebugMetadata | null;
  13852. /**
  13853. * Retrieves the host element of a component or directive instance.
  13854. * The host element is the DOM element that matched the selector of the directive.
  13855. *
  13856. * @param componentOrDirective Component or directive instance for which the host
  13857. * element should be retrieved.
  13858. * @returns Host element of the target.
  13859. *
  13860. * @publicApi
  13861. */
  13862. declare function getHostElement(componentOrDirective: {}): Element;
  13863. /**
  13864. * Event listener configuration returned from `getListeners`.
  13865. * @publicApi
  13866. */
  13867. interface Listener {
  13868. /** Name of the event listener. */
  13869. name: string;
  13870. /** Element that the listener is bound to. */
  13871. element: Element;
  13872. /** Callback that is invoked when the event is triggered. */
  13873. callback: (value: any) => any;
  13874. /** Whether the listener is using event capturing. */
  13875. useCapture: boolean;
  13876. /**
  13877. * Type of the listener (e.g. a native DOM event or a custom @Output).
  13878. */
  13879. type: 'dom' | 'output';
  13880. }
  13881. /**
  13882. * Retrieves a list of event listeners associated with a DOM element. The list does include host
  13883. * listeners, but it does not include event listeners defined outside of the Angular context
  13884. * (e.g. through `addEventListener`).
  13885. *
  13886. * @usageNotes
  13887. * Given the following DOM structure:
  13888. *
  13889. * ```html
  13890. * <app-root>
  13891. * <div (click)="doSomething()"></div>
  13892. * </app-root>
  13893. * ```
  13894. *
  13895. * Calling `getListeners` on `<div>` will return an object that looks as follows:
  13896. *
  13897. * ```ts
  13898. * {
  13899. * name: 'click',
  13900. * element: <div>,
  13901. * callback: () => doSomething(),
  13902. * useCapture: false
  13903. * }
  13904. * ```
  13905. *
  13906. * @param element Element for which the DOM listeners should be retrieved.
  13907. * @returns Array of event listeners on the DOM element.
  13908. *
  13909. * @publicApi
  13910. */
  13911. declare function getListeners(element: Element): Listener[];
  13912. /**
  13913. * @codeGenApi
  13914. */
  13915. declare function ɵɵgetInheritedFactory<T>(type: Type$1<any>): (type: Type$1<T>) => T;
  13916. /**
  13917. * Sets the locale id that will be used for translations and ICU expressions.
  13918. * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine
  13919. * but is now defined as a global value.
  13920. *
  13921. * @param localeId
  13922. */
  13923. declare function setLocaleId(localeId: string): void;
  13924. /**
  13925. * Creates runtime data structures for defer blocks.
  13926. *
  13927. * @param index Index of the `defer` instruction.
  13928. * @param primaryTmplIndex Index of the template with the primary block content.
  13929. * @param dependencyResolverFn Function that contains dependencies for this defer block.
  13930. * @param loadingTmplIndex Index of the template with the loading block content.
  13931. * @param placeholderTmplIndex Index of the template with the placeholder block content.
  13932. * @param errorTmplIndex Index of the template with the error block content.
  13933. * @param loadingConfigIndex Index in the constants array of the configuration of the loading.
  13934. * block.
  13935. * @param placeholderConfigIndex Index in the constants array of the configuration of the
  13936. * placeholder block.
  13937. * @param enableTimerScheduling Function that enables timer-related scheduling if `after`
  13938. * or `minimum` parameters are setup on the `@loading` or `@placeholder` blocks.
  13939. * @param flags A set of flags to define a particular behavior (e.g. to indicate that
  13940. * hydrate triggers are present and regular triggers should be deactivated
  13941. * in certain scenarios).
  13942. *
  13943. * @codeGenApi
  13944. */
  13945. 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;
  13946. /**
  13947. * Loads defer block dependencies when a trigger value becomes truthy.
  13948. * @codeGenApi
  13949. */
  13950. declare function ɵɵdeferWhen(rawValue: unknown): void;
  13951. /**
  13952. * Prefetches the deferred content when a value becomes truthy.
  13953. * @codeGenApi
  13954. */
  13955. declare function ɵɵdeferPrefetchWhen(rawValue: unknown): void;
  13956. /**
  13957. * Hydrates the deferred content when a value becomes truthy.
  13958. * @codeGenApi
  13959. */
  13960. declare function ɵɵdeferHydrateWhen(rawValue: unknown): void;
  13961. /**
  13962. * Specifies that hydration never occurs.
  13963. * @codeGenApi
  13964. */
  13965. declare function ɵɵdeferHydrateNever(): void;
  13966. /**
  13967. * Sets up logic to handle the `on idle` deferred trigger.
  13968. * @codeGenApi
  13969. */
  13970. declare function ɵɵdeferOnIdle(): void;
  13971. /**
  13972. * Sets up logic to handle the `prefetch on idle` deferred trigger.
  13973. * @codeGenApi
  13974. */
  13975. declare function ɵɵdeferPrefetchOnIdle(): void;
  13976. /**
  13977. * Sets up logic to handle the `on idle` deferred trigger.
  13978. * @codeGenApi
  13979. */
  13980. declare function ɵɵdeferHydrateOnIdle(): void;
  13981. /**
  13982. * Sets up logic to handle the `on immediate` deferred trigger.
  13983. * @codeGenApi
  13984. */
  13985. declare function ɵɵdeferOnImmediate(): void;
  13986. /**
  13987. * Sets up logic to handle the `prefetch on immediate` deferred trigger.
  13988. * @codeGenApi
  13989. */
  13990. declare function ɵɵdeferPrefetchOnImmediate(): void;
  13991. /**
  13992. * Sets up logic to handle the `on immediate` hydrate trigger.
  13993. * @codeGenApi
  13994. */
  13995. declare function ɵɵdeferHydrateOnImmediate(): void;
  13996. /**
  13997. * Creates runtime data structures for the `on timer` deferred trigger.
  13998. * @param delay Amount of time to wait before loading the content.
  13999. * @codeGenApi
  14000. */
  14001. declare function ɵɵdeferOnTimer(delay: number): void;
  14002. /**
  14003. * Creates runtime data structures for the `prefetch on timer` deferred trigger.
  14004. * @param delay Amount of time to wait before prefetching the content.
  14005. * @codeGenApi
  14006. */
  14007. declare function ɵɵdeferPrefetchOnTimer(delay: number): void;
  14008. /**
  14009. * Creates runtime data structures for the `on timer` hydrate trigger.
  14010. * @param delay Amount of time to wait before loading the content.
  14011. * @codeGenApi
  14012. */
  14013. declare function ɵɵdeferHydrateOnTimer(delay: number): void;
  14014. /**
  14015. * Creates runtime data structures for the `on hover` deferred trigger.
  14016. * @param triggerIndex Index at which to find the trigger element.
  14017. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  14018. * @codeGenApi
  14019. */
  14020. declare function ɵɵdeferOnHover(triggerIndex: number, walkUpTimes?: number): void;
  14021. /**
  14022. * Creates runtime data structures for the `prefetch on hover` deferred trigger.
  14023. * @param triggerIndex Index at which to find the trigger element.
  14024. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  14025. * @codeGenApi
  14026. */
  14027. declare function ɵɵdeferPrefetchOnHover(triggerIndex: number, walkUpTimes?: number): void;
  14028. /**
  14029. * Creates runtime data structures for the `on hover` hydrate trigger.
  14030. * @codeGenApi
  14031. */
  14032. declare function ɵɵdeferHydrateOnHover(): void;
  14033. /**
  14034. * Creates runtime data structures for the `on interaction` deferred trigger.
  14035. * @param triggerIndex Index at which to find the trigger element.
  14036. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  14037. * @codeGenApi
  14038. */
  14039. declare function ɵɵdeferOnInteraction(triggerIndex: number, walkUpTimes?: number): void;
  14040. /**
  14041. * Creates runtime data structures for the `prefetch on interaction` deferred trigger.
  14042. * @param triggerIndex Index at which to find the trigger element.
  14043. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  14044. * @codeGenApi
  14045. */
  14046. declare function ɵɵdeferPrefetchOnInteraction(triggerIndex: number, walkUpTimes?: number): void;
  14047. /**
  14048. * Creates runtime data structures for the `on interaction` hydrate trigger.
  14049. * @codeGenApi
  14050. */
  14051. declare function ɵɵdeferHydrateOnInteraction(): void;
  14052. /**
  14053. * Creates runtime data structures for the `on viewport` deferred trigger.
  14054. * @param triggerIndex Index at which to find the trigger element.
  14055. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  14056. * @codeGenApi
  14057. */
  14058. declare function ɵɵdeferOnViewport(triggerIndex: number, walkUpTimes?: number): void;
  14059. /**
  14060. * Creates runtime data structures for the `prefetch on viewport` deferred trigger.
  14061. * @param triggerIndex Index at which to find the trigger element.
  14062. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  14063. * @codeGenApi
  14064. */
  14065. declare function ɵɵdeferPrefetchOnViewport(triggerIndex: number, walkUpTimes?: number): void;
  14066. /**
  14067. * Creates runtime data structures for the `on viewport` hydrate trigger.
  14068. * @codeGenApi
  14069. */
  14070. declare function ɵɵdeferHydrateOnViewport(): void;
  14071. /**
  14072. * Advances to an element for later binding instructions.
  14073. *
  14074. * Used in conjunction with instructions like {@link property} to act on elements with specified
  14075. * indices, for example those created with {@link element} or {@link elementStart}.
  14076. *
  14077. * ```ts
  14078. * (rf: RenderFlags, ctx: any) => {
  14079. * if (rf & 1) {
  14080. * text(0, 'Hello');
  14081. * text(1, 'Goodbye')
  14082. * element(2, 'div');
  14083. * }
  14084. * if (rf & 2) {
  14085. * advance(2); // Advance twice to the <div>.
  14086. * property('title', 'test');
  14087. * }
  14088. * }
  14089. * ```
  14090. * @param delta Number of elements to advance forwards by.
  14091. *
  14092. * @codeGenApi
  14093. */
  14094. declare function ɵɵadvance(delta?: number): void;
  14095. /**
  14096. * Updates the value of or removes a bound attribute on an Element.
  14097. *
  14098. * Used in the case of `[attr.title]="value"`
  14099. *
  14100. * @param name name The name of the attribute.
  14101. * @param value value The attribute is removed when value is `null` or `undefined`.
  14102. * Otherwise the attribute value is set to the stringified value.
  14103. * @param sanitizer An optional function used to sanitize the value.
  14104. * @param namespace Optional namespace to use when setting the attribute.
  14105. *
  14106. * @codeGenApi
  14107. */
  14108. declare function ɵɵattribute(name: string, value: any, sanitizer?: SanitizerFn | null, namespace?: string): typeof ɵɵattribute;
  14109. /**
  14110. *
  14111. * Update an interpolated attribute on an element with single bound value surrounded by text.
  14112. *
  14113. * Used when the value passed to a property has 1 interpolated value in it:
  14114. *
  14115. * ```html
  14116. * <div attr.title="prefix{{v0}}suffix"></div>
  14117. * ```
  14118. *
  14119. * Its compiled representation is::
  14120. *
  14121. * ```ts
  14122. * ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');
  14123. * ```
  14124. *
  14125. * @param attrName The name of the attribute to update
  14126. * @param prefix Static value used for concatenation only.
  14127. * @param v0 Value checked for change.
  14128. * @param suffix Static value used for concatenation only.
  14129. * @param sanitizer An optional sanitizer function
  14130. * @returns itself, so that it may be chained.
  14131. * @codeGenApi
  14132. */
  14133. declare function ɵɵattributeInterpolate1(attrName: string, prefix: string, v0: any, suffix: string, sanitizer?: SanitizerFn, namespace?: string): typeof ɵɵattributeInterpolate1;
  14134. /**
  14135. *
  14136. * Update an interpolated attribute on an element with 2 bound values surrounded by text.
  14137. *
  14138. * Used when the value passed to a property has 2 interpolated values in it:
  14139. *
  14140. * ```html
  14141. * <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
  14142. * ```
  14143. *
  14144. * Its compiled representation is::
  14145. *
  14146. * ```ts
  14147. * ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
  14148. * ```
  14149. *
  14150. * @param attrName The name of the attribute to update
  14151. * @param prefix Static value used for concatenation only.
  14152. * @param v0 Value checked for change.
  14153. * @param i0 Static value used for concatenation only.
  14154. * @param v1 Value checked for change.
  14155. * @param suffix Static value used for concatenation only.
  14156. * @param sanitizer An optional sanitizer function
  14157. * @returns itself, so that it may be chained.
  14158. * @codeGenApi
  14159. */
  14160. declare function ɵɵattributeInterpolate2(attrName: string, prefix: string, v0: any, i0: string, v1: any, suffix: string, sanitizer?: SanitizerFn, namespace?: string): typeof ɵɵattributeInterpolate2;
  14161. /**
  14162. *
  14163. * Update an interpolated attribute on an element with 3 bound values surrounded by text.
  14164. *
  14165. * Used when the value passed to a property has 3 interpolated values in it:
  14166. *
  14167. * ```html
  14168. * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
  14169. * ```
  14170. *
  14171. * Its compiled representation is::
  14172. *
  14173. * ```ts
  14174. * ɵɵattributeInterpolate3(
  14175. * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
  14176. * ```
  14177. *
  14178. * @param attrName The name of the attribute to update
  14179. * @param prefix Static value used for concatenation only.
  14180. * @param v0 Value checked for change.
  14181. * @param i0 Static value used for concatenation only.
  14182. * @param v1 Value checked for change.
  14183. * @param i1 Static value used for concatenation only.
  14184. * @param v2 Value checked for change.
  14185. * @param suffix Static value used for concatenation only.
  14186. * @param sanitizer An optional sanitizer function
  14187. * @returns itself, so that it may be chained.
  14188. * @codeGenApi
  14189. */
  14190. 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;
  14191. /**
  14192. *
  14193. * Update an interpolated attribute on an element with 4 bound values surrounded by text.
  14194. *
  14195. * Used when the value passed to a property has 4 interpolated values in it:
  14196. *
  14197. * ```html
  14198. * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
  14199. * ```
  14200. *
  14201. * Its compiled representation is::
  14202. *
  14203. * ```ts
  14204. * ɵɵattributeInterpolate4(
  14205. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
  14206. * ```
  14207. *
  14208. * @param attrName The name of the attribute to update
  14209. * @param prefix Static value used for concatenation only.
  14210. * @param v0 Value checked for change.
  14211. * @param i0 Static value used for concatenation only.
  14212. * @param v1 Value checked for change.
  14213. * @param i1 Static value used for concatenation only.
  14214. * @param v2 Value checked for change.
  14215. * @param i2 Static value used for concatenation only.
  14216. * @param v3 Value checked for change.
  14217. * @param suffix Static value used for concatenation only.
  14218. * @param sanitizer An optional sanitizer function
  14219. * @returns itself, so that it may be chained.
  14220. * @codeGenApi
  14221. */
  14222. 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;
  14223. /**
  14224. *
  14225. * Update an interpolated attribute on an element with 5 bound values surrounded by text.
  14226. *
  14227. * Used when the value passed to a property has 5 interpolated values in it:
  14228. *
  14229. * ```html
  14230. * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
  14231. * ```
  14232. *
  14233. * Its compiled representation is::
  14234. *
  14235. * ```ts
  14236. * ɵɵattributeInterpolate5(
  14237. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
  14238. * ```
  14239. *
  14240. * @param attrName The name of the attribute to update
  14241. * @param prefix Static value used for concatenation only.
  14242. * @param v0 Value checked for change.
  14243. * @param i0 Static value used for concatenation only.
  14244. * @param v1 Value checked for change.
  14245. * @param i1 Static value used for concatenation only.
  14246. * @param v2 Value checked for change.
  14247. * @param i2 Static value used for concatenation only.
  14248. * @param v3 Value checked for change.
  14249. * @param i3 Static value used for concatenation only.
  14250. * @param v4 Value checked for change.
  14251. * @param suffix Static value used for concatenation only.
  14252. * @param sanitizer An optional sanitizer function
  14253. * @returns itself, so that it may be chained.
  14254. * @codeGenApi
  14255. */
  14256. 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;
  14257. /**
  14258. *
  14259. * Update an interpolated attribute on an element with 6 bound values surrounded by text.
  14260. *
  14261. * Used when the value passed to a property has 6 interpolated values in it:
  14262. *
  14263. * ```html
  14264. * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
  14265. * ```
  14266. *
  14267. * Its compiled representation is::
  14268. *
  14269. * ```ts
  14270. * ɵɵattributeInterpolate6(
  14271. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
  14272. * ```
  14273. *
  14274. * @param attrName The name of the attribute to update
  14275. * @param prefix Static value used for concatenation only.
  14276. * @param v0 Value checked for change.
  14277. * @param i0 Static value used for concatenation only.
  14278. * @param v1 Value checked for change.
  14279. * @param i1 Static value used for concatenation only.
  14280. * @param v2 Value checked for change.
  14281. * @param i2 Static value used for concatenation only.
  14282. * @param v3 Value checked for change.
  14283. * @param i3 Static value used for concatenation only.
  14284. * @param v4 Value checked for change.
  14285. * @param i4 Static value used for concatenation only.
  14286. * @param v5 Value checked for change.
  14287. * @param suffix Static value used for concatenation only.
  14288. * @param sanitizer An optional sanitizer function
  14289. * @returns itself, so that it may be chained.
  14290. * @codeGenApi
  14291. */
  14292. 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;
  14293. /**
  14294. *
  14295. * Update an interpolated attribute on an element with 7 bound values surrounded by text.
  14296. *
  14297. * Used when the value passed to a property has 7 interpolated values in it:
  14298. *
  14299. * ```html
  14300. * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div>
  14301. * ```
  14302. *
  14303. * Its compiled representation is::
  14304. *
  14305. * ```ts
  14306. * ɵɵattributeInterpolate7(
  14307. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
  14308. * ```
  14309. *
  14310. * @param attrName The name of the attribute to update
  14311. * @param prefix Static value used for concatenation only.
  14312. * @param v0 Value checked for change.
  14313. * @param i0 Static value used for concatenation only.
  14314. * @param v1 Value checked for change.
  14315. * @param i1 Static value used for concatenation only.
  14316. * @param v2 Value checked for change.
  14317. * @param i2 Static value used for concatenation only.
  14318. * @param v3 Value checked for change.
  14319. * @param i3 Static value used for concatenation only.
  14320. * @param v4 Value checked for change.
  14321. * @param i4 Static value used for concatenation only.
  14322. * @param v5 Value checked for change.
  14323. * @param i5 Static value used for concatenation only.
  14324. * @param v6 Value checked for change.
  14325. * @param suffix Static value used for concatenation only.
  14326. * @param sanitizer An optional sanitizer function
  14327. * @returns itself, so that it may be chained.
  14328. * @codeGenApi
  14329. */
  14330. 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;
  14331. /**
  14332. *
  14333. * Update an interpolated attribute on an element with 8 bound values surrounded by text.
  14334. *
  14335. * Used when the value passed to a property has 8 interpolated values in it:
  14336. *
  14337. * ```html
  14338. * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div>
  14339. * ```
  14340. *
  14341. * Its compiled representation is::
  14342. *
  14343. * ```ts
  14344. * ɵɵattributeInterpolate8(
  14345. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
  14346. * ```
  14347. *
  14348. * @param attrName The name of the attribute to update
  14349. * @param prefix Static value used for concatenation only.
  14350. * @param v0 Value checked for change.
  14351. * @param i0 Static value used for concatenation only.
  14352. * @param v1 Value checked for change.
  14353. * @param i1 Static value used for concatenation only.
  14354. * @param v2 Value checked for change.
  14355. * @param i2 Static value used for concatenation only.
  14356. * @param v3 Value checked for change.
  14357. * @param i3 Static value used for concatenation only.
  14358. * @param v4 Value checked for change.
  14359. * @param i4 Static value used for concatenation only.
  14360. * @param v5 Value checked for change.
  14361. * @param i5 Static value used for concatenation only.
  14362. * @param v6 Value checked for change.
  14363. * @param i6 Static value used for concatenation only.
  14364. * @param v7 Value checked for change.
  14365. * @param suffix Static value used for concatenation only.
  14366. * @param sanitizer An optional sanitizer function
  14367. * @returns itself, so that it may be chained.
  14368. * @codeGenApi
  14369. */
  14370. 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;
  14371. /**
  14372. * Update an interpolated attribute on an element with 9 or more bound values surrounded by text.
  14373. *
  14374. * Used when the number of interpolated values exceeds 8.
  14375. *
  14376. * ```html
  14377. * <div
  14378. * title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix"></div>
  14379. * ```
  14380. *
  14381. * Its compiled representation is::
  14382. *
  14383. * ```ts
  14384. * ɵɵattributeInterpolateV(
  14385. * 'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
  14386. * 'suffix']);
  14387. * ```
  14388. *
  14389. * @param attrName The name of the attribute to update.
  14390. * @param values The collection of values and the strings in-between those values, beginning with
  14391. * a string prefix and ending with a string suffix.
  14392. * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
  14393. * @param sanitizer An optional sanitizer function
  14394. * @returns itself, so that it may be chained.
  14395. * @codeGenApi
  14396. */
  14397. declare function ɵɵattributeInterpolateV(attrName: string, values: any[], sanitizer?: SanitizerFn, namespace?: string): typeof ɵɵattributeInterpolateV;
  14398. /**
  14399. *
  14400. * Update an interpolated class on an element with single bound value surrounded by text.
  14401. *
  14402. * Used when the value passed to a property has 1 interpolated value in it:
  14403. *
  14404. * ```html
  14405. * <div class="prefix{{v0}}suffix"></div>
  14406. * ```
  14407. *
  14408. * Its compiled representation is:
  14409. *
  14410. * ```ts
  14411. * ɵɵclassMapInterpolate1('prefix', v0, 'suffix');
  14412. * ```
  14413. *
  14414. * @param prefix Static value used for concatenation only.
  14415. * @param v0 Value checked for change.
  14416. * @param suffix Static value used for concatenation only.
  14417. * @codeGenApi
  14418. */
  14419. declare function ɵɵclassMapInterpolate1(prefix: string, v0: any, suffix: string): void;
  14420. /**
  14421. *
  14422. * Update an interpolated class on an element with 2 bound values surrounded by text.
  14423. *
  14424. * Used when the value passed to a property has 2 interpolated values in it:
  14425. *
  14426. * ```html
  14427. * <div class="prefix{{v0}}-{{v1}}suffix"></div>
  14428. * ```
  14429. *
  14430. * Its compiled representation is:
  14431. *
  14432. * ```ts
  14433. * ɵɵclassMapInterpolate2('prefix', v0, '-', v1, 'suffix');
  14434. * ```
  14435. *
  14436. * @param prefix Static value used for concatenation only.
  14437. * @param v0 Value checked for change.
  14438. * @param i0 Static value used for concatenation only.
  14439. * @param v1 Value checked for change.
  14440. * @param suffix Static value used for concatenation only.
  14441. * @codeGenApi
  14442. */
  14443. declare function ɵɵclassMapInterpolate2(prefix: string, v0: any, i0: string, v1: any, suffix: string): void;
  14444. /**
  14445. *
  14446. * Update an interpolated class on an element with 3 bound values surrounded by text.
  14447. *
  14448. * Used when the value passed to a property has 3 interpolated values in it:
  14449. *
  14450. * ```html
  14451. * <div class="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
  14452. * ```
  14453. *
  14454. * Its compiled representation is:
  14455. *
  14456. * ```ts
  14457. * ɵɵclassMapInterpolate3(
  14458. * 'prefix', v0, '-', v1, '-', v2, 'suffix');
  14459. * ```
  14460. *
  14461. * @param prefix Static value used for concatenation only.
  14462. * @param v0 Value checked for change.
  14463. * @param i0 Static value used for concatenation only.
  14464. * @param v1 Value checked for change.
  14465. * @param i1 Static value used for concatenation only.
  14466. * @param v2 Value checked for change.
  14467. * @param suffix Static value used for concatenation only.
  14468. * @codeGenApi
  14469. */
  14470. declare function ɵɵclassMapInterpolate3(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string): void;
  14471. /**
  14472. *
  14473. * Update an interpolated class on an element with 4 bound values surrounded by text.
  14474. *
  14475. * Used when the value passed to a property has 4 interpolated values in it:
  14476. *
  14477. * ```html
  14478. * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
  14479. * ```
  14480. *
  14481. * Its compiled representation is:
  14482. *
  14483. * ```ts
  14484. * ɵɵclassMapInterpolate4(
  14485. * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
  14486. * ```
  14487. *
  14488. * @param prefix Static value used for concatenation only.
  14489. * @param v0 Value checked for change.
  14490. * @param i0 Static value used for concatenation only.
  14491. * @param v1 Value checked for change.
  14492. * @param i1 Static value used for concatenation only.
  14493. * @param v2 Value checked for change.
  14494. * @param i2 Static value used for concatenation only.
  14495. * @param v3 Value checked for change.
  14496. * @param suffix Static value used for concatenation only.
  14497. * @codeGenApi
  14498. */
  14499. declare function ɵɵclassMapInterpolate4(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix: string): void;
  14500. /**
  14501. *
  14502. * Update an interpolated class on an element with 5 bound values surrounded by text.
  14503. *
  14504. * Used when the value passed to a property has 5 interpolated values in it:
  14505. *
  14506. * ```html
  14507. * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
  14508. * ```
  14509. *
  14510. * Its compiled representation is:
  14511. *
  14512. * ```ts
  14513. * ɵɵclassMapInterpolate5(
  14514. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
  14515. * ```
  14516. *
  14517. * @param prefix Static value used for concatenation only.
  14518. * @param v0 Value checked for change.
  14519. * @param i0 Static value used for concatenation only.
  14520. * @param v1 Value checked for change.
  14521. * @param i1 Static value used for concatenation only.
  14522. * @param v2 Value checked for change.
  14523. * @param i2 Static value used for concatenation only.
  14524. * @param v3 Value checked for change.
  14525. * @param i3 Static value used for concatenation only.
  14526. * @param v4 Value checked for change.
  14527. * @param suffix Static value used for concatenation only.
  14528. * @codeGenApi
  14529. */
  14530. 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;
  14531. /**
  14532. *
  14533. * Update an interpolated class on an element with 6 bound values surrounded by text.
  14534. *
  14535. * Used when the value passed to a property has 6 interpolated values in it:
  14536. *
  14537. * ```html
  14538. * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
  14539. * ```
  14540. *
  14541. * Its compiled representation is:
  14542. *
  14543. * ```ts
  14544. * ɵɵclassMapInterpolate6(
  14545. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
  14546. * ```
  14547. *
  14548. * @param prefix Static value used for concatenation only.
  14549. * @param v0 Value checked for change.
  14550. * @param i0 Static value used for concatenation only.
  14551. * @param v1 Value checked for change.
  14552. * @param i1 Static value used for concatenation only.
  14553. * @param v2 Value checked for change.
  14554. * @param i2 Static value used for concatenation only.
  14555. * @param v3 Value checked for change.
  14556. * @param i3 Static value used for concatenation only.
  14557. * @param v4 Value checked for change.
  14558. * @param i4 Static value used for concatenation only.
  14559. * @param v5 Value checked for change.
  14560. * @param suffix Static value used for concatenation only.
  14561. * @codeGenApi
  14562. */
  14563. 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;
  14564. /**
  14565. *
  14566. * Update an interpolated class on an element with 7 bound values surrounded by text.
  14567. *
  14568. * Used when the value passed to a property has 7 interpolated values in it:
  14569. *
  14570. * ```html
  14571. * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div>
  14572. * ```
  14573. *
  14574. * Its compiled representation is:
  14575. *
  14576. * ```ts
  14577. * ɵɵclassMapInterpolate7(
  14578. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
  14579. * ```
  14580. *
  14581. * @param prefix Static value used for concatenation only.
  14582. * @param v0 Value checked for change.
  14583. * @param i0 Static value used for concatenation only.
  14584. * @param v1 Value checked for change.
  14585. * @param i1 Static value used for concatenation only.
  14586. * @param v2 Value checked for change.
  14587. * @param i2 Static value used for concatenation only.
  14588. * @param v3 Value checked for change.
  14589. * @param i3 Static value used for concatenation only.
  14590. * @param v4 Value checked for change.
  14591. * @param i4 Static value used for concatenation only.
  14592. * @param v5 Value checked for change.
  14593. * @param i5 Static value used for concatenation only.
  14594. * @param v6 Value checked for change.
  14595. * @param suffix Static value used for concatenation only.
  14596. * @codeGenApi
  14597. */
  14598. 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;
  14599. /**
  14600. *
  14601. * Update an interpolated class on an element with 8 bound values surrounded by text.
  14602. *
  14603. * Used when the value passed to a property has 8 interpolated values in it:
  14604. *
  14605. * ```html
  14606. * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div>
  14607. * ```
  14608. *
  14609. * Its compiled representation is:
  14610. *
  14611. * ```ts
  14612. * ɵɵclassMapInterpolate8(
  14613. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
  14614. * ```
  14615. *
  14616. * @param prefix Static value used for concatenation only.
  14617. * @param v0 Value checked for change.
  14618. * @param i0 Static value used for concatenation only.
  14619. * @param v1 Value checked for change.
  14620. * @param i1 Static value used for concatenation only.
  14621. * @param v2 Value checked for change.
  14622. * @param i2 Static value used for concatenation only.
  14623. * @param v3 Value checked for change.
  14624. * @param i3 Static value used for concatenation only.
  14625. * @param v4 Value checked for change.
  14626. * @param i4 Static value used for concatenation only.
  14627. * @param v5 Value checked for change.
  14628. * @param i5 Static value used for concatenation only.
  14629. * @param v6 Value checked for change.
  14630. * @param i6 Static value used for concatenation only.
  14631. * @param v7 Value checked for change.
  14632. * @param suffix Static value used for concatenation only.
  14633. * @codeGenApi
  14634. */
  14635. 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;
  14636. /**
  14637. * Update an interpolated class on an element with 9 or more bound values surrounded by text.
  14638. *
  14639. * Used when the number of interpolated values exceeds 8.
  14640. *
  14641. * ```html
  14642. * <div
  14643. * class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix"></div>
  14644. * ```
  14645. *
  14646. * Its compiled representation is:
  14647. *
  14648. * ```ts
  14649. * ɵɵclassMapInterpolateV(
  14650. * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
  14651. * 'suffix']);
  14652. * ```
  14653. *.
  14654. * @param values The collection of values and the strings in-between those values, beginning with
  14655. * a string prefix and ending with a string suffix.
  14656. * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
  14657. * @codeGenApi
  14658. */
  14659. declare function ɵɵclassMapInterpolateV(values: any[]): void;
  14660. /*!
  14661. * @license
  14662. * Copyright Google LLC All Rights Reserved.
  14663. *
  14664. * Use of this source code is governed by an MIT-style license that can be
  14665. * found in the LICENSE file at https://angular.dev/license
  14666. */
  14667. /**
  14668. * Instruction that returns the component instance in which the current instruction is executing.
  14669. * This is a constant-time version of `nextContent` for the case where we know that we need the
  14670. * component instance specifically, rather than the context of a particular template.
  14671. *
  14672. * @codeGenApi
  14673. */
  14674. declare function ɵɵcomponentInstance(): unknown;
  14675. /**
  14676. * The conditional instruction represents the basic building block on the runtime side to support
  14677. * built-in "if" and "switch". On the high level this instruction is responsible for adding and
  14678. * removing views selected by a conditional expression.
  14679. *
  14680. * @param matchingTemplateIndex Index of a template TNode representing a conditional view to be
  14681. * inserted; -1 represents a special case when there is no view to insert.
  14682. * @param contextValue Value that should be exposed as the context of the conditional.
  14683. * @codeGenApi
  14684. */
  14685. declare function ɵɵconditional<T>(matchingTemplateIndex: number, contextValue?: T): void;
  14686. /**
  14687. * A built-in trackBy function used for situations where users specified collection index as a
  14688. * tracking expression. Having this function body in the runtime avoids unnecessary code generation.
  14689. *
  14690. * @param index
  14691. * @returns
  14692. */
  14693. declare function ɵɵrepeaterTrackByIndex(index: number): number;
  14694. /**
  14695. * A built-in trackBy function used for situations where users specified collection item reference
  14696. * as a tracking expression. Having this function body in the runtime avoids unnecessary code
  14697. * generation.
  14698. *
  14699. * @param index
  14700. * @returns
  14701. */
  14702. declare function ɵɵrepeaterTrackByIdentity<T>(_: number, value: T): T;
  14703. /**
  14704. * The repeaterCreate instruction runs in the creation part of the template pass and initializes
  14705. * internal data structures required by the update pass of the built-in repeater logic. Repeater
  14706. * metadata are allocated in the data part of LView with the following layout:
  14707. * - LView[HEADER_OFFSET + index] - metadata
  14708. * - LView[HEADER_OFFSET + index + 1] - reference to a template function rendering an item
  14709. * - LView[HEADER_OFFSET + index + 2] - optional reference to a template function rendering an empty
  14710. * block
  14711. *
  14712. * @param index Index at which to store the metadata of the repeater.
  14713. * @param templateFn Reference to the template of the main repeater block.
  14714. * @param decls The number of nodes, local refs, and pipes for the main block.
  14715. * @param vars The number of bindings for the main block.
  14716. * @param tagName The name of the container element, if applicable
  14717. * @param attrsIndex Index of template attributes in the `consts` array.
  14718. * @param trackByFn Reference to the tracking function.
  14719. * @param trackByUsesComponentInstance Whether the tracking function has any references to the
  14720. * component instance. If it doesn't, we can avoid rebinding it.
  14721. * @param emptyTemplateFn Reference to the template function of the empty block.
  14722. * @param emptyDecls The number of nodes, local refs, and pipes for the empty block.
  14723. * @param emptyVars The number of bindings for the empty block.
  14724. * @param emptyTagName The name of the empty block container element, if applicable
  14725. * @param emptyAttrsIndex Index of the empty block template attributes in the `consts` array.
  14726. *
  14727. * @codeGenApi
  14728. */
  14729. 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;
  14730. /**
  14731. * The repeater instruction does update-time diffing of a provided collection (against the
  14732. * collection seen previously) and maps changes in the collection to views structure (by adding,
  14733. * removing or moving views as needed).
  14734. * @param collection - the collection instance to be checked for changes
  14735. * @codeGenApi
  14736. */
  14737. declare function ɵɵrepeater(collection: Iterable<unknown> | undefined | null): void;
  14738. /**
  14739. * Returns the value associated to the given token from the injectors.
  14740. *
  14741. * `directiveInject` is intended to be used for directive, component and pipe factories.
  14742. * All other injection use `inject` which does not walk the node injector tree.
  14743. *
  14744. * Usage example (in factory function):
  14745. *
  14746. * ```ts
  14747. * class SomeDirective {
  14748. * constructor(directive: DirectiveA) {}
  14749. *
  14750. * static ɵdir = ɵɵdefineDirective({
  14751. * type: SomeDirective,
  14752. * factory: () => new SomeDirective(ɵɵdirectiveInject(DirectiveA))
  14753. * });
  14754. * }
  14755. * ```
  14756. * @param token the type or token to inject
  14757. * @param flags Injection flags
  14758. * @returns the value from the injector or `null` when not found
  14759. *
  14760. * @codeGenApi
  14761. */
  14762. declare function ɵɵdirectiveInject<T>(token: ProviderToken<T>): T;
  14763. declare function ɵɵdirectiveInject<T>(token: ProviderToken<T>, flags: InjectFlags): T;
  14764. /**
  14765. * Throws an error indicating that a factory function could not be generated by the compiler for a
  14766. * particular class.
  14767. *
  14768. * This instruction allows the actual error message to be optimized away when ngDevMode is turned
  14769. * off, saving bytes of generated code while still providing a good experience in dev mode.
  14770. *
  14771. * The name of the class is not mentioned here, but will be in the generated factory function name
  14772. * and thus in the stack trace.
  14773. *
  14774. * @codeGenApi
  14775. */
  14776. declare function ɵɵinvalidFactory(): never;
  14777. /**
  14778. * Facade for the attribute injection from DI.
  14779. *
  14780. * @codeGenApi
  14781. */
  14782. declare function ɵɵinjectAttribute(attrNameToInject: string): string | null;
  14783. /**
  14784. * Create DOM element. The instruction must later be followed by `elementEnd()` call.
  14785. *
  14786. * @param index Index of the element in the LView array
  14787. * @param name Name of the DOM Node
  14788. * @param attrsIndex Index of the element's attributes in the `consts` array.
  14789. * @param localRefsIndex Index of the element's local references in the `consts` array.
  14790. * @returns This function returns itself so that it may be chained.
  14791. *
  14792. * Attributes and localRefs are passed as an array of strings where elements with an even index
  14793. * hold an attribute name and elements with an odd index hold an attribute value, ex.:
  14794. * ['id', 'warning5', 'class', 'alert']
  14795. *
  14796. * @codeGenApi
  14797. */
  14798. declare function ɵɵelementStart(index: number, name: string, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵelementStart;
  14799. /**
  14800. * Mark the end of the element.
  14801. * @returns This function returns itself so that it may be chained.
  14802. *
  14803. * @codeGenApi
  14804. */
  14805. declare function ɵɵelementEnd(): typeof ɵɵelementEnd;
  14806. /**
  14807. * Creates an empty element using {@link elementStart} and {@link elementEnd}
  14808. *
  14809. * @param index Index of the element in the data array
  14810. * @param name Name of the DOM Node
  14811. * @param attrsIndex Index of the element's attributes in the `consts` array.
  14812. * @param localRefsIndex Index of the element's local references in the `consts` array.
  14813. * @returns This function returns itself so that it may be chained.
  14814. *
  14815. * @codeGenApi
  14816. */
  14817. declare function ɵɵelement(index: number, name: string, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵelement;
  14818. /**
  14819. * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM.
  14820. * The instruction must later be followed by `elementContainerEnd()` call.
  14821. *
  14822. * @param index Index of the element in the LView array
  14823. * @param attrsIndex Index of the container attributes in the `consts` array.
  14824. * @param localRefsIndex Index of the container's local references in the `consts` array.
  14825. * @returns This function returns itself so that it may be chained.
  14826. *
  14827. * Even if this instruction accepts a set of attributes no actual attribute values are propagated to
  14828. * the DOM (as a comment node can't have attributes). Attributes are here only for directive
  14829. * matching purposes and setting initial inputs of directives.
  14830. *
  14831. * @codeGenApi
  14832. */
  14833. declare function ɵɵelementContainerStart(index: number, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵelementContainerStart;
  14834. /**
  14835. * Mark the end of the <ng-container>.
  14836. * @returns This function returns itself so that it may be chained.
  14837. *
  14838. * @codeGenApi
  14839. */
  14840. declare function ɵɵelementContainerEnd(): typeof ɵɵelementContainerEnd;
  14841. /**
  14842. * Creates an empty logical container using {@link elementContainerStart}
  14843. * and {@link elementContainerEnd}
  14844. *
  14845. * @param index Index of the element in the LView array
  14846. * @param attrsIndex Index of the container attributes in the `consts` array.
  14847. * @param localRefsIndex Index of the container's local references in the `consts` array.
  14848. * @returns This function returns itself so that it may be chained.
  14849. *
  14850. * @codeGenApi
  14851. */
  14852. declare function ɵɵelementContainer(index: number, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵelementContainer;
  14853. /**
  14854. * Sets a strict mode for JIT-compiled components to throw an error on unknown elements,
  14855. * instead of just logging the error.
  14856. * (for AOT-compiled ones this check happens at build time).
  14857. */
  14858. declare function ɵsetUnknownElementStrictMode(shouldThrow: boolean): void;
  14859. /**
  14860. * Gets the current value of the strict mode.
  14861. */
  14862. declare function ɵgetUnknownElementStrictMode(): boolean;
  14863. /**
  14864. * Sets a strict mode for JIT-compiled components to throw an error on unknown properties,
  14865. * instead of just logging the error.
  14866. * (for AOT-compiled ones this check happens at build time).
  14867. */
  14868. declare function ɵsetUnknownPropertyStrictMode(shouldThrow: boolean): void;
  14869. /**
  14870. * Gets the current value of the strict mode.
  14871. */
  14872. declare function ɵgetUnknownPropertyStrictMode(): boolean;
  14873. /**
  14874. * Returns the current OpaqueViewState instance.
  14875. *
  14876. * Used in conjunction with the restoreView() instruction to save a snapshot
  14877. * of the current view and restore it when listeners are invoked. This allows
  14878. * walking the declaration view tree in listeners to get vars from parent views.
  14879. *
  14880. * @codeGenApi
  14881. */
  14882. declare function ɵɵgetCurrentView(): OpaqueViewState;
  14883. interface NO_CHANGE {
  14884. __brand__: 'NO_CHANGE';
  14885. }
  14886. /** A special value which designates that a value has not changed. */
  14887. declare const NO_CHANGE: NO_CHANGE;
  14888. /**
  14889. * Update a property on a host element. Only applies to native node properties, not inputs.
  14890. *
  14891. * Operates on the element selected by index via the {@link select} instruction.
  14892. *
  14893. * @param propName Name of property. Because it is going to DOM, this is not subject to
  14894. * renaming as part of minification.
  14895. * @param value New value to write.
  14896. * @param sanitizer An optional function used to sanitize the value.
  14897. * @returns This function returns itself so that it may be chained
  14898. * (e.g. `property('name', ctx.name)('title', ctx.title)`)
  14899. *
  14900. * @codeGenApi
  14901. */
  14902. declare function ɵɵhostProperty<T>(propName: string, value: T, sanitizer?: SanitizerFn | null): typeof ɵɵhostProperty;
  14903. /**
  14904. * Updates a synthetic host binding (e.g. `[@foo]`) on a component or directive.
  14905. *
  14906. * This instruction is for compatibility purposes and is designed to ensure that a
  14907. * synthetic host binding (e.g. `@HostBinding('@foo')`) properly gets rendered in
  14908. * the component's renderer. Normally all host bindings are evaluated with the parent
  14909. * component's renderer, but, in the case of animation @triggers, they need to be
  14910. * evaluated with the sub component's renderer (because that's where the animation
  14911. * triggers are defined).
  14912. *
  14913. * Do not use this instruction as a replacement for `elementProperty`. This instruction
  14914. * only exists to ensure compatibility with the ViewEngine's host binding behavior.
  14915. *
  14916. * @param index The index of the element to update in the data array
  14917. * @param propName Name of property. Because it is going to DOM, this is not subject to
  14918. * renaming as part of minification.
  14919. * @param value New value to write.
  14920. * @param sanitizer An optional function used to sanitize the value.
  14921. *
  14922. * @codeGenApi
  14923. */
  14924. declare function ɵɵsyntheticHostProperty<T>(propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null): typeof ɵɵsyntheticHostProperty;
  14925. declare global {
  14926. const ngI18nClosureMode: boolean;
  14927. }
  14928. /**
  14929. * Marks a block of text as translatable.
  14930. *
  14931. * The instructions `i18nStart` and `i18nEnd` mark the translation block in the template.
  14932. * The translation `message` is the value which is locale specific. The translation string may
  14933. * contain placeholders which associate inner elements and sub-templates within the translation.
  14934. *
  14935. * The translation `message` placeholders are:
  14936. * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be
  14937. * interpolated into. The placeholder `index` points to the expression binding index. An optional
  14938. * `block` that matches the sub-template in which it was declared.
  14939. * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*: Marks the beginning
  14940. * and end of DOM element that were embedded in the original translation block. The placeholder
  14941. * `index` points to the element index in the template instructions set. An optional `block` that
  14942. * matches the sub-template in which it was declared.
  14943. * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be
  14944. * split up and translated separately in each angular template function. The `index` points to the
  14945. * `template` instruction index. A `block` that matches the sub-template in which it was declared.
  14946. *
  14947. * @param index A unique index of the translation in the static block.
  14948. * @param messageIndex An index of the translation message from the `def.consts` array.
  14949. * @param subTemplateIndex Optional sub-template index in the `message`.
  14950. *
  14951. * @codeGenApi
  14952. */
  14953. declare function ɵɵi18nStart(index: number, messageIndex: number, subTemplateIndex?: number): void;
  14954. /**
  14955. * Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes
  14956. * into the render tree, moves the placeholder nodes and removes the deleted nodes.
  14957. *
  14958. * @codeGenApi
  14959. */
  14960. declare function ɵɵi18nEnd(): void;
  14961. /**
  14962. *
  14963. * Use this instruction to create a translation block that doesn't contain any placeholder.
  14964. * It calls both {@link i18nStart} and {@link i18nEnd} in one instruction.
  14965. *
  14966. * The translation `message` is the value which is locale specific. The translation string may
  14967. * contain placeholders which associate inner elements and sub-templates within the translation.
  14968. *
  14969. * The translation `message` placeholders are:
  14970. * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be
  14971. * interpolated into. The placeholder `index` points to the expression binding index. An optional
  14972. * `block` that matches the sub-template in which it was declared.
  14973. * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*: Marks the beginning
  14974. * and end of DOM element that were embedded in the original translation block. The placeholder
  14975. * `index` points to the element index in the template instructions set. An optional `block` that
  14976. * matches the sub-template in which it was declared.
  14977. * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be
  14978. * split up and translated separately in each angular template function. The `index` points to the
  14979. * `template` instruction index. A `block` that matches the sub-template in which it was declared.
  14980. *
  14981. * @param index A unique index of the translation in the static block.
  14982. * @param messageIndex An index of the translation message from the `def.consts` array.
  14983. * @param subTemplateIndex Optional sub-template index in the `message`.
  14984. *
  14985. * @codeGenApi
  14986. */
  14987. declare function ɵɵi18n(index: number, messageIndex: number, subTemplateIndex?: number): void;
  14988. /**
  14989. * Marks a list of attributes as translatable.
  14990. *
  14991. * @param index A unique index in the static block
  14992. * @param values
  14993. *
  14994. * @codeGenApi
  14995. */
  14996. declare function ɵɵi18nAttributes(index: number, attrsIndex: number): void;
  14997. /**
  14998. * Stores the values of the bindings during each update cycle in order to determine if we need to
  14999. * update the translated nodes.
  15000. *
  15001. * @param value The binding's value
  15002. * @returns This function returns itself so that it may be chained
  15003. * (e.g. `i18nExp(ctx.name)(ctx.title)`)
  15004. *
  15005. * @codeGenApi
  15006. */
  15007. declare function ɵɵi18nExp<T>(value: T): typeof ɵɵi18nExp;
  15008. /**
  15009. * Updates a translation block or an i18n attribute when the bindings have changed.
  15010. *
  15011. * @param index Index of either {@link i18nStart} (translation block) or {@link i18nAttributes}
  15012. * (i18n attribute) on which it should update the content.
  15013. *
  15014. * @codeGenApi
  15015. */
  15016. declare function ɵɵi18nApply(index: number): void;
  15017. /**
  15018. * Handles message string post-processing for internationalization.
  15019. *
  15020. * Handles message string post-processing by transforming it from intermediate
  15021. * format (that might contain some markers that we need to replace) to the final
  15022. * form, consumable by i18nStart instruction. Post processing steps include:
  15023. *
  15024. * 1. Resolve all multi-value cases (like [�*1:1��#2:1�|�#4:1�|�5�])
  15025. * 2. Replace all ICU vars (like "VAR_PLURAL")
  15026. * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}
  15027. * 4. Replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�)
  15028. * in case multiple ICUs have the same placeholder name
  15029. *
  15030. * @param message Raw translation string for post processing
  15031. * @param replacements Set of replacements that should be applied
  15032. *
  15033. * @returns Transformed string that can be consumed by i18nStart instruction
  15034. *
  15035. * @codeGenApi
  15036. */
  15037. declare function ɵɵi18nPostprocess(message: string, replacements?: {
  15038. [key: string]: string | string[];
  15039. }): string;
  15040. /**
  15041. * Adds an event listener to the current node.
  15042. *
  15043. * If an output exists on one of the node's directives, it also subscribes to the output
  15044. * and saves the subscription for later cleanup.
  15045. *
  15046. * @param eventName Name of the event
  15047. * @param listenerFn The function to be called when event emits
  15048. * @param useCapture Whether or not to use capture in event listener - this argument is a reminder
  15049. * from the Renderer3 infrastructure and should be removed from the instruction arguments
  15050. * @param eventTargetResolver Function that returns global target information in case this listener
  15051. * should be attached to a global object like window, document or body
  15052. *
  15053. * @codeGenApi
  15054. */
  15055. declare function ɵɵlistener(eventName: string, listenerFn: (e?: any) => any, useCapture?: boolean, eventTargetResolver?: GlobalTargetResolver): typeof ɵɵlistener;
  15056. /**
  15057. * Registers a synthetic host listener (e.g. `(@foo.start)`) on a component or directive.
  15058. *
  15059. * This instruction is for compatibility purposes and is designed to ensure that a
  15060. * synthetic host listener (e.g. `@HostListener('@foo.start')`) properly gets rendered
  15061. * in the component's renderer. Normally all host listeners are evaluated with the
  15062. * parent component's renderer, but, in the case of animation @triggers, they need
  15063. * to be evaluated with the sub component's renderer (because that's where the
  15064. * animation triggers are defined).
  15065. *
  15066. * Do not use this instruction as a replacement for `listener`. This instruction
  15067. * only exists to ensure compatibility with the ViewEngine's host binding behavior.
  15068. *
  15069. * @param eventName Name of the event
  15070. * @param listenerFn The function to be called when event emits
  15071. * @param useCapture Whether or not to use capture in event listener
  15072. * @param eventTargetResolver Function that returns global target information in case this listener
  15073. * should be attached to a global object like window, document or body
  15074. *
  15075. * @codeGenApi
  15076. */
  15077. declare function ɵɵsyntheticHostListener(eventName: string, listenerFn: (e?: any) => any): typeof ɵɵsyntheticHostListener;
  15078. /**
  15079. * Retrieves a context at the level specified and saves it as the global, contextViewData.
  15080. * Will get the next level up if level is not specified.
  15081. *
  15082. * This is used to save contexts of parent views so they can be bound in embedded views, or
  15083. * in conjunction with reference() to bind a ref from a parent view.
  15084. *
  15085. * @param level The relative level of the view from which to grab context compared to contextVewData
  15086. * @returns context
  15087. *
  15088. * @codeGenApi
  15089. */
  15090. declare function ɵɵnextContext<T = any>(level?: number): T;
  15091. /**
  15092. * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.
  15093. * It takes all the selectors from the entire component's template and decides where
  15094. * each projected node belongs (it re-distributes nodes among "buckets" where each "bucket" is
  15095. * backed by a selector).
  15096. *
  15097. * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,
  15098. * un-parsed form.
  15099. *
  15100. * The parsed form is needed for efficient matching of a node against a given CSS selector.
  15101. * The un-parsed, textual form is needed for support of the ngProjectAs attribute.
  15102. *
  15103. * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more
  15104. * drawbacks:
  15105. * - having only a textual form would require runtime parsing of CSS selectors;
  15106. * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a
  15107. * template author).
  15108. *
  15109. * @param projectionSlots? A collection of projection slots. A projection slot can be based
  15110. * on a parsed CSS selectors or set to the wildcard selector ("*") in order to match
  15111. * all nodes which do not match any selector. If not specified, a single wildcard
  15112. * selector projection slot will be defined.
  15113. *
  15114. * @codeGenApi
  15115. */
  15116. declare function ɵɵprojectionDef(projectionSlots?: ProjectionSlots): void;
  15117. /**
  15118. * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call
  15119. * to the projectionDef instruction.
  15120. *
  15121. * @param nodeIndex Index of the projection node.
  15122. * @param selectorIndex Index of the slot selector.
  15123. * - 0 when the selector is `*` (or unspecified as this is the default value),
  15124. * - 1 based index of the selector from the {@link projectionDef}
  15125. * @param attrs Static attributes set on the `ng-content` node.
  15126. * @param fallbackTemplateFn Template function with fallback content.
  15127. * Will be rendered if the slot is empty at runtime.
  15128. * @param fallbackDecls Number of declarations in the fallback template.
  15129. * @param fallbackVars Number of variables in the fallback template.
  15130. *
  15131. * @codeGenApi
  15132. */
  15133. declare function ɵɵprojection(nodeIndex: number, selectorIndex?: number, attrs?: TAttributes, fallbackTemplateFn?: ComponentTemplate<unknown>, fallbackDecls?: number, fallbackVars?: number): void;
  15134. /**
  15135. * Update a property on a selected element.
  15136. *
  15137. * Operates on the element selected by index via the {@link select} instruction.
  15138. *
  15139. * If the property name also exists as an input property on one of the element's directives,
  15140. * the component property will be set instead of the element property. This check must
  15141. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled
  15142. *
  15143. * @param propName Name of property. Because it is going to DOM, this is not subject to
  15144. * renaming as part of minification.
  15145. * @param value New value to write.
  15146. * @param sanitizer An optional function used to sanitize the value.
  15147. * @returns This function returns itself so that it may be chained
  15148. * (e.g. `property('name', ctx.name)('title', ctx.title)`)
  15149. *
  15150. * @codeGenApi
  15151. */
  15152. declare function ɵɵproperty<T>(propName: string, value: T, sanitizer?: SanitizerFn | null): typeof ɵɵproperty;
  15153. /**
  15154. *
  15155. * Update an interpolated property on an element with a lone bound value
  15156. *
  15157. * Used when the value passed to a property has 1 interpolated value in it, an no additional text
  15158. * surrounds that interpolated value:
  15159. *
  15160. * ```html
  15161. * <div title="{{v0}}"></div>
  15162. * ```
  15163. *
  15164. * Its compiled representation is::
  15165. *
  15166. * ```ts
  15167. * ɵɵpropertyInterpolate('title', v0);
  15168. * ```
  15169. *
  15170. * If the property name also exists as an input property on one of the element's directives,
  15171. * the component property will be set instead of the element property. This check must
  15172. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15173. *
  15174. * @param propName The name of the property to update
  15175. * @param prefix Static value used for concatenation only.
  15176. * @param v0 Value checked for change.
  15177. * @param suffix Static value used for concatenation only.
  15178. * @param sanitizer An optional sanitizer function
  15179. * @returns itself, so that it may be chained.
  15180. * @codeGenApi
  15181. */
  15182. declare function ɵɵpropertyInterpolate(propName: string, v0: any, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate;
  15183. /**
  15184. *
  15185. * Update an interpolated property on an element with single bound value surrounded by text.
  15186. *
  15187. * Used when the value passed to a property has 1 interpolated value in it:
  15188. *
  15189. * ```html
  15190. * <div title="prefix{{v0}}suffix"></div>
  15191. * ```
  15192. *
  15193. * Its compiled representation is::
  15194. *
  15195. * ```ts
  15196. * ɵɵpropertyInterpolate1('title', 'prefix', v0, 'suffix');
  15197. * ```
  15198. *
  15199. * If the property name also exists as an input property on one of the element's directives,
  15200. * the component property will be set instead of the element property. This check must
  15201. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15202. *
  15203. * @param propName The name of the property to update
  15204. * @param prefix Static value used for concatenation only.
  15205. * @param v0 Value checked for change.
  15206. * @param suffix Static value used for concatenation only.
  15207. * @param sanitizer An optional sanitizer function
  15208. * @returns itself, so that it may be chained.
  15209. * @codeGenApi
  15210. */
  15211. declare function ɵɵpropertyInterpolate1(propName: string, prefix: string, v0: any, suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate1;
  15212. /**
  15213. *
  15214. * Update an interpolated property on an element with 2 bound values surrounded by text.
  15215. *
  15216. * Used when the value passed to a property has 2 interpolated values in it:
  15217. *
  15218. * ```html
  15219. * <div title="prefix{{v0}}-{{v1}}suffix"></div>
  15220. * ```
  15221. *
  15222. * Its compiled representation is::
  15223. *
  15224. * ```ts
  15225. * ɵɵpropertyInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
  15226. * ```
  15227. *
  15228. * If the property name also exists as an input property on one of the element's directives,
  15229. * the component property will be set instead of the element property. This check must
  15230. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15231. *
  15232. * @param propName The name of the property to update
  15233. * @param prefix Static value used for concatenation only.
  15234. * @param v0 Value checked for change.
  15235. * @param i0 Static value used for concatenation only.
  15236. * @param v1 Value checked for change.
  15237. * @param suffix Static value used for concatenation only.
  15238. * @param sanitizer An optional sanitizer function
  15239. * @returns itself, so that it may be chained.
  15240. * @codeGenApi
  15241. */
  15242. declare function ɵɵpropertyInterpolate2(propName: string, prefix: string, v0: any, i0: string, v1: any, suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate2;
  15243. /**
  15244. *
  15245. * Update an interpolated property on an element with 3 bound values surrounded by text.
  15246. *
  15247. * Used when the value passed to a property has 3 interpolated values in it:
  15248. *
  15249. * ```html
  15250. * <div title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
  15251. * ```
  15252. *
  15253. * Its compiled representation is::
  15254. *
  15255. * ```ts
  15256. * ɵɵpropertyInterpolate3(
  15257. * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
  15258. * ```
  15259. *
  15260. * If the property name also exists as an input property on one of the element's directives,
  15261. * the component property will be set instead of the element property. This check must
  15262. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15263. *
  15264. * @param propName The name of the property to update
  15265. * @param prefix Static value used for concatenation only.
  15266. * @param v0 Value checked for change.
  15267. * @param i0 Static value used for concatenation only.
  15268. * @param v1 Value checked for change.
  15269. * @param i1 Static value used for concatenation only.
  15270. * @param v2 Value checked for change.
  15271. * @param suffix Static value used for concatenation only.
  15272. * @param sanitizer An optional sanitizer function
  15273. * @returns itself, so that it may be chained.
  15274. * @codeGenApi
  15275. */
  15276. declare function ɵɵpropertyInterpolate3(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate3;
  15277. /**
  15278. *
  15279. * Update an interpolated property on an element with 4 bound values surrounded by text.
  15280. *
  15281. * Used when the value passed to a property has 4 interpolated values in it:
  15282. *
  15283. * ```html
  15284. * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
  15285. * ```
  15286. *
  15287. * Its compiled representation is::
  15288. *
  15289. * ```ts
  15290. * ɵɵpropertyInterpolate4(
  15291. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
  15292. * ```
  15293. *
  15294. * If the property name also exists as an input property on one of the element's directives,
  15295. * the component property will be set instead of the element property. This check must
  15296. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15297. *
  15298. * @param propName The name of the property to update
  15299. * @param prefix Static value used for concatenation only.
  15300. * @param v0 Value checked for change.
  15301. * @param i0 Static value used for concatenation only.
  15302. * @param v1 Value checked for change.
  15303. * @param i1 Static value used for concatenation only.
  15304. * @param v2 Value checked for change.
  15305. * @param i2 Static value used for concatenation only.
  15306. * @param v3 Value checked for change.
  15307. * @param suffix Static value used for concatenation only.
  15308. * @param sanitizer An optional sanitizer function
  15309. * @returns itself, so that it may be chained.
  15310. * @codeGenApi
  15311. */
  15312. 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;
  15313. /**
  15314. *
  15315. * Update an interpolated property on an element with 5 bound values surrounded by text.
  15316. *
  15317. * Used when the value passed to a property has 5 interpolated values in it:
  15318. *
  15319. * ```html
  15320. * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
  15321. * ```
  15322. *
  15323. * Its compiled representation is::
  15324. *
  15325. * ```ts
  15326. * ɵɵpropertyInterpolate5(
  15327. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
  15328. * ```
  15329. *
  15330. * If the property name also exists as an input property on one of the element's directives,
  15331. * the component property will be set instead of the element property. This check must
  15332. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15333. *
  15334. * @param propName The name of the property to update
  15335. * @param prefix Static value used for concatenation only.
  15336. * @param v0 Value checked for change.
  15337. * @param i0 Static value used for concatenation only.
  15338. * @param v1 Value checked for change.
  15339. * @param i1 Static value used for concatenation only.
  15340. * @param v2 Value checked for change.
  15341. * @param i2 Static value used for concatenation only.
  15342. * @param v3 Value checked for change.
  15343. * @param i3 Static value used for concatenation only.
  15344. * @param v4 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 ɵɵ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;
  15351. /**
  15352. *
  15353. * Update an interpolated property on an element with 6 bound values surrounded by text.
  15354. *
  15355. * Used when the value passed to a property has 6 interpolated values in it:
  15356. *
  15357. * ```html
  15358. * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
  15359. * ```
  15360. *
  15361. * Its compiled representation is::
  15362. *
  15363. * ```ts
  15364. * ɵɵpropertyInterpolate6(
  15365. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
  15366. * ```
  15367. *
  15368. * If the property name also exists as an input property on one of the element's directives,
  15369. * the component property will be set instead of the element property. This check must
  15370. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15371. *
  15372. * @param propName The name of the property to update
  15373. * @param prefix Static value used for concatenation only.
  15374. * @param v0 Value checked for change.
  15375. * @param i0 Static value used for concatenation only.
  15376. * @param v1 Value checked for change.
  15377. * @param i1 Static value used for concatenation only.
  15378. * @param v2 Value checked for change.
  15379. * @param i2 Static value used for concatenation only.
  15380. * @param v3 Value checked for change.
  15381. * @param i3 Static value used for concatenation only.
  15382. * @param v4 Value checked for change.
  15383. * @param i4 Static value used for concatenation only.
  15384. * @param v5 Value checked for change.
  15385. * @param suffix Static value used for concatenation only.
  15386. * @param sanitizer An optional sanitizer function
  15387. * @returns itself, so that it may be chained.
  15388. * @codeGenApi
  15389. */
  15390. 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;
  15391. /**
  15392. *
  15393. * Update an interpolated property on an element with 7 bound values surrounded by text.
  15394. *
  15395. * Used when the value passed to a property has 7 interpolated values in it:
  15396. *
  15397. * ```html
  15398. * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div>
  15399. * ```
  15400. *
  15401. * Its compiled representation is::
  15402. *
  15403. * ```ts
  15404. * ɵɵpropertyInterpolate7(
  15405. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
  15406. * ```
  15407. *
  15408. * If the property name also exists as an input property on one of the element's directives,
  15409. * the component property will be set instead of the element property. This check must
  15410. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15411. *
  15412. * @param propName The name of the property to update
  15413. * @param prefix Static value used for concatenation only.
  15414. * @param v0 Value checked for change.
  15415. * @param i0 Static value used for concatenation only.
  15416. * @param v1 Value checked for change.
  15417. * @param i1 Static value used for concatenation only.
  15418. * @param v2 Value checked for change.
  15419. * @param i2 Static value used for concatenation only.
  15420. * @param v3 Value checked for change.
  15421. * @param i3 Static value used for concatenation only.
  15422. * @param v4 Value checked for change.
  15423. * @param i4 Static value used for concatenation only.
  15424. * @param v5 Value checked for change.
  15425. * @param i5 Static value used for concatenation only.
  15426. * @param v6 Value checked for change.
  15427. * @param suffix Static value used for concatenation only.
  15428. * @param sanitizer An optional sanitizer function
  15429. * @returns itself, so that it may be chained.
  15430. * @codeGenApi
  15431. */
  15432. 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;
  15433. /**
  15434. *
  15435. * Update an interpolated property on an element with 8 bound values surrounded by text.
  15436. *
  15437. * Used when the value passed to a property has 8 interpolated values in it:
  15438. *
  15439. * ```html
  15440. * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div>
  15441. * ```
  15442. *
  15443. * Its compiled representation is::
  15444. *
  15445. * ```ts
  15446. * ɵɵpropertyInterpolate8(
  15447. * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
  15448. * ```
  15449. *
  15450. * If the property name also exists as an input property on one of the element's directives,
  15451. * the component property will be set instead of the element property. This check must
  15452. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15453. *
  15454. * @param propName The name of the property to update
  15455. * @param prefix Static value used for concatenation only.
  15456. * @param v0 Value checked for change.
  15457. * @param i0 Static value used for concatenation only.
  15458. * @param v1 Value checked for change.
  15459. * @param i1 Static value used for concatenation only.
  15460. * @param v2 Value checked for change.
  15461. * @param i2 Static value used for concatenation only.
  15462. * @param v3 Value checked for change.
  15463. * @param i3 Static value used for concatenation only.
  15464. * @param v4 Value checked for change.
  15465. * @param i4 Static value used for concatenation only.
  15466. * @param v5 Value checked for change.
  15467. * @param i5 Static value used for concatenation only.
  15468. * @param v6 Value checked for change.
  15469. * @param i6 Static value used for concatenation only.
  15470. * @param v7 Value checked for change.
  15471. * @param suffix Static value used for concatenation only.
  15472. * @param sanitizer An optional sanitizer function
  15473. * @returns itself, so that it may be chained.
  15474. * @codeGenApi
  15475. */
  15476. 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;
  15477. /**
  15478. * Update an interpolated property on an element with 9 or more bound values surrounded by text.
  15479. *
  15480. * Used when the number of interpolated values exceeds 8.
  15481. *
  15482. * ```html
  15483. * <div
  15484. * title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix"></div>
  15485. * ```
  15486. *
  15487. * Its compiled representation is::
  15488. *
  15489. * ```ts
  15490. * ɵɵpropertyInterpolateV(
  15491. * 'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
  15492. * 'suffix']);
  15493. * ```
  15494. *
  15495. * If the property name also exists as an input property on one of the element's directives,
  15496. * the component property will be set instead of the element property. This check must
  15497. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
  15498. *
  15499. * @param propName The name of the property to update.
  15500. * @param values The collection of values and the strings in between those values, beginning with a
  15501. * string prefix and ending with a string suffix.
  15502. * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
  15503. * @param sanitizer An optional sanitizer function
  15504. * @returns itself, so that it may be chained.
  15505. * @codeGenApi
  15506. */
  15507. declare function ɵɵpropertyInterpolateV(propName: string, values: any[], sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolateV;
  15508. /**
  15509. * Registers a QueryList, associated with a content query, for later refresh (part of a view
  15510. * refresh).
  15511. *
  15512. * @param directiveIndex Current directive index
  15513. * @param predicate The type for which the query will search
  15514. * @param flags Flags associated with the query
  15515. * @param read What to save in the query
  15516. * @returns QueryList<T>
  15517. *
  15518. * @codeGenApi
  15519. */
  15520. declare function ɵɵcontentQuery<T>(directiveIndex: number, predicate: ProviderToken<unknown> | string | string[], flags: QueryFlags, read?: any): void;
  15521. /**
  15522. * Creates a new view query by initializing internal data structures.
  15523. *
  15524. * @param predicate The type for which the query will search
  15525. * @param flags Flags associated with the query
  15526. * @param read What to save in the query
  15527. *
  15528. * @codeGenApi
  15529. */
  15530. declare function ɵɵviewQuery<T>(predicate: ProviderToken<unknown> | string | string[], flags: QueryFlags, read?: any): void;
  15531. /**
  15532. * Refreshes a query by combining matches from all active views and removing matches from deleted
  15533. * views.
  15534. *
  15535. * @returns `true` if a query got dirty during change detection or if this is a static query
  15536. * resolving in creation mode, `false` otherwise.
  15537. *
  15538. * @codeGenApi
  15539. */
  15540. declare function ɵɵqueryRefresh(queryList: QueryList<any>): boolean;
  15541. /**
  15542. * Loads a QueryList corresponding to the current view or content query.
  15543. *
  15544. * @codeGenApi
  15545. */
  15546. declare function ɵɵloadQuery<T>(): QueryList<T>;
  15547. /**
  15548. * Creates a new content query and binds it to a signal created by an authoring function.
  15549. *
  15550. * @param directiveIndex Current directive index
  15551. * @param target The target signal to which the query should be bound
  15552. * @param predicate The type for which the query will search
  15553. * @param flags Flags associated with the query
  15554. * @param read What to save in the query
  15555. *
  15556. * @codeGenApi
  15557. */
  15558. declare function ɵɵcontentQuerySignal<T>(directiveIndex: number, target: Signal<T>, predicate: ProviderToken<unknown> | string[], flags: QueryFlags, read?: any): void;
  15559. /**
  15560. * Creates a new view query by initializing internal data structures and binding a new query to the
  15561. * target signal.
  15562. *
  15563. * @param target The target signal to assign the query results to.
  15564. * @param predicate The type or label that should match a given query
  15565. * @param flags Flags associated with the query
  15566. * @param read What to save in the query
  15567. *
  15568. * @codeGenApi
  15569. */
  15570. declare function ɵɵviewQuerySignal(target: Signal<unknown>, predicate: ProviderToken<unknown> | string[], flags: QueryFlags, read?: ProviderToken<unknown>): void;
  15571. /**
  15572. * Advances the current query index by a specified offset.
  15573. *
  15574. * Adjusting the current query index is necessary in cases where a given directive has a mix of
  15575. * zone-based and signal-based queries. The signal-based queries don't require tracking of the
  15576. * current index (those are refreshed on demand and not during change detection) so this instruction
  15577. * is only necessary for backward-compatibility.
  15578. *
  15579. * @param index offset to apply to the current query index (defaults to 1)
  15580. *
  15581. * @codeGenApi
  15582. */
  15583. declare function ɵɵqueryAdvance(indexOffset?: number): void;
  15584. /**
  15585. * Retrieves a local reference from the current contextViewData.
  15586. *
  15587. * If the reference to retrieve is in a parent view, this instruction is used in conjunction
  15588. * with a nextContext() call, which walks up the tree and updates the contextViewData instance.
  15589. *
  15590. * @param index The index of the local ref in contextViewData.
  15591. *
  15592. * @codeGenApi
  15593. */
  15594. declare function ɵɵreference<T>(index: number): T;
  15595. /**
  15596. *
  15597. * Update an interpolated style on an element with single bound value surrounded by text.
  15598. *
  15599. * Used when the value passed to a property has 1 interpolated value in it:
  15600. *
  15601. * ```html
  15602. * <div style="key: {{v0}}suffix"></div>
  15603. * ```
  15604. *
  15605. * Its compiled representation is:
  15606. *
  15607. * ```ts
  15608. * ɵɵstyleMapInterpolate1('key: ', v0, 'suffix');
  15609. * ```
  15610. *
  15611. * @param prefix Static value used for concatenation only.
  15612. * @param v0 Value checked for change.
  15613. * @param suffix Static value used for concatenation only.
  15614. * @codeGenApi
  15615. */
  15616. declare function ɵɵstyleMapInterpolate1(prefix: string, v0: any, suffix: string): void;
  15617. /**
  15618. *
  15619. * Update an interpolated style on an element with 2 bound values surrounded by text.
  15620. *
  15621. * Used when the value passed to a property has 2 interpolated values in it:
  15622. *
  15623. * ```html
  15624. * <div style="key: {{v0}}; key1: {{v1}}suffix"></div>
  15625. * ```
  15626. *
  15627. * Its compiled representation is:
  15628. *
  15629. * ```ts
  15630. * ɵɵstyleMapInterpolate2('key: ', v0, '; key1: ', v1, 'suffix');
  15631. * ```
  15632. *
  15633. * @param prefix Static value used for concatenation only.
  15634. * @param v0 Value checked for change.
  15635. * @param i0 Static value used for concatenation only.
  15636. * @param v1 Value checked for change.
  15637. * @param suffix Static value used for concatenation only.
  15638. * @codeGenApi
  15639. */
  15640. declare function ɵɵstyleMapInterpolate2(prefix: string, v0: any, i0: string, v1: any, suffix: string): void;
  15641. /**
  15642. *
  15643. * Update an interpolated style on an element with 3 bound values surrounded by text.
  15644. *
  15645. * Used when the value passed to a property has 3 interpolated values in it:
  15646. *
  15647. * ```html
  15648. * <div style="key: {{v0}}; key2: {{v1}}; key2: {{v2}}suffix"></div>
  15649. * ```
  15650. *
  15651. * Its compiled representation is:
  15652. *
  15653. * ```ts
  15654. * ɵɵstyleMapInterpolate3(
  15655. * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '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 suffix Static value used for concatenation only.
  15665. * @codeGenApi
  15666. */
  15667. declare function ɵɵstyleMapInterpolate3(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string): void;
  15668. /**
  15669. *
  15670. * Update an interpolated style on an element with 4 bound values surrounded by text.
  15671. *
  15672. * Used when the value passed to a property has 4 interpolated values in it:
  15673. *
  15674. * ```html
  15675. * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}suffix"></div>
  15676. * ```
  15677. *
  15678. * Its compiled representation is:
  15679. *
  15680. * ```ts
  15681. * ɵɵstyleMapInterpolate4(
  15682. * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, 'suffix');
  15683. * ```
  15684. *
  15685. * @param prefix Static value used for concatenation only.
  15686. * @param v0 Value checked for change.
  15687. * @param i0 Static value used for concatenation only.
  15688. * @param v1 Value checked for change.
  15689. * @param i1 Static value used for concatenation only.
  15690. * @param v2 Value checked for change.
  15691. * @param i2 Static value used for concatenation only.
  15692. * @param v3 Value checked for change.
  15693. * @param suffix Static value used for concatenation only.
  15694. * @codeGenApi
  15695. */
  15696. declare function ɵɵstyleMapInterpolate4(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix: string): void;
  15697. /**
  15698. *
  15699. * Update an interpolated style on an element with 5 bound values surrounded by text.
  15700. *
  15701. * Used when the value passed to a property has 5 interpolated values in it:
  15702. *
  15703. * ```html
  15704. * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}suffix"></div>
  15705. * ```
  15706. *
  15707. * Its compiled representation is:
  15708. *
  15709. * ```ts
  15710. * ɵɵstyleMapInterpolate5(
  15711. * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, 'suffix');
  15712. * ```
  15713. *
  15714. * @param prefix Static value used for concatenation only.
  15715. * @param v0 Value checked for change.
  15716. * @param i0 Static value used for concatenation only.
  15717. * @param v1 Value checked for change.
  15718. * @param i1 Static value used for concatenation only.
  15719. * @param v2 Value checked for change.
  15720. * @param i2 Static value used for concatenation only.
  15721. * @param v3 Value checked for change.
  15722. * @param i3 Static value used for concatenation only.
  15723. * @param v4 Value checked for change.
  15724. * @param suffix Static value used for concatenation only.
  15725. * @codeGenApi
  15726. */
  15727. 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;
  15728. /**
  15729. *
  15730. * Update an interpolated style on an element with 6 bound values surrounded by text.
  15731. *
  15732. * Used when the value passed to a property has 6 interpolated values in it:
  15733. *
  15734. * ```html
  15735. * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}};
  15736. * key5: {{v5}}suffix"></div>
  15737. * ```
  15738. *
  15739. * Its compiled representation is:
  15740. *
  15741. * ```ts
  15742. * ɵɵstyleMapInterpolate6(
  15743. * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,
  15744. * 'suffix');
  15745. * ```
  15746. *
  15747. * @param prefix Static value used for concatenation only.
  15748. * @param v0 Value checked for change.
  15749. * @param i0 Static value used for concatenation only.
  15750. * @param v1 Value checked for change.
  15751. * @param i1 Static value used for concatenation only.
  15752. * @param v2 Value checked for change.
  15753. * @param i2 Static value used for concatenation only.
  15754. * @param v3 Value checked for change.
  15755. * @param i3 Static value used for concatenation only.
  15756. * @param v4 Value checked for change.
  15757. * @param i4 Static value used for concatenation only.
  15758. * @param v5 Value checked for change.
  15759. * @param suffix Static value used for concatenation only.
  15760. * @codeGenApi
  15761. */
  15762. 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;
  15763. /**
  15764. *
  15765. * Update an interpolated style on an element with 7 bound values surrounded by text.
  15766. *
  15767. * Used when the value passed to a property has 7 interpolated values in it:
  15768. *
  15769. * ```html
  15770. * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};
  15771. * key6: {{v6}}suffix"></div>
  15772. * ```
  15773. *
  15774. * Its compiled representation is:
  15775. *
  15776. * ```ts
  15777. * ɵɵstyleMapInterpolate7(
  15778. * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,
  15779. * '; key6: ', v6, 'suffix');
  15780. * ```
  15781. *
  15782. * @param prefix Static value used for concatenation only.
  15783. * @param v0 Value checked for change.
  15784. * @param i0 Static value used for concatenation only.
  15785. * @param v1 Value checked for change.
  15786. * @param i1 Static value used for concatenation only.
  15787. * @param v2 Value checked for change.
  15788. * @param i2 Static value used for concatenation only.
  15789. * @param v3 Value checked for change.
  15790. * @param i3 Static value used for concatenation only.
  15791. * @param v4 Value checked for change.
  15792. * @param i4 Static value used for concatenation only.
  15793. * @param v5 Value checked for change.
  15794. * @param i5 Static value used for concatenation only.
  15795. * @param v6 Value checked for change.
  15796. * @param suffix Static value used for concatenation only.
  15797. * @codeGenApi
  15798. */
  15799. 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;
  15800. /**
  15801. *
  15802. * Update an interpolated style on an element with 8 bound values surrounded by text.
  15803. *
  15804. * Used when the value passed to a property has 8 interpolated values in it:
  15805. *
  15806. * ```html
  15807. * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};
  15808. * key6: {{v6}}; key7: {{v7}}suffix"></div>
  15809. * ```
  15810. *
  15811. * Its compiled representation is:
  15812. *
  15813. * ```ts
  15814. * ɵɵstyleMapInterpolate8(
  15815. * 'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,
  15816. * '; key6: ', v6, '; key7: ', v7, 'suffix');
  15817. * ```
  15818. *
  15819. * @param prefix Static value used for concatenation only.
  15820. * @param v0 Value checked for change.
  15821. * @param i0 Static value used for concatenation only.
  15822. * @param v1 Value checked for change.
  15823. * @param i1 Static value used for concatenation only.
  15824. * @param v2 Value checked for change.
  15825. * @param i2 Static value used for concatenation only.
  15826. * @param v3 Value checked for change.
  15827. * @param i3 Static value used for concatenation only.
  15828. * @param v4 Value checked for change.
  15829. * @param i4 Static value used for concatenation only.
  15830. * @param v5 Value checked for change.
  15831. * @param i5 Static value used for concatenation only.
  15832. * @param v6 Value checked for change.
  15833. * @param i6 Static value used for concatenation only.
  15834. * @param v7 Value checked for change.
  15835. * @param suffix Static value used for concatenation only.
  15836. * @codeGenApi
  15837. */
  15838. 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;
  15839. /**
  15840. * Update an interpolated style on an element with 9 or more bound values surrounded by text.
  15841. *
  15842. * Used when the number of interpolated values exceeds 8.
  15843. *
  15844. * ```html
  15845. * <div
  15846. * class="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};
  15847. * key6: {{v6}}; key7: {{v7}}; key8: {{v8}}; key9: {{v9}}suffix"></div>
  15848. * ```
  15849. *
  15850. * Its compiled representation is:
  15851. *
  15852. * ```ts
  15853. * ɵɵstyleMapInterpolateV(
  15854. * ['key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,
  15855. * '; key6: ', v6, '; key7: ', v7, '; key8: ', v8, '; key9: ', v9, 'suffix']);
  15856. * ```
  15857. *.
  15858. * @param values The collection of values and the strings in-between those values, beginning with
  15859. * a string prefix and ending with a string suffix.
  15860. * (e.g. `['prefix', value0, '; key2: ', value1, '; key2: ', value2, ..., value99, 'suffix']`)
  15861. * @codeGenApi
  15862. */
  15863. declare function ɵɵstyleMapInterpolateV(values: any[]): void;
  15864. /**
  15865. *
  15866. * Update an interpolated style property on an element with single bound value surrounded by text.
  15867. *
  15868. * Used when the value passed to a property has 1 interpolated value in it:
  15869. *
  15870. * ```html
  15871. * <div style.color="prefix{{v0}}suffix"></div>
  15872. * ```
  15873. *
  15874. * Its compiled representation is:
  15875. *
  15876. * ```ts
  15877. * ɵɵstylePropInterpolate1(0, 'prefix', v0, 'suffix');
  15878. * ```
  15879. *
  15880. * @param styleIndex Index of style to update. This index value refers to the
  15881. * index of the style in the style bindings array that was passed into
  15882. * `styling`.
  15883. * @param prefix Static value used for concatenation only.
  15884. * @param v0 Value checked for change.
  15885. * @param suffix Static value used for concatenation only.
  15886. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  15887. * @returns itself, so that it may be chained.
  15888. * @codeGenApi
  15889. */
  15890. declare function ɵɵstylePropInterpolate1(prop: string, prefix: string, v0: any, suffix: string, valueSuffix?: string | null): typeof ɵɵstylePropInterpolate1;
  15891. /**
  15892. *
  15893. * Update an interpolated style property on an element with 2 bound values surrounded by text.
  15894. *
  15895. * Used when the value passed to a property has 2 interpolated values in it:
  15896. *
  15897. * ```html
  15898. * <div style.color="prefix{{v0}}-{{v1}}suffix"></div>
  15899. * ```
  15900. *
  15901. * Its compiled representation is:
  15902. *
  15903. * ```ts
  15904. * ɵɵstylePropInterpolate2(0, 'prefix', v0, '-', v1, 'suffix');
  15905. * ```
  15906. *
  15907. * @param styleIndex Index of style to update. This index value refers to the
  15908. * index of the style in the style bindings array that was passed into
  15909. * `styling`.
  15910. * @param prefix Static value used for concatenation only.
  15911. * @param v0 Value checked for change.
  15912. * @param i0 Static value used for concatenation only.
  15913. * @param v1 Value checked for change.
  15914. * @param suffix Static value used for concatenation only.
  15915. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  15916. * @returns itself, so that it may be chained.
  15917. * @codeGenApi
  15918. */
  15919. declare function ɵɵstylePropInterpolate2(prop: string, prefix: string, v0: any, i0: string, v1: any, suffix: string, valueSuffix?: string | null): typeof ɵɵstylePropInterpolate2;
  15920. /**
  15921. *
  15922. * Update an interpolated style property on an element with 3 bound values surrounded by text.
  15923. *
  15924. * Used when the value passed to a property has 3 interpolated values in it:
  15925. *
  15926. * ```html
  15927. * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
  15928. * ```
  15929. *
  15930. * Its compiled representation is:
  15931. *
  15932. * ```ts
  15933. * ɵɵstylePropInterpolate3(0, 'prefix', v0, '-', v1, '-', v2, 'suffix');
  15934. * ```
  15935. *
  15936. * @param styleIndex Index of style to update. This index value refers to the
  15937. * index of the style in the style bindings array that was passed into
  15938. * `styling`.
  15939. * @param prefix Static value used for concatenation only.
  15940. * @param v0 Value checked for change.
  15941. * @param i0 Static value used for concatenation only.
  15942. * @param v1 Value checked for change.
  15943. * @param i1 Static value used for concatenation only.
  15944. * @param v2 Value checked for change.
  15945. * @param suffix Static value used for concatenation only.
  15946. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  15947. * @returns itself, so that it may be chained.
  15948. * @codeGenApi
  15949. */
  15950. declare function ɵɵstylePropInterpolate3(prop: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string, valueSuffix?: string | null): typeof ɵɵstylePropInterpolate3;
  15951. /**
  15952. *
  15953. * Update an interpolated style property on an element with 4 bound values surrounded by text.
  15954. *
  15955. * Used when the value passed to a property has 4 interpolated values in it:
  15956. *
  15957. * ```html
  15958. * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
  15959. * ```
  15960. *
  15961. * Its compiled representation is:
  15962. *
  15963. * ```ts
  15964. * ɵɵstylePropInterpolate4(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
  15965. * ```
  15966. *
  15967. * @param styleIndex Index of style to update. This index value refers to the
  15968. * index of the style in the style bindings array that was passed into
  15969. * `styling`.
  15970. * @param prefix Static value used for concatenation only.
  15971. * @param v0 Value checked for change.
  15972. * @param i0 Static value used for concatenation only.
  15973. * @param v1 Value checked for change.
  15974. * @param i1 Static value used for concatenation only.
  15975. * @param v2 Value checked for change.
  15976. * @param i2 Static value used for concatenation only.
  15977. * @param v3 Value checked for change.
  15978. * @param suffix Static value used for concatenation only.
  15979. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  15980. * @returns itself, so that it may be chained.
  15981. * @codeGenApi
  15982. */
  15983. 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;
  15984. /**
  15985. *
  15986. * Update an interpolated style property on an element with 5 bound values surrounded by text.
  15987. *
  15988. * Used when the value passed to a property has 5 interpolated values in it:
  15989. *
  15990. * ```html
  15991. * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
  15992. * ```
  15993. *
  15994. * Its compiled representation is:
  15995. *
  15996. * ```ts
  15997. * ɵɵstylePropInterpolate5(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
  15998. * ```
  15999. *
  16000. * @param styleIndex Index of style to update. This index value refers to the
  16001. * index of the style in the style bindings array that was passed into
  16002. * `styling`.
  16003. * @param prefix Static value used for concatenation only.
  16004. * @param v0 Value checked for change.
  16005. * @param i0 Static value used for concatenation only.
  16006. * @param v1 Value checked for change.
  16007. * @param i1 Static value used for concatenation only.
  16008. * @param v2 Value checked for change.
  16009. * @param i2 Static value used for concatenation only.
  16010. * @param v3 Value checked for change.
  16011. * @param i3 Static value used for concatenation only.
  16012. * @param v4 Value checked for change.
  16013. * @param suffix Static value used for concatenation only.
  16014. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  16015. * @returns itself, so that it may be chained.
  16016. * @codeGenApi
  16017. */
  16018. 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;
  16019. /**
  16020. *
  16021. * Update an interpolated style property on an element with 6 bound values surrounded by text.
  16022. *
  16023. * Used when the value passed to a property has 6 interpolated values in it:
  16024. *
  16025. * ```html
  16026. * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
  16027. * ```
  16028. *
  16029. * Its compiled representation is:
  16030. *
  16031. * ```ts
  16032. * ɵɵstylePropInterpolate6(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
  16033. * ```
  16034. *
  16035. * @param styleIndex Index of style to update. This index value refers to the
  16036. * index of the style in the style bindings array that was passed into
  16037. * `styling`.
  16038. * @param prefix Static value used for concatenation only.
  16039. * @param v0 Value checked for change.
  16040. * @param i0 Static value used for concatenation only.
  16041. * @param v1 Value checked for change.
  16042. * @param i1 Static value used for concatenation only.
  16043. * @param v2 Value checked for change.
  16044. * @param i2 Static value used for concatenation only.
  16045. * @param v3 Value checked for change.
  16046. * @param i3 Static value used for concatenation only.
  16047. * @param v4 Value checked for change.
  16048. * @param i4 Static value used for concatenation only.
  16049. * @param v5 Value checked for change.
  16050. * @param suffix Static value used for concatenation only.
  16051. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  16052. * @returns itself, so that it may be chained.
  16053. * @codeGenApi
  16054. */
  16055. 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;
  16056. /**
  16057. *
  16058. * Update an interpolated style property on an element with 7 bound values surrounded by text.
  16059. *
  16060. * Used when the value passed to a property has 7 interpolated values in it:
  16061. *
  16062. * ```html
  16063. * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div>
  16064. * ```
  16065. *
  16066. * Its compiled representation is:
  16067. *
  16068. * ```ts
  16069. * ɵɵstylePropInterpolate7(
  16070. * 0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
  16071. * ```
  16072. *
  16073. * @param styleIndex Index of style to update. This index value refers to the
  16074. * index of the style in the style bindings array that was passed into
  16075. * `styling`.
  16076. * @param prefix Static value used for concatenation only.
  16077. * @param v0 Value checked for change.
  16078. * @param i0 Static value used for concatenation only.
  16079. * @param v1 Value checked for change.
  16080. * @param i1 Static value used for concatenation only.
  16081. * @param v2 Value checked for change.
  16082. * @param i2 Static value used for concatenation only.
  16083. * @param v3 Value checked for change.
  16084. * @param i3 Static value used for concatenation only.
  16085. * @param v4 Value checked for change.
  16086. * @param i4 Static value used for concatenation only.
  16087. * @param v5 Value checked for change.
  16088. * @param i5 Static value used for concatenation only.
  16089. * @param v6 Value checked for change.
  16090. * @param suffix Static value used for concatenation only.
  16091. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  16092. * @returns itself, so that it may be chained.
  16093. * @codeGenApi
  16094. */
  16095. 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;
  16096. /**
  16097. *
  16098. * Update an interpolated style property on an element with 8 bound values surrounded by text.
  16099. *
  16100. * Used when the value passed to a property has 8 interpolated values in it:
  16101. *
  16102. * ```html
  16103. * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div>
  16104. * ```
  16105. *
  16106. * Its compiled representation is:
  16107. *
  16108. * ```ts
  16109. * ɵɵstylePropInterpolate8(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6,
  16110. * '-', v7, 'suffix');
  16111. * ```
  16112. *
  16113. * @param styleIndex Index of style to update. This index value refers to the
  16114. * index of the style in the style bindings array that was passed into
  16115. * `styling`.
  16116. * @param prefix Static value used for concatenation only.
  16117. * @param v0 Value checked for change.
  16118. * @param i0 Static value used for concatenation only.
  16119. * @param v1 Value checked for change.
  16120. * @param i1 Static value used for concatenation only.
  16121. * @param v2 Value checked for change.
  16122. * @param i2 Static value used for concatenation only.
  16123. * @param v3 Value checked for change.
  16124. * @param i3 Static value used for concatenation only.
  16125. * @param v4 Value checked for change.
  16126. * @param i4 Static value used for concatenation only.
  16127. * @param v5 Value checked for change.
  16128. * @param i5 Static value used for concatenation only.
  16129. * @param v6 Value checked for change.
  16130. * @param i6 Static value used for concatenation only.
  16131. * @param v7 Value checked for change.
  16132. * @param suffix Static value used for concatenation only.
  16133. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  16134. * @returns itself, so that it may be chained.
  16135. * @codeGenApi
  16136. */
  16137. 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;
  16138. /**
  16139. * Update an interpolated style property on an element with 9 or more bound values surrounded by
  16140. * text.
  16141. *
  16142. * Used when the number of interpolated values exceeds 8.
  16143. *
  16144. * ```html
  16145. * <div
  16146. * style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix">
  16147. * </div>
  16148. * ```
  16149. *
  16150. * Its compiled representation is:
  16151. *
  16152. * ```ts
  16153. * ɵɵstylePropInterpolateV(
  16154. * 0, ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
  16155. * 'suffix']);
  16156. * ```
  16157. *
  16158. * @param styleIndex Index of style to update. This index value refers to the
  16159. * index of the style in the style bindings array that was passed into
  16160. * `styling`..
  16161. * @param values The collection of values and the strings in-between those values, beginning with
  16162. * a string prefix and ending with a string suffix.
  16163. * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
  16164. * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
  16165. * @returns itself, so that it may be chained.
  16166. * @codeGenApi
  16167. */
  16168. declare function ɵɵstylePropInterpolateV(prop: string, values: any[], valueSuffix?: string | null): typeof ɵɵstylePropInterpolateV;
  16169. /**
  16170. * Update a style binding on an element with the provided value.
  16171. *
  16172. * If the style value is falsy then it will be removed from the element
  16173. * (or assigned a different value depending if there are any styles placed
  16174. * on the element with `styleMap` or any static styles that are
  16175. * present from when the element was created with `styling`).
  16176. *
  16177. * Note that the styling element is updated as part of `stylingApply`.
  16178. *
  16179. * @param prop A valid CSS property.
  16180. * @param value New value to write (`null` or an empty string to remove).
  16181. * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.
  16182. *
  16183. * Note that this will apply the provided style value to the host element if this function is called
  16184. * within a host binding function.
  16185. *
  16186. * @codeGenApi
  16187. */
  16188. declare function ɵɵstyleProp(prop: string, value: string | number | SafeValue | undefined | null, suffix?: string | null): typeof ɵɵstyleProp;
  16189. /**
  16190. * Update a class binding on an element with the provided value.
  16191. *
  16192. * This instruction is meant to handle the `[class.foo]="exp"` case and,
  16193. * therefore, the class binding itself must already be allocated using
  16194. * `styling` within the creation block.
  16195. *
  16196. * @param prop A valid CSS class (only one).
  16197. * @param value A true/false value which will turn the class on or off.
  16198. *
  16199. * Note that this will apply the provided class value to the host element if this function
  16200. * is called within a host binding function.
  16201. *
  16202. * @codeGenApi
  16203. */
  16204. declare function ɵɵclassProp(className: string, value: boolean | undefined | null): typeof ɵɵclassProp;
  16205. /**
  16206. * Update style bindings using an object literal on an element.
  16207. *
  16208. * This instruction is meant to apply styling via the `[style]="exp"` template bindings.
  16209. * When styles are applied to the element they will then be updated with respect to
  16210. * any styles/classes set via `styleProp`. If any styles are set to falsy
  16211. * then they will be removed from the element.
  16212. *
  16213. * Note that the styling instruction will not be applied until `stylingApply` is called.
  16214. *
  16215. * @param styles A key/value style map of the styles that will be applied to the given element.
  16216. * Any missing styles (that have already been applied to the element beforehand) will be
  16217. * removed (unset) from the element's styling.
  16218. *
  16219. * Note that this will apply the provided styleMap value to the host element if this function
  16220. * is called within a host binding.
  16221. *
  16222. * @codeGenApi
  16223. */
  16224. declare function ɵɵstyleMap(styles: {
  16225. [styleName: string]: any;
  16226. } | string | undefined | null): void;
  16227. /**
  16228. * Update class bindings using an object literal or class-string on an element.
  16229. *
  16230. * This instruction is meant to apply styling via the `[class]="exp"` template bindings.
  16231. * When classes are applied to the element they will then be updated with
  16232. * respect to any styles/classes set via `classProp`. If any
  16233. * classes are set to falsy then they will be removed from the element.
  16234. *
  16235. * Note that the styling instruction will not be applied until `stylingApply` is called.
  16236. * Note that this will the provided classMap value to the host element if this function is called
  16237. * within a host binding.
  16238. *
  16239. * @param classes A key/value map or string of CSS classes that will be added to the
  16240. * given element. Any missing classes (that have already been applied to the element
  16241. * beforehand) will be removed (unset) from the element's list of CSS classes.
  16242. *
  16243. * @codeGenApi
  16244. */
  16245. declare function ɵɵclassMap(classes: {
  16246. [className: string]: boolean | undefined | null;
  16247. } | string | undefined | null): void;
  16248. /**
  16249. * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.
  16250. *
  16251. * <ng-template #foo>
  16252. * <div></div>
  16253. * </ng-template>
  16254. *
  16255. * @param index The index of the container in the data array
  16256. * @param templateFn Inline template
  16257. * @param decls The number of nodes, local refs, and pipes for this template
  16258. * @param vars The number of bindings for this template
  16259. * @param tagName The name of the container element, if applicable
  16260. * @param attrsIndex Index of template attributes in the `consts` array.
  16261. * @param localRefs Index of the local references in the `consts` array.
  16262. * @param localRefExtractor A function which extracts local-refs values from the template.
  16263. * Defaults to the current element associated with the local-ref.
  16264. *
  16265. * @codeGenApi
  16266. */
  16267. 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;
  16268. /**
  16269. * Create static text node
  16270. *
  16271. * @param index Index of the node in the data array
  16272. * @param value Static string value to write.
  16273. *
  16274. * @codeGenApi
  16275. */
  16276. declare function ɵɵtext(index: number, value?: string): void;
  16277. /**
  16278. *
  16279. * Update text content with a lone bound value
  16280. *
  16281. * Used when a text node has 1 interpolated value in it, an no additional text
  16282. * surrounds that interpolated value:
  16283. *
  16284. * ```html
  16285. * <div>{{v0}}</div>
  16286. * ```
  16287. *
  16288. * Its compiled representation is:
  16289. *
  16290. * ```ts
  16291. * ɵɵtextInterpolate(v0);
  16292. * ```
  16293. * @returns itself, so that it may be chained.
  16294. * @see textInterpolateV
  16295. * @codeGenApi
  16296. */
  16297. declare function ɵɵtextInterpolate(v0: any): typeof ɵɵtextInterpolate;
  16298. /**
  16299. *
  16300. * Update text content with single bound value surrounded by other text.
  16301. *
  16302. * Used when a text node has 1 interpolated value in it:
  16303. *
  16304. * ```html
  16305. * <div>prefix{{v0}}suffix</div>
  16306. * ```
  16307. *
  16308. * Its compiled representation is:
  16309. *
  16310. * ```ts
  16311. * ɵɵtextInterpolate1('prefix', v0, 'suffix');
  16312. * ```
  16313. * @returns itself, so that it may be chained.
  16314. * @see textInterpolateV
  16315. * @codeGenApi
  16316. */
  16317. declare function ɵɵtextInterpolate1(prefix: string, v0: any, suffix: string): typeof ɵɵtextInterpolate1;
  16318. /**
  16319. *
  16320. * Update text content with 2 bound values surrounded by other text.
  16321. *
  16322. * Used when a text node has 2 interpolated values in it:
  16323. *
  16324. * ```html
  16325. * <div>prefix{{v0}}-{{v1}}suffix</div>
  16326. * ```
  16327. *
  16328. * Its compiled representation is:
  16329. *
  16330. * ```ts
  16331. * ɵɵtextInterpolate2('prefix', v0, '-', v1, 'suffix');
  16332. * ```
  16333. * @returns itself, so that it may be chained.
  16334. * @see textInterpolateV
  16335. * @codeGenApi
  16336. */
  16337. declare function ɵɵtextInterpolate2(prefix: string, v0: any, i0: string, v1: any, suffix: string): typeof ɵɵtextInterpolate2;
  16338. /**
  16339. *
  16340. * Update text content with 3 bound values surrounded by other text.
  16341. *
  16342. * Used when a text node has 3 interpolated values in it:
  16343. *
  16344. * ```html
  16345. * <div>prefix{{v0}}-{{v1}}-{{v2}}suffix</div>
  16346. * ```
  16347. *
  16348. * Its compiled representation is:
  16349. *
  16350. * ```ts
  16351. * ɵɵtextInterpolate3(
  16352. * 'prefix', v0, '-', v1, '-', v2, 'suffix');
  16353. * ```
  16354. * @returns itself, so that it may be chained.
  16355. * @see textInterpolateV
  16356. * @codeGenApi
  16357. */
  16358. declare function ɵɵtextInterpolate3(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string): typeof ɵɵtextInterpolate3;
  16359. /**
  16360. *
  16361. * Update text content with 4 bound values surrounded by other text.
  16362. *
  16363. * Used when a text node has 4 interpolated values in it:
  16364. *
  16365. * ```html
  16366. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix</div>
  16367. * ```
  16368. *
  16369. * Its compiled representation is:
  16370. *
  16371. * ```ts
  16372. * ɵɵtextInterpolate4(
  16373. * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
  16374. * ```
  16375. * @returns itself, so that it may be chained.
  16376. * @see ɵɵtextInterpolateV
  16377. * @codeGenApi
  16378. */
  16379. declare function ɵɵtextInterpolate4(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix: string): typeof ɵɵtextInterpolate4;
  16380. /**
  16381. *
  16382. * Update text content with 5 bound values surrounded by other text.
  16383. *
  16384. * Used when a text node has 5 interpolated values in it:
  16385. *
  16386. * ```html
  16387. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix</div>
  16388. * ```
  16389. *
  16390. * Its compiled representation is:
  16391. *
  16392. * ```ts
  16393. * ɵɵtextInterpolate5(
  16394. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
  16395. * ```
  16396. * @returns itself, so that it may be chained.
  16397. * @see textInterpolateV
  16398. * @codeGenApi
  16399. */
  16400. 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;
  16401. /**
  16402. *
  16403. * Update text content with 6 bound values surrounded by other text.
  16404. *
  16405. * Used when a text node has 6 interpolated values in it:
  16406. *
  16407. * ```html
  16408. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix</div>
  16409. * ```
  16410. *
  16411. * Its compiled representation is:
  16412. *
  16413. * ```ts
  16414. * ɵɵtextInterpolate6(
  16415. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
  16416. * ```
  16417. *
  16418. * @param i4 Static value used for concatenation only.
  16419. * @param v5 Value checked for change. @returns itself, so that it may be chained.
  16420. * @see textInterpolateV
  16421. * @codeGenApi
  16422. */
  16423. 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;
  16424. /**
  16425. *
  16426. * Update text content with 7 bound values surrounded by other text.
  16427. *
  16428. * Used when a text node has 7 interpolated values in it:
  16429. *
  16430. * ```html
  16431. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix</div>
  16432. * ```
  16433. *
  16434. * Its compiled representation is:
  16435. *
  16436. * ```ts
  16437. * ɵɵtextInterpolate7(
  16438. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
  16439. * ```
  16440. * @returns itself, so that it may be chained.
  16441. * @see textInterpolateV
  16442. * @codeGenApi
  16443. */
  16444. 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;
  16445. /**
  16446. *
  16447. * Update text content with 8 bound values surrounded by other text.
  16448. *
  16449. * Used when a text node has 8 interpolated values in it:
  16450. *
  16451. * ```html
  16452. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix</div>
  16453. * ```
  16454. *
  16455. * Its compiled representation is:
  16456. *
  16457. * ```ts
  16458. * ɵɵtextInterpolate8(
  16459. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
  16460. * ```
  16461. * @returns itself, so that it may be chained.
  16462. * @see textInterpolateV
  16463. * @codeGenApi
  16464. */
  16465. 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;
  16466. /**
  16467. * Update text content with 9 or more bound values other surrounded by text.
  16468. *
  16469. * Used when the number of interpolated values exceeds 8.
  16470. *
  16471. * ```html
  16472. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix</div>
  16473. * ```
  16474. *
  16475. * Its compiled representation is:
  16476. *
  16477. * ```ts
  16478. * ɵɵtextInterpolateV(
  16479. * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
  16480. * 'suffix']);
  16481. * ```
  16482. *.
  16483. * @param values The collection of values and the strings in between those values, beginning with
  16484. * a string prefix and ending with a string suffix.
  16485. * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
  16486. *
  16487. * @returns itself, so that it may be chained.
  16488. * @codeGenApi
  16489. */
  16490. declare function ɵɵtextInterpolateV(values: any[]): typeof ɵɵtextInterpolateV;
  16491. /*!
  16492. * @license
  16493. * Copyright Google LLC All Rights Reserved.
  16494. *
  16495. * Use of this source code is governed by an MIT-style license that can be
  16496. * found in the LICENSE file at https://angular.dev/license
  16497. */
  16498. /**
  16499. * Update a two-way bound property on a selected element.
  16500. *
  16501. * Operates on the element selected by index via the {@link select} instruction.
  16502. *
  16503. * @param propName Name of property.
  16504. * @param value New value to write.
  16505. * @param sanitizer An optional function used to sanitize the value.
  16506. * @returns This function returns itself so that it may be chained
  16507. * (e.g. `twoWayProperty('name', ctx.name)('title', ctx.title)`)
  16508. *
  16509. * @codeGenApi
  16510. */
  16511. declare function ɵɵtwoWayProperty<T>(propName: string, value: T | WritableSignal<T>, sanitizer?: SanitizerFn | null): typeof ɵɵtwoWayProperty;
  16512. /**
  16513. * Function used inside two-way listeners to conditionally set the value of the bound expression.
  16514. *
  16515. * @param target Field on which to set the value.
  16516. * @param value Value to be set to the field.
  16517. *
  16518. * @codeGenApi
  16519. */
  16520. declare function ɵɵtwoWayBindingSet<T>(target: unknown, value: T): boolean;
  16521. /**
  16522. * Adds an event listener that updates a two-way binding to the current node.
  16523. *
  16524. * @param eventName Name of the event.
  16525. * @param listenerFn The function to be called when event emits.
  16526. *
  16527. * @codeGenApi
  16528. */
  16529. declare function ɵɵtwoWayListener(eventName: string, listenerFn: (e?: any) => any): typeof ɵɵtwoWayListener;
  16530. /*!
  16531. * @license
  16532. * Copyright Google LLC All Rights Reserved.
  16533. *
  16534. * Use of this source code is governed by an MIT-style license that can be
  16535. * found in the LICENSE file at https://angular.dev/license
  16536. */
  16537. /**
  16538. * Declares an `@let` at a specific data slot. Returns itself to allow chaining.
  16539. *
  16540. * @param index Index at which to declare the `@let`.
  16541. *
  16542. * @codeGenApi
  16543. */
  16544. declare function ɵɵdeclareLet(index: number): typeof ɵɵdeclareLet;
  16545. /**
  16546. * Instruction that stores the value of a `@let` declaration on the current view.
  16547. * Returns the value to allow usage inside variable initializers.
  16548. *
  16549. * @codeGenApi
  16550. */
  16551. declare function ɵɵstoreLet<T>(value: T): T;
  16552. /**
  16553. * Retrieves the value of a `@let` declaration defined in a parent view.
  16554. *
  16555. * @param index Index of the declaration within the view.
  16556. *
  16557. * @codeGenApi
  16558. */
  16559. declare function ɵɵreadContextLet<T>(index: number): T;
  16560. /*!
  16561. * @license
  16562. * Copyright Google LLC All Rights Reserved.
  16563. *
  16564. * Use of this source code is governed by an MIT-style license that can be
  16565. * found in the LICENSE file at https://angular.dev/license
  16566. */
  16567. /**
  16568. * Sets the location within the source template at which
  16569. * each element in the current view was defined.
  16570. *
  16571. * @param index Index at which the DOM node was created.
  16572. * @param templatePath Path to the template at which the node was defined.
  16573. * @param locations Element locations to which to attach the source location.
  16574. *
  16575. * @codeGenApi
  16576. */
  16577. declare function ɵɵattachSourceLocations(templatePath: string, locations: [index: number, offset: number, line: number, column: number][]): void;
  16578. /**
  16579. * Create a pipe.
  16580. *
  16581. * @param index Pipe index where the pipe will be stored.
  16582. * @param pipeName The name of the pipe
  16583. * @returns T the instance of the pipe.
  16584. *
  16585. * @codeGenApi
  16586. */
  16587. declare function ɵɵpipe(index: number, pipeName: string): any;
  16588. /**
  16589. * Invokes a pipe with 1 arguments.
  16590. *
  16591. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  16592. * the pipe only when an input to the pipe changes.
  16593. *
  16594. * @param index Pipe index where the pipe was stored on creation.
  16595. * @param offset the binding offset
  16596. * @param v1 1st argument to {@link PipeTransform#transform}.
  16597. *
  16598. * @codeGenApi
  16599. */
  16600. declare function ɵɵpipeBind1(index: number, offset: number, v1: any): any;
  16601. /**
  16602. * Invokes a pipe with 2 arguments.
  16603. *
  16604. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  16605. * the pipe only when an input to the pipe changes.
  16606. *
  16607. * @param index Pipe index where the pipe was stored on creation.
  16608. * @param slotOffset the offset in the reserved slot space
  16609. * @param v1 1st argument to {@link PipeTransform#transform}.
  16610. * @param v2 2nd argument to {@link PipeTransform#transform}.
  16611. *
  16612. * @codeGenApi
  16613. */
  16614. declare function ɵɵpipeBind2(index: number, slotOffset: number, v1: any, v2: any): any;
  16615. /**
  16616. * Invokes a pipe with 3 arguments.
  16617. *
  16618. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  16619. * the pipe only when an input to the pipe changes.
  16620. *
  16621. * @param index Pipe index where the pipe was stored on creation.
  16622. * @param slotOffset the offset in the reserved slot space
  16623. * @param v1 1st argument to {@link PipeTransform#transform}.
  16624. * @param v2 2nd argument to {@link PipeTransform#transform}.
  16625. * @param v3 4rd argument to {@link PipeTransform#transform}.
  16626. *
  16627. * @codeGenApi
  16628. */
  16629. declare function ɵɵpipeBind3(index: number, slotOffset: number, v1: any, v2: any, v3: any): any;
  16630. /**
  16631. * Invokes a pipe with 4 arguments.
  16632. *
  16633. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  16634. * the pipe only when an input to the pipe changes.
  16635. *
  16636. * @param index Pipe index where the pipe was stored on creation.
  16637. * @param slotOffset the offset in the reserved slot space
  16638. * @param v1 1st argument to {@link PipeTransform#transform}.
  16639. * @param v2 2nd argument to {@link PipeTransform#transform}.
  16640. * @param v3 3rd argument to {@link PipeTransform#transform}.
  16641. * @param v4 4th argument to {@link PipeTransform#transform}.
  16642. *
  16643. * @codeGenApi
  16644. */
  16645. declare function ɵɵpipeBind4(index: number, slotOffset: number, v1: any, v2: any, v3: any, v4: any): any;
  16646. /**
  16647. * Invokes a pipe with variable number of arguments.
  16648. *
  16649. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  16650. * the pipe only when an input to the pipe changes.
  16651. *
  16652. * @param index Pipe index where the pipe was stored on creation.
  16653. * @param slotOffset the offset in the reserved slot space
  16654. * @param values Array of arguments to pass to {@link PipeTransform#transform} method.
  16655. *
  16656. * @codeGenApi
  16657. */
  16658. declare function ɵɵpipeBindV(index: number, slotOffset: number, values: [any, ...any[]]): any;
  16659. /**
  16660. * Bindings for pure functions are stored after regular bindings.
  16661. *
  16662. * |-------decls------|---------vars---------| |----- hostVars (dir1) ------|
  16663. * ------------------------------------------------------------------------------------------
  16664. * | nodes/refs/pipes | bindings | fn slots | injector | dir1 | host bindings | host slots |
  16665. * ------------------------------------------------------------------------------------------
  16666. * ^ ^
  16667. * TView.bindingStartIndex TView.expandoStartIndex
  16668. *
  16669. * Pure function instructions are given an offset from the binding root. Adding the offset to the
  16670. * binding root gives the first index where the bindings are stored. In component views, the binding
  16671. * root is the bindingStartIndex. In host bindings, the binding root is the expandoStartIndex +
  16672. * any directive instances + any hostVars in directives evaluated before it.
  16673. *
  16674. * See VIEW_DATA.md for more information about host binding resolution.
  16675. */
  16676. /**
  16677. * If the value hasn't been saved, calls the pure function to store and return the
  16678. * value. If it has been saved, returns the saved value.
  16679. *
  16680. * @param slotOffset the offset from binding root to the reserved slot
  16681. * @param pureFn Function that returns a value
  16682. * @param thisArg Optional calling context of pureFn
  16683. * @returns value
  16684. *
  16685. * @codeGenApi
  16686. */
  16687. declare function ɵɵpureFunction0<T>(slotOffset: number, pureFn: () => T, thisArg?: any): T;
  16688. /**
  16689. * If the value of the provided exp has changed, calls the pure function to return
  16690. * an updated value. Or if the value has not changed, returns cached value.
  16691. *
  16692. * @param slotOffset the offset from binding root to the reserved slot
  16693. * @param pureFn Function that returns an updated value
  16694. * @param exp Updated expression value
  16695. * @param thisArg Optional calling context of pureFn
  16696. * @returns Updated or cached value
  16697. *
  16698. * @codeGenApi
  16699. */
  16700. declare function ɵɵpureFunction1(slotOffset: number, pureFn: (v: any) => any, exp: any, thisArg?: any): any;
  16701. /**
  16702. * If the value of any provided exp has changed, calls the pure function to return
  16703. * an updated value. Or if no values have changed, returns cached value.
  16704. *
  16705. * @param slotOffset the offset from binding root to the reserved slot
  16706. * @param pureFn
  16707. * @param exp1
  16708. * @param exp2
  16709. * @param thisArg Optional calling context of pureFn
  16710. * @returns Updated or cached value
  16711. *
  16712. * @codeGenApi
  16713. */
  16714. declare function ɵɵpureFunction2(slotOffset: number, pureFn: (v1: any, v2: any) => any, exp1: any, exp2: any, thisArg?: any): any;
  16715. /**
  16716. * If the value of any provided exp has changed, calls the pure function to return
  16717. * an updated value. Or if no values have changed, returns cached value.
  16718. *
  16719. * @param slotOffset the offset from binding root to the reserved slot
  16720. * @param pureFn
  16721. * @param exp1
  16722. * @param exp2
  16723. * @param exp3
  16724. * @param thisArg Optional calling context of pureFn
  16725. * @returns Updated or cached value
  16726. *
  16727. * @codeGenApi
  16728. */
  16729. declare function ɵɵpureFunction3(slotOffset: number, pureFn: (v1: any, v2: any, v3: any) => any, exp1: any, exp2: any, exp3: any, thisArg?: any): any;
  16730. /**
  16731. * If the value of any provided exp has changed, calls the pure function to return
  16732. * an updated value. Or if no values have changed, returns cached value.
  16733. *
  16734. * @param slotOffset the offset from binding root to the reserved slot
  16735. * @param pureFn
  16736. * @param exp1
  16737. * @param exp2
  16738. * @param exp3
  16739. * @param exp4
  16740. * @param thisArg Optional calling context of pureFn
  16741. * @returns Updated or cached value
  16742. *
  16743. * @codeGenApi
  16744. */
  16745. 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;
  16746. /**
  16747. * If the value of any provided exp has changed, calls the pure function to return
  16748. * an updated value. Or if no values have changed, returns cached value.
  16749. *
  16750. * @param slotOffset the offset from binding root to the reserved slot
  16751. * @param pureFn
  16752. * @param exp1
  16753. * @param exp2
  16754. * @param exp3
  16755. * @param exp4
  16756. * @param exp5
  16757. * @param thisArg Optional calling context of pureFn
  16758. * @returns Updated or cached value
  16759. *
  16760. * @codeGenApi
  16761. */
  16762. 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;
  16763. /**
  16764. * If the value of any provided exp has changed, calls the pure function to return
  16765. * an updated value. Or if no values have changed, returns cached value.
  16766. *
  16767. * @param slotOffset the offset from binding root to the reserved slot
  16768. * @param pureFn
  16769. * @param exp1
  16770. * @param exp2
  16771. * @param exp3
  16772. * @param exp4
  16773. * @param exp5
  16774. * @param exp6
  16775. * @param thisArg Optional calling context of pureFn
  16776. * @returns Updated or cached value
  16777. *
  16778. * @codeGenApi
  16779. */
  16780. 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;
  16781. /**
  16782. * If the value of any provided exp has changed, calls the pure function to return
  16783. * an updated value. Or if no values have changed, returns cached value.
  16784. *
  16785. * @param slotOffset the offset from binding root to the reserved slot
  16786. * @param pureFn
  16787. * @param exp1
  16788. * @param exp2
  16789. * @param exp3
  16790. * @param exp4
  16791. * @param exp5
  16792. * @param exp6
  16793. * @param exp7
  16794. * @param thisArg Optional calling context of pureFn
  16795. * @returns Updated or cached value
  16796. *
  16797. * @codeGenApi
  16798. */
  16799. 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;
  16800. /**
  16801. * If the value of any provided exp has changed, calls the pure function to return
  16802. * an updated value. Or if no values have changed, returns cached value.
  16803. *
  16804. * @param slotOffset the offset from binding root to the reserved slot
  16805. * @param pureFn
  16806. * @param exp1
  16807. * @param exp2
  16808. * @param exp3
  16809. * @param exp4
  16810. * @param exp5
  16811. * @param exp6
  16812. * @param exp7
  16813. * @param exp8
  16814. * @param thisArg Optional calling context of pureFn
  16815. * @returns Updated or cached value
  16816. *
  16817. * @codeGenApi
  16818. */
  16819. 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;
  16820. /**
  16821. * pureFunction instruction that can support any number of bindings.
  16822. *
  16823. * If the value of any provided exp has changed, calls the pure function to return
  16824. * an updated value. Or if no values have changed, returns cached value.
  16825. *
  16826. * @param slotOffset the offset from binding root to the reserved slot
  16827. * @param pureFn A pure function that takes binding values and builds an object or array
  16828. * containing those values.
  16829. * @param exps An array of binding values
  16830. * @param thisArg Optional calling context of pureFn
  16831. * @returns Updated or cached value
  16832. *
  16833. * @codeGenApi
  16834. */
  16835. declare function ɵɵpureFunctionV(slotOffset: number, pureFn: (...v: any[]) => any, exps: any[], thisArg?: any): any;
  16836. /**
  16837. *
  16838. * @codeGenApi
  16839. */
  16840. declare function ɵɵresolveWindow(element: RElement & {
  16841. ownerDocument: Document;
  16842. }): (Window & typeof globalThis) | null;
  16843. /**
  16844. *
  16845. * @codeGenApi
  16846. */
  16847. declare function ɵɵresolveDocument(element: RElement & {
  16848. ownerDocument: Document;
  16849. }): Document;
  16850. /**
  16851. *
  16852. * @codeGenApi
  16853. */
  16854. declare function ɵɵresolveBody(element: RElement & {
  16855. ownerDocument: Document;
  16856. }): HTMLElement;
  16857. /**
  16858. * Retrieves `TemplateRef` instance from `Injector` when a local reference is placed on the
  16859. * `<ng-template>` element.
  16860. *
  16861. * @codeGenApi
  16862. */
  16863. declare function ɵɵtemplateRefExtractor(tNode: TNode, lView: LView): TemplateRef<any> | null;
  16864. declare function ɵɵgetComponentDepsFactory(type: ComponentType<any>, rawImports?: RawScopeInfoFromDecorator[]): () => DependencyTypeList;
  16865. /**
  16866. * Sets the debug info for an Angular class.
  16867. *
  16868. * This runtime is guarded by ngDevMode flag.
  16869. */
  16870. declare function ɵsetClassDebugInfo(type: Type$1<any>, debugInfo: ClassDebugInfo): void;
  16871. /*!
  16872. * @license
  16873. * Copyright Google LLC All Rights Reserved.
  16874. *
  16875. * Use of this source code is governed by an MIT-style license that can be
  16876. * found in the LICENSE file at https://angular.dev/license
  16877. */
  16878. /** Represents `import.meta` plus some information that's not in the built-in types. */
  16879. type ImportMetaExtended = ImportMeta & {
  16880. hot?: {
  16881. send?: (name: string, payload: unknown) => void;
  16882. };
  16883. };
  16884. /**
  16885. * Gets the URL from which the client will fetch a new version of a component's metadata so it
  16886. * can be replaced during hot module reloading.
  16887. * @param id Unique ID for the component, generated during compile time.
  16888. * @param timestamp Time at which the request happened.
  16889. * @param base Base URL against which to resolve relative paths.
  16890. * @codeGenApi
  16891. */
  16892. declare function ɵɵgetReplaceMetadataURL(id: string, timestamp: string, base: string): string;
  16893. /**
  16894. * Replaces the metadata of a component type and re-renders all live instances of the component.
  16895. * @param type Class whose metadata will be replaced.
  16896. * @param applyMetadata Callback that will apply a new set of metadata on the `type` when invoked.
  16897. * @param environment Syntehtic namespace imports that need to be passed along to the callback.
  16898. * @param locals Local symbols from the source location that have to be exposed to the callback.
  16899. * @param importMeta `import.meta` from the call site of the replacement function. Optional since
  16900. * it isn't used internally.
  16901. * @param id ID to the class being replaced. **Not** the same as the component definition ID.
  16902. * Optional since the ID might not be available internally.
  16903. * @codeGenApi
  16904. */
  16905. 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;
  16906. /** Store a value in the `data` at a given `index`. */
  16907. declare function store<T>(tView: TView, lView: LView, index: number, value: T): void;
  16908. type Type = Function;
  16909. type OpaqueValue = unknown;
  16910. declare enum FactoryTarget {
  16911. Directive = 0,
  16912. Component = 1,
  16913. Injectable = 2,
  16914. Pipe = 3,
  16915. NgModule = 4
  16916. }
  16917. interface R3DeclareDependencyMetadataFacade {
  16918. token: OpaqueValue;
  16919. attribute?: boolean;
  16920. host?: boolean;
  16921. optional?: boolean;
  16922. self?: boolean;
  16923. skipSelf?: boolean;
  16924. }
  16925. interface R3HostDirectiveMetadataFacade {
  16926. directive: Type;
  16927. inputs?: string[];
  16928. outputs?: string[];
  16929. }
  16930. type LegacyInputPartialMapping = string | [bindingPropertyName: string, classPropertyName: string, transformFunction?: Function];
  16931. interface R3DeclareDirectiveFacade {
  16932. selector?: string;
  16933. type: Type;
  16934. version: string;
  16935. inputs?: {
  16936. [fieldName: string]: {
  16937. classPropertyName: string;
  16938. publicName: string;
  16939. isSignal: boolean;
  16940. isRequired: boolean;
  16941. transformFunction: Function | null;
  16942. } | LegacyInputPartialMapping;
  16943. };
  16944. outputs?: {
  16945. [classPropertyName: string]: string;
  16946. };
  16947. host?: {
  16948. attributes?: {
  16949. [key: string]: OpaqueValue;
  16950. };
  16951. listeners?: {
  16952. [key: string]: string;
  16953. };
  16954. properties?: {
  16955. [key: string]: string;
  16956. };
  16957. classAttribute?: string;
  16958. styleAttribute?: string;
  16959. };
  16960. queries?: R3DeclareQueryMetadataFacade[];
  16961. viewQueries?: R3DeclareQueryMetadataFacade[];
  16962. providers?: OpaqueValue;
  16963. exportAs?: string[];
  16964. usesInheritance?: boolean;
  16965. usesOnChanges?: boolean;
  16966. isStandalone?: boolean;
  16967. hostDirectives?: R3HostDirectiveMetadataFacade[] | null;
  16968. isSignal?: boolean;
  16969. }
  16970. interface R3DeclareComponentFacade extends R3DeclareDirectiveFacade {
  16971. template: string;
  16972. isInline?: boolean;
  16973. styles?: string[];
  16974. dependencies?: R3DeclareTemplateDependencyFacade[];
  16975. components?: R3DeclareDirectiveDependencyFacade[];
  16976. directives?: R3DeclareDirectiveDependencyFacade[];
  16977. pipes?: {
  16978. [pipeName: string]: OpaqueValue | (() => OpaqueValue);
  16979. };
  16980. deferBlockDependencies?: (() => Promise<Type> | null)[];
  16981. viewProviders?: OpaqueValue;
  16982. animations?: OpaqueValue;
  16983. changeDetection?: ChangeDetectionStrategy;
  16984. encapsulation?: ViewEncapsulation;
  16985. interpolation?: [string, string];
  16986. preserveWhitespaces?: boolean;
  16987. }
  16988. type R3DeclareTemplateDependencyFacade = {
  16989. kind: string;
  16990. } & (R3DeclareDirectiveDependencyFacade | R3DeclarePipeDependencyFacade | R3DeclareNgModuleDependencyFacade);
  16991. interface R3DeclareDirectiveDependencyFacade {
  16992. kind?: 'directive' | 'component';
  16993. selector: string;
  16994. type: OpaqueValue | (() => OpaqueValue);
  16995. inputs?: string[];
  16996. outputs?: string[];
  16997. exportAs?: string[];
  16998. }
  16999. interface R3DeclarePipeDependencyFacade {
  17000. kind?: 'pipe';
  17001. name: string;
  17002. type: OpaqueValue | (() => OpaqueValue);
  17003. }
  17004. interface R3DeclareNgModuleDependencyFacade {
  17005. kind: 'ngmodule';
  17006. type: OpaqueValue | (() => OpaqueValue);
  17007. }
  17008. interface R3DeclareFactoryFacade {
  17009. type: Type;
  17010. deps: R3DeclareDependencyMetadataFacade[] | 'invalid' | null;
  17011. target: FactoryTarget;
  17012. }
  17013. interface R3DeclareInjectableFacade {
  17014. type: Type;
  17015. providedIn?: Type | 'root' | 'platform' | 'any' | null;
  17016. useClass?: OpaqueValue;
  17017. useFactory?: OpaqueValue;
  17018. useExisting?: OpaqueValue;
  17019. useValue?: OpaqueValue;
  17020. deps?: R3DeclareDependencyMetadataFacade[];
  17021. }
  17022. declare enum ViewEncapsulation {
  17023. Emulated = 0,
  17024. None = 2,
  17025. ShadowDom = 3
  17026. }
  17027. type ChangeDetectionStrategy = number;
  17028. interface R3DeclareQueryMetadataFacade {
  17029. propertyName: string;
  17030. first?: boolean;
  17031. predicate: OpaqueValue | string[];
  17032. descendants?: boolean;
  17033. read?: OpaqueValue;
  17034. static?: boolean;
  17035. emitDistinctChangesOnly?: boolean;
  17036. isSignal?: boolean;
  17037. }
  17038. interface R3DeclareInjectorFacade {
  17039. type: Type;
  17040. imports?: OpaqueValue[];
  17041. providers?: OpaqueValue[];
  17042. }
  17043. interface R3DeclareNgModuleFacade {
  17044. type: Type;
  17045. bootstrap?: OpaqueValue[] | (() => OpaqueValue[]);
  17046. declarations?: OpaqueValue[] | (() => OpaqueValue[]);
  17047. imports?: OpaqueValue[] | (() => OpaqueValue[]);
  17048. exports?: OpaqueValue[] | (() => OpaqueValue[]);
  17049. schemas?: OpaqueValue[];
  17050. id?: OpaqueValue;
  17051. }
  17052. interface R3DeclarePipeFacade {
  17053. type: Type;
  17054. name: string;
  17055. version: string;
  17056. pure?: boolean;
  17057. isStandalone?: boolean;
  17058. }
  17059. /**
  17060. * Compile an Angular component according to its decorator metadata, and patch the resulting
  17061. * component def (ɵcmp) onto the component type.
  17062. *
  17063. * Compilation may be asynchronous (due to the need to resolve URLs for the component template or
  17064. * other resources, for example). In the event that compilation is not immediate, `compileComponent`
  17065. * will enqueue resource resolution into a global queue and will fail to return the `ɵcmp`
  17066. * until the global queue has been resolved with a call to `resolveComponentResources`.
  17067. */
  17068. declare function compileComponent(type: Type$1<any>, metadata: Component): void;
  17069. /**
  17070. * Compile an Angular directive according to its decorator metadata, and patch the resulting
  17071. * directive def onto the component type.
  17072. *
  17073. * In the event that compilation is not immediate, `compileDirective` will return a `Promise` which
  17074. * will resolve when compilation completes and the directive becomes usable.
  17075. */
  17076. declare function compileDirective(type: Type$1<any>, directive: Directive | null): void;
  17077. declare function resetJitOptions(): void;
  17078. /**
  17079. * Loops over queued module definitions, if a given module definition has all of its
  17080. * declarations resolved, it dequeues that module definition and sets the scope on
  17081. * its declarations.
  17082. */
  17083. declare function flushModuleScopingQueueAsMuchAsPossible(): void;
  17084. /**
  17085. * Compiles a module in JIT mode.
  17086. *
  17087. * This function automatically gets called when a class has a `@NgModule` decorator.
  17088. */
  17089. declare function compileNgModule(moduleType: Type$1<any>, ngModule?: NgModule): void;
  17090. /**
  17091. * Compiles and adds the `ɵmod`, `ɵfac` and `ɵinj` properties to the module class.
  17092. *
  17093. * It's possible to compile a module via this API which will allow duplicate declarations in its
  17094. * root.
  17095. */
  17096. declare function compileNgModuleDefs(moduleType: NgModuleType, ngModule: NgModule, allowDuplicateDeclarationsInRoot?: boolean): void;
  17097. declare function generateStandaloneInDeclarationsError(type: Type$1<any>, location: string): string;
  17098. declare function resetCompiledComponents(): void;
  17099. /**
  17100. * Patch the definition of a component with directives and pipes from the compilation scope of
  17101. * a given module.
  17102. */
  17103. declare function patchComponentDefWithScope<C>(componentDef: ComponentDef<C>, transitiveScopes: NgModuleTransitiveScopes): void;
  17104. /**
  17105. * Compute the pair of transitive scopes (compilation scope and exported scope) for a given type
  17106. * (either a NgModule or a standalone component / directive / pipe).
  17107. */
  17108. declare function transitiveScopesFor<T>(type: Type$1<T>): NgModuleTransitiveScopes;
  17109. /**
  17110. * Compiles a partial directive declaration object into a full directive definition object.
  17111. *
  17112. * @codeGenApi
  17113. */
  17114. declare function ɵɵngDeclareDirective(decl: R3DeclareDirectiveFacade): unknown;
  17115. /**
  17116. * Evaluates the class metadata declaration.
  17117. *
  17118. * @codeGenApi
  17119. */
  17120. declare function ɵɵngDeclareClassMetadata(decl: {
  17121. type: Type$1<any>;
  17122. decorators: any[];
  17123. ctorParameters?: () => any[];
  17124. propDecorators?: {
  17125. [field: string]: any;
  17126. };
  17127. }): void;
  17128. /**
  17129. * Evaluates the class metadata of a component that contains deferred blocks.
  17130. *
  17131. * @codeGenApi
  17132. */
  17133. declare function ɵɵngDeclareClassMetadataAsync(decl: {
  17134. type: Type$1<any>;
  17135. resolveDeferredDeps: () => Promise<Type$1<unknown>>[];
  17136. resolveMetadata: (...types: Type$1<unknown>[]) => {
  17137. decorators: any[];
  17138. ctorParameters: (() => any[]) | null;
  17139. propDecorators: {
  17140. [field: string]: any;
  17141. } | null;
  17142. };
  17143. }): void;
  17144. /**
  17145. * Compiles a partial component declaration object into a full component definition object.
  17146. *
  17147. * @codeGenApi
  17148. */
  17149. declare function ɵɵngDeclareComponent(decl: R3DeclareComponentFacade): unknown;
  17150. /**
  17151. * Compiles a partial pipe declaration object into a full pipe definition object.
  17152. *
  17153. * @codeGenApi
  17154. */
  17155. declare function ɵɵngDeclareFactory(decl: R3DeclareFactoryFacade): unknown;
  17156. /**
  17157. * Compiles a partial injectable declaration object into a full injectable definition object.
  17158. *
  17159. * @codeGenApi
  17160. */
  17161. declare function ɵɵngDeclareInjectable(decl: R3DeclareInjectableFacade): unknown;
  17162. /**
  17163. * Compiles a partial injector declaration object into a full injector definition object.
  17164. *
  17165. * @codeGenApi
  17166. */
  17167. declare function ɵɵngDeclareInjector(decl: R3DeclareInjectorFacade): unknown;
  17168. /**
  17169. * Compiles a partial NgModule declaration object into a full NgModule definition object.
  17170. *
  17171. * @codeGenApi
  17172. */
  17173. declare function ɵɵngDeclareNgModule(decl: R3DeclareNgModuleFacade): unknown;
  17174. /**
  17175. * Compiles a partial pipe declaration object into a full pipe definition object.
  17176. *
  17177. * @codeGenApi
  17178. */
  17179. declare function ɵɵngDeclarePipe(decl: R3DeclarePipeFacade): unknown;
  17180. declare function compilePipe(type: Type$1<any>, meta: Pipe): void;
  17181. declare function isNgModule<T>(value: Type$1<T>): value is Type$1<T> & {
  17182. ɵmod: NgModuleDef<T>;
  17183. };
  17184. /*!
  17185. * @license
  17186. * Copyright Google LLC All Rights Reserved.
  17187. *
  17188. * Use of this source code is governed by an MIT-style license that can be
  17189. * found in the LICENSE file at https://angular.dev/license
  17190. */
  17191. /**
  17192. * Profiler events is an enum used by the profiler to distinguish between different calls of user
  17193. * code invoked throughout the application lifecycle.
  17194. */
  17195. declare const enum ProfilerEvent {
  17196. /**
  17197. * Corresponds to the point in time before the runtime has called the template function of a
  17198. * component with `RenderFlags.Create`.
  17199. */
  17200. TemplateCreateStart = 0,
  17201. /**
  17202. * Corresponds to the point in time after the runtime has called the template function of a
  17203. * component with `RenderFlags.Create`.
  17204. */
  17205. TemplateCreateEnd = 1,
  17206. /**
  17207. * Corresponds to the point in time before the runtime has called the template function of a
  17208. * component with `RenderFlags.Update`.
  17209. */
  17210. TemplateUpdateStart = 2,
  17211. /**
  17212. * Corresponds to the point in time after the runtime has called the template function of a
  17213. * component with `RenderFlags.Update`.
  17214. */
  17215. TemplateUpdateEnd = 3,
  17216. /**
  17217. * Corresponds to the point in time before the runtime has called a lifecycle hook of a component
  17218. * or directive.
  17219. */
  17220. LifecycleHookStart = 4,
  17221. /**
  17222. * Corresponds to the point in time after the runtime has called a lifecycle hook of a component
  17223. * or directive.
  17224. */
  17225. LifecycleHookEnd = 5,
  17226. /**
  17227. * Corresponds to the point in time before the runtime has evaluated an expression associated with
  17228. * an event or an output.
  17229. */
  17230. OutputStart = 6,
  17231. /**
  17232. * Corresponds to the point in time after the runtime has evaluated an expression associated with
  17233. * an event or an output.
  17234. */
  17235. OutputEnd = 7,
  17236. /**
  17237. * Corresponds to the point in time just before application bootstrap.
  17238. */
  17239. BootstrapApplicationStart = 8,
  17240. /**
  17241. * Corresponds to the point in time after application bootstrap.
  17242. */
  17243. BootstrapApplicationEnd = 9,
  17244. /**
  17245. * Corresponds to the point in time just before root component bootstrap.
  17246. */
  17247. BootstrapComponentStart = 10,
  17248. /**
  17249. * Corresponds to the point in time after root component bootstrap.
  17250. */
  17251. BootstrapComponentEnd = 11,
  17252. /**
  17253. * Corresponds to the point in time just before Angular starts a change detection tick.
  17254. */
  17255. ChangeDetectionStart = 12,
  17256. /**
  17257. * Corresponds to the point in time after Angular ended a change detection tick.
  17258. */
  17259. ChangeDetectionEnd = 13,
  17260. /**
  17261. * Corresponds to the point in time just before Angular starts a new synchronization pass of change detection tick.
  17262. */
  17263. ChangeDetectionSyncStart = 14,
  17264. /**
  17265. * Corresponds to the point in time after Angular ended a synchronization pass.
  17266. */
  17267. ChangeDetectionSyncEnd = 15,
  17268. /**
  17269. * Corresponds to the point in time just before Angular executes after render hooks.
  17270. */
  17271. AfterRenderHooksStart = 16,
  17272. /**
  17273. * Corresponds to the point in time after Angular executed after render hooks.
  17274. */
  17275. AfterRenderHooksEnd = 17,
  17276. /**
  17277. * Corresponds to the point in time just before Angular starts processing a component (create or update).
  17278. */
  17279. ComponentStart = 18,
  17280. /**
  17281. * Corresponds to the point in time after Angular finished processing a component.
  17282. */
  17283. ComponentEnd = 19,
  17284. /**
  17285. * Corresponds to the point in time just before a defer block transitions between states.
  17286. */
  17287. DeferBlockStateStart = 20,
  17288. /**
  17289. * Corresponds to the point in time after a defer block transitioned between states.
  17290. */
  17291. DeferBlockStateEnd = 21,
  17292. /**
  17293. * Corresponds to the point in time just before a component instance is created dynamically.
  17294. */
  17295. DynamicComponentStart = 22,
  17296. /**
  17297. * Corresponds to the point in time after a a component instance is created dynamically.
  17298. */
  17299. DynamicComponentEnd = 23,
  17300. /**
  17301. * Corresponds to the point in time before the runtime has called the host bindings function
  17302. * of a directive.
  17303. */
  17304. HostBindingsUpdateStart = 24,
  17305. /**
  17306. * Corresponds to the point in time after the runtime has called the host bindings function
  17307. * of a directive.
  17308. */
  17309. HostBindingsUpdateEnd = 25
  17310. }
  17311. /**
  17312. * Profiler function which the runtime will invoke before and after user code.
  17313. */
  17314. interface Profiler {
  17315. (event: ProfilerEvent, instance?: {} | null, hookOrListener?: (e?: any) => any): void;
  17316. }
  17317. /**
  17318. * Marks a component for check (in case of OnPush components) and synchronously
  17319. * performs change detection on the application this component belongs to.
  17320. *
  17321. * @param component Component to {@link /api/core/ChangeDetectorRef#markForCheck mark for check}
  17322. *
  17323. * @publicApi
  17324. */
  17325. declare function applyChanges(component: {}): void;
  17326. /*!
  17327. * @license
  17328. * Copyright Google LLC All Rights Reserved.
  17329. *
  17330. * Use of this source code is governed by an MIT-style license that can be
  17331. * found in the LICENSE file at https://angular.dev/license
  17332. */
  17333. /** Retrieved information about a `@defer` block. */
  17334. interface DeferBlockData {
  17335. /** Current state of the block. */
  17336. state: 'placeholder' | 'loading' | 'complete' | 'error' | 'initial';
  17337. /** Hydration state of the block. */
  17338. incrementalHydrationState: 'not-configured' | 'hydrated' | 'dehydrated';
  17339. /** Wherther the block has a connected `@error` block. */
  17340. hasErrorBlock: boolean;
  17341. /** Information about the connected `@loading` block. */
  17342. loadingBlock: {
  17343. /** Whether the block is defined. */
  17344. exists: boolean;
  17345. /** Minimum amount of milliseconds that the block should be shown. */
  17346. minimumTime: number | null;
  17347. /** Amount of time after which the block should be shown. */
  17348. afterTime: number | null;
  17349. };
  17350. /** Information about the connected `@placeholder` block. */
  17351. placeholderBlock: {
  17352. /** Whether the block is defined. */
  17353. exists: boolean;
  17354. /** Minimum amount of time that block should be shown. */
  17355. minimumTime: number | null;
  17356. };
  17357. /** Stringified version of the block's triggers. */
  17358. triggers: string[];
  17359. /** Element root nodes that are currently being shown in the block. */
  17360. rootNodes: Node[];
  17361. }
  17362. /**
  17363. * Gets all of the `@defer` blocks that are present inside the specified DOM node.
  17364. * @param node Node in which to look for `@defer` blocks.
  17365. *
  17366. * @publicApi
  17367. */
  17368. declare function getDeferBlocks(node: Node): DeferBlockData[];
  17369. /**
  17370. * Discovers the dependencies of an injectable instance. Provides DI information about each
  17371. * dependency that the injectable was instantiated with, including where they were provided from.
  17372. *
  17373. * @param injector An injector instance
  17374. * @param token a DI token that was constructed by the given injector instance
  17375. * @returns an object that contains the created instance of token as well as all of the dependencies
  17376. * that it was instantiated with OR undefined if the token was not created within the given
  17377. * injector.
  17378. */
  17379. declare function getDependenciesFromInjectable<T>(injector: Injector, token: Type$1<T> | InjectionToken<T>): {
  17380. instance: T;
  17381. dependencies: Omit<InjectedService, 'injectedIn'>[];
  17382. } | undefined;
  17383. /**
  17384. * Gets the providers configured on an injector.
  17385. *
  17386. * @param injector the injector to lookup the providers of
  17387. * @returns ProviderRecord[] an array of objects representing the providers of the given injector
  17388. */
  17389. declare function getInjectorProviders(injector: Injector): ProviderRecord[];
  17390. /**
  17391. *
  17392. * Given an injector, this function will return
  17393. * an object containing the type and source of the injector.
  17394. *
  17395. * | | type | source |
  17396. * |--------------|-------------|-------------------------------------------------------------|
  17397. * | NodeInjector | element | DOM element that created this injector |
  17398. * | R3Injector | environment | `injector.source` |
  17399. * | NullInjector | null | null |
  17400. *
  17401. * @param injector the Injector to get metadata for
  17402. * @returns an object containing the type and source of the given injector. If the injector metadata
  17403. * cannot be determined, returns null.
  17404. */
  17405. declare function getInjectorMetadata(injector: Injector): {
  17406. type: 'element';
  17407. source: RElement;
  17408. } | {
  17409. type: 'environment';
  17410. source: string | null;
  17411. } | {
  17412. type: 'null';
  17413. source: null;
  17414. } | null;
  17415. declare function getInjectorResolutionPath(injector: Injector): Injector[];
  17416. interface DebugSignalGraphNode {
  17417. kind: string;
  17418. label?: string;
  17419. value?: unknown;
  17420. }
  17421. interface DebugSignalGraphEdge {
  17422. /**
  17423. * Index of a signal node in the `nodes` array that is a consumer of the signal produced by the producer node.
  17424. */
  17425. consumer: number;
  17426. /**
  17427. * Index of a signal node in the `nodes` array that is a producer of the signal consumed by the consumer node.
  17428. */
  17429. producer: number;
  17430. }
  17431. /**
  17432. * A debug representation of the signal graph.
  17433. */
  17434. interface DebugSignalGraph {
  17435. nodes: DebugSignalGraphNode[];
  17436. edges: DebugSignalGraphEdge[];
  17437. }
  17438. /**
  17439. * Returns a debug representation of the signal graph for the given injector.
  17440. *
  17441. * Currently only supports element injectors. Starts by discovering the consumer nodes
  17442. * and then traverses their producer nodes to build the signal graph.
  17443. *
  17444. * @param injector The injector to get the signal graph for.
  17445. * @returns A debug representation of the signal graph.
  17446. * @throws If the injector is an environment injector.
  17447. */
  17448. declare function getSignalGraph(injector: Injector): DebugSignalGraph;
  17449. /**
  17450. * This file introduces series of globally accessible debug tools
  17451. * to allow for the Angular debugging story to function.
  17452. *
  17453. * To see this in action run the following command:
  17454. *
  17455. * bazel run //packages/core/test/bundling/todo:devserver
  17456. *
  17457. * Then load `localhost:5432` and start using the console tools.
  17458. */
  17459. /**
  17460. * This value reflects the property on the window where the dev
  17461. * tools are patched (window.ng).
  17462. * */
  17463. declare const GLOBAL_PUBLISH_EXPANDO_KEY = "ng";
  17464. interface NgGlobalPublishUtils {
  17465. ɵgetLoadedRoutes(route: any): any;
  17466. }
  17467. declare const globalUtilsFunctions: {
  17468. /**
  17469. * Warning: functions that start with `ɵ` are considered *INTERNAL* and should not be relied upon
  17470. * in application's code. The contract of those functions might be changed in any release and/or a
  17471. * function can be removed completely.
  17472. */
  17473. ɵgetDependenciesFromInjectable: typeof getDependenciesFromInjectable;
  17474. ɵgetInjectorProviders: typeof getInjectorProviders;
  17475. ɵgetInjectorResolutionPath: typeof getInjectorResolutionPath;
  17476. ɵgetInjectorMetadata: typeof getInjectorMetadata;
  17477. ɵsetProfiler: (profiler: _angular_core.ɵProfiler | null) => void;
  17478. ɵgetSignalGraph: typeof getSignalGraph;
  17479. ɵgetDeferBlocks: typeof getDeferBlocks;
  17480. getDirectiveMetadata: typeof getDirectiveMetadata;
  17481. getComponent: typeof getComponent;
  17482. getContext: typeof getContext;
  17483. getListeners: typeof getListeners;
  17484. getOwningComponent: typeof getOwningComponent;
  17485. getHostElement: typeof getHostElement;
  17486. getInjector: typeof getInjector;
  17487. getRootComponents: typeof getRootComponents;
  17488. getDirectives: typeof getDirectives;
  17489. applyChanges: typeof applyChanges;
  17490. isSignal: typeof isSignal;
  17491. };
  17492. type ExternalGlobalUtilsFunctions = keyof NgGlobalPublishUtils;
  17493. /**
  17494. * Default debug tools available under `window.ng`.
  17495. */
  17496. type GlobalDevModeUtils = {
  17497. [GLOBAL_PUBLISH_EXPANDO_KEY]: typeof globalUtilsFunctions;
  17498. };
  17499. /**
  17500. * Publishes the given function to `window.ng` from package other than @angular/core
  17501. * So that it can be used from the browser console when an application is not in production.
  17502. */
  17503. declare function publishExternalGlobalUtil<K extends ExternalGlobalUtilsFunctions>(name: K, fn: NgGlobalPublishUtils[K]): void;
  17504. /**
  17505. * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing
  17506. * dangerous content.
  17507. *
  17508. * This method parses the `html` and locates potentially dangerous content (such as urls and
  17509. * javascript) and removes it.
  17510. *
  17511. * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.
  17512. *
  17513. * @param unsafeHtml untrusted `html`, typically from the user.
  17514. * @returns `html` string which is safe to display to user, because all of the dangerous javascript
  17515. * and urls have been removed.
  17516. *
  17517. * @codeGenApi
  17518. */
  17519. declare function ɵɵsanitizeHtml(unsafeHtml: any): TrustedHTML | string;
  17520. /**
  17521. * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing
  17522. * dangerous content.
  17523. *
  17524. * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.
  17525. *
  17526. * @param unsafeStyle untrusted `style`, typically from the user.
  17527. * @returns `style` string which is safe to bind to the `style` properties.
  17528. *
  17529. * @codeGenApi
  17530. */
  17531. declare function ɵɵsanitizeStyle(unsafeStyle: any): string;
  17532. /**
  17533. * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing
  17534. * dangerous
  17535. * content.
  17536. *
  17537. * This method parses the `url` and locates potentially dangerous content (such as javascript) and
  17538. * removes it.
  17539. *
  17540. * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.
  17541. *
  17542. * @param unsafeUrl untrusted `url`, typically from the user.
  17543. * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
  17544. * all of the dangerous javascript has been removed.
  17545. *
  17546. * @codeGenApi
  17547. */
  17548. declare function ɵɵsanitizeUrl(unsafeUrl: any): string;
  17549. /**
  17550. * A `url` sanitizer which only lets trusted `url`s through.
  17551. *
  17552. * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.
  17553. *
  17554. * @param unsafeResourceUrl untrusted `url`, typically from the user.
  17555. * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
  17556. * only trusted `url`s have been allowed to pass.
  17557. *
  17558. * @codeGenApi
  17559. */
  17560. declare function ɵɵsanitizeResourceUrl(unsafeResourceUrl: any): TrustedScriptURL | string;
  17561. /**
  17562. * A `script` sanitizer which only lets trusted javascript through.
  17563. *
  17564. * This passes only `script`s marked trusted by calling {@link
  17565. * bypassSanitizationTrustScript}.
  17566. *
  17567. * @param unsafeScript untrusted `script`, typically from the user.
  17568. * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,
  17569. * because only trusted `scripts` have been allowed to pass.
  17570. *
  17571. * @codeGenApi
  17572. */
  17573. declare function ɵɵsanitizeScript(unsafeScript: any): TrustedScript | string;
  17574. /**
  17575. * A template tag function for promoting the associated constant literal to a
  17576. * TrustedHTML. Interpolation is explicitly not allowed.
  17577. *
  17578. * @param html constant template literal containing trusted HTML.
  17579. * @returns TrustedHTML wrapping `html`.
  17580. *
  17581. * @security This is a security-sensitive function and should only be used to
  17582. * convert constant values of attributes and properties found in
  17583. * application-provided Angular templates to TrustedHTML.
  17584. *
  17585. * @codeGenApi
  17586. */
  17587. declare function ɵɵtrustConstantHtml(html: TemplateStringsArray): TrustedHTML | string;
  17588. /**
  17589. * A template tag function for promoting the associated constant literal to a
  17590. * TrustedScriptURL. Interpolation is explicitly not allowed.
  17591. *
  17592. * @param url constant template literal containing a trusted script URL.
  17593. * @returns TrustedScriptURL wrapping `url`.
  17594. *
  17595. * @security This is a security-sensitive function and should only be used to
  17596. * convert constant values of attributes and properties found in
  17597. * application-provided Angular templates to TrustedScriptURL.
  17598. *
  17599. * @codeGenApi
  17600. */
  17601. declare function ɵɵtrustConstantResourceUrl(url: TemplateStringsArray): TrustedScriptURL | string;
  17602. /**
  17603. * Sanitizes URL, selecting sanitizer function based on tag and property names.
  17604. *
  17605. * This function is used in case we can't define security context at compile time, when only prop
  17606. * name is available. This happens when we generate host bindings for Directives/Components. The
  17607. * host element is unknown at compile time, so we defer calculation of specific sanitizer to
  17608. * runtime.
  17609. *
  17610. * @param unsafeUrl untrusted `url`, typically from the user.
  17611. * @param tag target element tag name.
  17612. * @param prop name of the property that contains the value.
  17613. * @returns `url` string which is safe to bind.
  17614. *
  17615. * @codeGenApi
  17616. */
  17617. declare function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl: any, tag: string, prop: string): any;
  17618. /**
  17619. * Validation function invoked at runtime for each binding that might potentially
  17620. * represent a security-sensitive attribute of an <iframe>.
  17621. * See `IFRAME_SECURITY_SENSITIVE_ATTRS` in the
  17622. * `packages/compiler/src/schema/dom_security_schema.ts` script for the full list
  17623. * of such attributes.
  17624. *
  17625. * @codeGenApi
  17626. */
  17627. declare function ɵɵvalidateIframeAttribute(attrValue: any, tagName: string, attrName: string): any;
  17628. /**
  17629. * Represents the set of dependencies of a type in a certain context.
  17630. */
  17631. interface ScopeData {
  17632. pipes: Set<PipeType<any>>;
  17633. directives: Set<DirectiveType<any> | ComponentType<any> | Type$1<any>>;
  17634. /**
  17635. * If true it indicates that calculating this scope somehow was not successful. The consumers
  17636. * should interpret this as empty dependencies. The application of this flag is when calculating
  17637. * scope recursively, the presence of this flag in a scope dependency implies that the scope is
  17638. * also poisoned and thus we can return immediately without having to continue the recursion. The
  17639. * reason for this error is displayed as an error message in the console as per JIT behavior
  17640. * today. In addition to that, in local compilation the other build/compilations run in parallel
  17641. * with local compilation may or may not reveal some details about the error as well.
  17642. */
  17643. isPoisoned?: boolean;
  17644. }
  17645. /**
  17646. * Represents scope data for standalone components as calculated during runtime by the deps
  17647. * tracker.
  17648. */
  17649. interface StandaloneCompScopeData extends ScopeData {
  17650. ngModules: Set<NgModuleType<any>>;
  17651. }
  17652. /** Represents scope data for NgModule as calculated during runtime by the deps tracker. */
  17653. interface NgModuleScope {
  17654. compilation: ScopeData;
  17655. exported: ScopeData;
  17656. }
  17657. /**
  17658. * Represents scope data for standalone component as calculated during runtime by the deps tracker.
  17659. */
  17660. interface StandaloneComponentScope {
  17661. compilation: StandaloneCompScopeData;
  17662. }
  17663. /** Component dependencies info as calculated during runtime by the deps tracker. */
  17664. interface ComponentDependencies {
  17665. dependencies: DependencyTypeList;
  17666. }
  17667. /**
  17668. * Public API for runtime deps tracker (RDT).
  17669. *
  17670. * All downstream tools should only use these methods.
  17671. */
  17672. interface DepsTrackerApi {
  17673. /**
  17674. * Computes the component dependencies, i.e., a set of components/directive/pipes that could be
  17675. * present in the component's template (This set might contain directives/components/pipes not
  17676. * necessarily used in the component's template depending on the implementation).
  17677. *
  17678. * Standalone components should specify `rawImports` as this information is not available from
  17679. * their type. The consumer (e.g., {@link getStandaloneDefFunctions}) is expected to pass this
  17680. * parameter.
  17681. *
  17682. * The implementation is expected to use some caching mechanism in order to optimize the resources
  17683. * needed to do this computation.
  17684. */
  17685. getComponentDependencies(cmp: ComponentType<any>, rawImports?: (Type$1<any> | (() => Type$1<any>))[]): ComponentDependencies;
  17686. /**
  17687. * Registers an NgModule into the tracker with the given scope info.
  17688. *
  17689. * This method should be called for every NgModule whether it is compiled in local mode or not.
  17690. * This is needed in order to compute component's dependencies as some dependencies might be in
  17691. * different compilation units with different compilation mode.
  17692. */
  17693. registerNgModule(type: Type$1<any>, scopeInfo: NgModuleScopeInfoFromDecorator): void;
  17694. /**
  17695. * Clears the scope cache for NgModule or standalone component. This will force re-calculation of
  17696. * the scope, which could be an expensive operation as it involves aggregating transitive closure.
  17697. *
  17698. * The main application of this method is for test beds where we want to clear the cache to
  17699. * enforce scope update after overriding.
  17700. */
  17701. clearScopeCacheFor(type: Type$1<any>): void;
  17702. /**
  17703. * Returns the scope of NgModule. Mainly to be used by JIT and test bed.
  17704. *
  17705. * The scope value here is memoized. To enforce a new calculation bust the cache by using
  17706. * `clearScopeCacheFor` method.
  17707. */
  17708. getNgModuleScope(type: NgModuleType<any>): NgModuleScope;
  17709. /**
  17710. * Returns the scope of standalone component. Mainly to be used by JIT. This method should be
  17711. * called lazily after the initial parsing so that all the forward refs can be resolved.
  17712. *
  17713. * @param rawImports the imports statement as appears on the component decorate which consists of
  17714. * Type as well as forward refs.
  17715. *
  17716. * The scope value here is memoized. To enforce a new calculation bust the cache by using
  17717. * `clearScopeCacheFor` method.
  17718. */
  17719. getStandaloneComponentScope(type: ComponentType<any>, rawImports: (Type$1<any> | (() => Type$1<any>))[]): StandaloneComponentScope;
  17720. /**
  17721. * Checks if the NgModule declaring the component is not loaded into the browser yet. Always
  17722. * returns false for standalone components.
  17723. */
  17724. isOrphanComponent(cmp: ComponentType<any>): boolean;
  17725. }
  17726. /**
  17727. * Indicates whether to use the runtime dependency tracker for scope calculation in JIT compilation.
  17728. * The value "false" means the old code path based on patching scope info into the types will be
  17729. * used.
  17730. *
  17731. * @deprecated For migration purposes only, to be removed soon.
  17732. */
  17733. declare const USE_RUNTIME_DEPS_TRACKER_FOR_JIT = true;
  17734. /**
  17735. * An implementation of DepsTrackerApi which will be used for JIT and local compilation.
  17736. */
  17737. declare class DepsTracker implements DepsTrackerApi {
  17738. private ownerNgModule;
  17739. private ngModulesWithSomeUnresolvedDecls;
  17740. private ngModulesScopeCache;
  17741. private standaloneComponentsScopeCache;
  17742. /**
  17743. * Attempts to resolve ng module's forward ref declarations as much as possible and add them to
  17744. * the `ownerNgModule` map. This method normally should be called after the initial parsing when
  17745. * all the forward refs are resolved (e.g., when trying to render a component)
  17746. */
  17747. private resolveNgModulesDecls;
  17748. /** @override */
  17749. getComponentDependencies(type: ComponentType<any>, rawImports?: RawScopeInfoFromDecorator[]): ComponentDependencies;
  17750. /**
  17751. * @override
  17752. * This implementation does not make use of param scopeInfo since it assumes the scope info is
  17753. * already added to the type itself through methods like {@link ɵɵsetNgModuleScope}
  17754. */
  17755. registerNgModule(type: Type$1<any>, scopeInfo: NgModuleScopeInfoFromDecorator): void;
  17756. /** @override */
  17757. clearScopeCacheFor(type: Type$1<any>): void;
  17758. /** @override */
  17759. getNgModuleScope(type: NgModuleType<any>): NgModuleScope;
  17760. /** Compute NgModule scope afresh. */
  17761. private computeNgModuleScope;
  17762. /** @override */
  17763. getStandaloneComponentScope(type: ComponentType<any>, rawImports?: RawScopeInfoFromDecorator[]): StandaloneComponentScope;
  17764. private computeStandaloneComponentScope;
  17765. /** @override */
  17766. isOrphanComponent(cmp: Type$1<any>): boolean;
  17767. }
  17768. /** The deps tracker to be used in the current Angular app in dev mode. */
  17769. declare const depsTracker: DepsTracker;
  17770. /**
  17771. * Options passed to the `computed` creation function.
  17772. */
  17773. interface CreateComputedOptions<T> {
  17774. /**
  17775. * A comparison function which defines equality for computed values.
  17776. */
  17777. equal?: ValueEqualityFn<T>;
  17778. /**
  17779. * A debug name for the computed signal. Used in Angular DevTools to identify the signal.
  17780. */
  17781. debugName?: string;
  17782. }
  17783. /**
  17784. * Create a computed `Signal` which derives a reactive value from an expression.
  17785. */
  17786. declare function computed<T>(computation: () => T, options?: CreateComputedOptions<T>): Signal<T>;
  17787. /**
  17788. * Creates a writable signal whose value is initialized and reset by the linked, reactive computation.
  17789. *
  17790. * @developerPreview
  17791. */
  17792. declare function linkedSignal<D>(computation: () => D, options?: {
  17793. equal?: ValueEqualityFn<NoInfer<D>>;
  17794. }): WritableSignal<D>;
  17795. /**
  17796. * Creates a writable signal whose value is initialized and reset by the linked, reactive computation.
  17797. * This is an advanced API form where the computation has access to the previous value of the signal and the computation result.
  17798. *
  17799. * Note: The computation is reactive, meaning the linked signal will automatically update whenever any of the signals used within the computation change.
  17800. *
  17801. * @developerPreview
  17802. */
  17803. declare function linkedSignal<S, D>(options: {
  17804. source: () => S;
  17805. computation: (source: NoInfer<S>, previous?: {
  17806. source: NoInfer<S>;
  17807. value: NoInfer<D>;
  17808. }) => D;
  17809. equal?: ValueEqualityFn<NoInfer<D>>;
  17810. }): WritableSignal<D>;
  17811. /**
  17812. * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function
  17813. * can, optionally, return a value.
  17814. */
  17815. declare function untracked<T>(nonReactiveReadsFn: () => T): T;
  17816. declare class MicrotaskEffectScheduler extends ZoneAwareEffectScheduler {
  17817. private readonly pendingTasks;
  17818. private taskId;
  17819. schedule(effect: SchedulableEffect): void;
  17820. flush(): void;
  17821. /** @nocollapse */
  17822. static ɵprov: unknown;
  17823. }
  17824. /**
  17825. * Create a global `Effect` for the given reactive function.
  17826. */
  17827. declare function microtaskEffect(effectFn: (onCleanup: EffectCleanupRegisterFn) => void, options?: CreateEffectOptions): EffectRef;
  17828. /**
  17829. * An argument list containing the first non-never type in the given type array, or an empty
  17830. * argument list if there are no non-never types in the type array.
  17831. */
  17832. type ɵFirstAvailable<T extends unknown[]> = T extends [infer H, ...infer R] ? [H] extends [never] ? ɵFirstAvailable<R> : [H] : [];
  17833. /**
  17834. * Options passed to `afterRender` and `afterNextRender`.
  17835. *
  17836. * @developerPreview
  17837. */
  17838. interface AfterRenderOptions {
  17839. /**
  17840. * The `Injector` to use during creation.
  17841. *
  17842. * If this is not provided, the current injection context will be used instead (via `inject`).
  17843. */
  17844. injector?: Injector;
  17845. /**
  17846. * Whether the hook should require manual cleanup.
  17847. *
  17848. * If this is `false` (the default) the hook will automatically register itself to be cleaned up
  17849. * with the current `DestroyRef`.
  17850. */
  17851. manualCleanup?: boolean;
  17852. /**
  17853. * The phase the callback should be invoked in.
  17854. *
  17855. * <div class="docs-alert docs-alert-critical">
  17856. *
  17857. * Defaults to `AfterRenderPhase.MixedReadWrite`. You should choose a more specific
  17858. * phase instead. See `AfterRenderPhase` for more information.
  17859. *
  17860. * </div>
  17861. *
  17862. * @deprecated Specify the phase for your callback to run in by passing a spec-object as the first
  17863. * parameter to `afterRender` or `afterNextRender` instead of a function.
  17864. */
  17865. phase?: AfterRenderPhase;
  17866. }
  17867. /**
  17868. * Register callbacks to be invoked each time the application finishes rendering, during the
  17869. * specified phases. The available phases are:
  17870. * - `earlyRead`
  17871. * Use this phase to **read** from the DOM before a subsequent `write` callback, for example to
  17872. * perform custom layout that the browser doesn't natively support. Prefer the `read` phase if
  17873. * reading can wait until after the write phase. **Never** write to the DOM in this phase.
  17874. * - `write`
  17875. * Use this phase to **write** to the DOM. **Never** read from the DOM in this phase.
  17876. * - `mixedReadWrite`
  17877. * Use this phase to read from and write to the DOM simultaneously. **Never** use this phase if
  17878. * it is possible to divide the work among the other phases instead.
  17879. * - `read`
  17880. * Use this phase to **read** from the DOM. **Never** write to the DOM in this phase.
  17881. *
  17882. * <div class="docs-alert docs-alert-critical">
  17883. *
  17884. * You should prefer using the `read` and `write` phases over the `earlyRead` and `mixedReadWrite`
  17885. * phases when possible, to avoid performance degradation.
  17886. *
  17887. * </div>
  17888. *
  17889. * Note that:
  17890. * - Callbacks run in the following phase order *after each render*:
  17891. * 1. `earlyRead`
  17892. * 2. `write`
  17893. * 3. `mixedReadWrite`
  17894. * 4. `read`
  17895. * - Callbacks in the same phase run in the order they are registered.
  17896. * - Callbacks run on browser platforms only, they will not run on the server.
  17897. *
  17898. * The first phase callback to run as part of this spec will receive no parameters. Each
  17899. * subsequent phase callback in this spec will receive the return value of the previously run
  17900. * phase callback as a parameter. This can be used to coordinate work across multiple phases.
  17901. *
  17902. * Angular is unable to verify or enforce that phases are used correctly, and instead
  17903. * relies on each developer to follow the guidelines documented for each value and
  17904. * carefully choose the appropriate one, refactoring their code if necessary. By doing
  17905. * so, Angular is better able to minimize the performance degradation associated with
  17906. * manual DOM access, ensuring the best experience for the end users of your application
  17907. * or library.
  17908. *
  17909. * <div class="docs-alert docs-alert-important">
  17910. *
  17911. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  17912. * You must use caution when directly reading or writing the DOM and layout.
  17913. *
  17914. * </div>
  17915. *
  17916. * @param spec The callback functions to register
  17917. * @param options Options to control the behavior of the callback
  17918. *
  17919. * @usageNotes
  17920. *
  17921. * Use `afterRender` to read or write the DOM after each render.
  17922. *
  17923. * ### Example
  17924. * ```angular-ts
  17925. * @Component({
  17926. * selector: 'my-cmp',
  17927. * template: `<span #content>{{ ... }}</span>`,
  17928. * })
  17929. * export class MyComponent {
  17930. * @ViewChild('content') contentRef: ElementRef;
  17931. *
  17932. * constructor() {
  17933. * afterRender({
  17934. * read: () => {
  17935. * console.log('content height: ' + this.contentRef.nativeElement.scrollHeight);
  17936. * }
  17937. * });
  17938. * }
  17939. * }
  17940. * ```
  17941. *
  17942. * @developerPreview
  17943. */
  17944. declare function afterRender<E = never, W = never, M = never>(spec: {
  17945. earlyRead?: () => E;
  17946. write?: (...args: ɵFirstAvailable<[E]>) => W;
  17947. mixedReadWrite?: (...args: ɵFirstAvailable<[W, E]>) => M;
  17948. read?: (...args: ɵFirstAvailable<[M, W, E]>) => void;
  17949. }, options?: Omit<AfterRenderOptions, 'phase'>): AfterRenderRef;
  17950. /**
  17951. * Register a callback to be invoked each time the application finishes rendering, during the
  17952. * `mixedReadWrite` phase.
  17953. *
  17954. * <div class="docs-alert docs-alert-critical">
  17955. *
  17956. * You should prefer specifying an explicit phase for the callback instead, or you risk significant
  17957. * performance degradation.
  17958. *
  17959. * </div>
  17960. *
  17961. * Note that the callback will run
  17962. * - in the order it was registered
  17963. * - once per render
  17964. * - on browser platforms only
  17965. * - during the `mixedReadWrite` phase
  17966. *
  17967. * <div class="docs-alert docs-alert-important">
  17968. *
  17969. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  17970. * You must use caution when directly reading or writing the DOM and layout.
  17971. *
  17972. * </div>
  17973. *
  17974. * @param callback A callback function to register
  17975. * @param options Options to control the behavior of the callback
  17976. *
  17977. * @usageNotes
  17978. *
  17979. * Use `afterRender` to read or write the DOM after each render.
  17980. *
  17981. * ### Example
  17982. * ```angular-ts
  17983. * @Component({
  17984. * selector: 'my-cmp',
  17985. * template: `<span #content>{{ ... }}</span>`,
  17986. * })
  17987. * export class MyComponent {
  17988. * @ViewChild('content') contentRef: ElementRef;
  17989. *
  17990. * constructor() {
  17991. * afterRender({
  17992. * read: () => {
  17993. * console.log('content height: ' + this.contentRef.nativeElement.scrollHeight);
  17994. * }
  17995. * });
  17996. * }
  17997. * }
  17998. * ```
  17999. *
  18000. * @developerPreview
  18001. */
  18002. declare function afterRender(callback: VoidFunction, options?: AfterRenderOptions): AfterRenderRef;
  18003. /**
  18004. * Register callbacks to be invoked the next time the application finishes rendering, during the
  18005. * specified phases. The available phases are:
  18006. * - `earlyRead`
  18007. * Use this phase to **read** from the DOM before a subsequent `write` callback, for example to
  18008. * perform custom layout that the browser doesn't natively support. Prefer the `read` phase if
  18009. * reading can wait until after the write phase. **Never** write to the DOM in this phase.
  18010. * - `write`
  18011. * Use this phase to **write** to the DOM. **Never** read from the DOM in this phase.
  18012. * - `mixedReadWrite`
  18013. * Use this phase to read from and write to the DOM simultaneously. **Never** use this phase if
  18014. * it is possible to divide the work among the other phases instead.
  18015. * - `read`
  18016. * Use this phase to **read** from the DOM. **Never** write to the DOM in this phase.
  18017. *
  18018. * <div class="docs-alert docs-alert-critical">
  18019. *
  18020. * You should prefer using the `read` and `write` phases over the `earlyRead` and `mixedReadWrite`
  18021. * phases when possible, to avoid performance degradation.
  18022. *
  18023. * </div>
  18024. *
  18025. * Note that:
  18026. * - Callbacks run in the following phase order *once, after the next render*:
  18027. * 1. `earlyRead`
  18028. * 2. `write`
  18029. * 3. `mixedReadWrite`
  18030. * 4. `read`
  18031. * - Callbacks in the same phase run in the order they are registered.
  18032. * - Callbacks run on browser platforms only, they will not run on the server.
  18033. *
  18034. * The first phase callback to run as part of this spec will receive no parameters. Each
  18035. * subsequent phase callback in this spec will receive the return value of the previously run
  18036. * phase callback as a parameter. This can be used to coordinate work across multiple phases.
  18037. *
  18038. * Angular is unable to verify or enforce that phases are used correctly, and instead
  18039. * relies on each developer to follow the guidelines documented for each value and
  18040. * carefully choose the appropriate one, refactoring their code if necessary. By doing
  18041. * so, Angular is better able to minimize the performance degradation associated with
  18042. * manual DOM access, ensuring the best experience for the end users of your application
  18043. * or library.
  18044. *
  18045. * <div class="docs-alert docs-alert-important">
  18046. *
  18047. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  18048. * You must use caution when directly reading or writing the DOM and layout.
  18049. *
  18050. * </div>
  18051. *
  18052. * @param spec The callback functions to register
  18053. * @param options Options to control the behavior of the callback
  18054. *
  18055. * @usageNotes
  18056. *
  18057. * Use `afterNextRender` to read or write the DOM once,
  18058. * for example to initialize a non-Angular library.
  18059. *
  18060. * ### Example
  18061. * ```angular-ts
  18062. * @Component({
  18063. * selector: 'my-chart-cmp',
  18064. * template: `<div #chart>{{ ... }}</div>`,
  18065. * })
  18066. * export class MyChartCmp {
  18067. * @ViewChild('chart') chartRef: ElementRef;
  18068. * chart: MyChart|null;
  18069. *
  18070. * constructor() {
  18071. * afterNextRender({
  18072. * write: () => {
  18073. * this.chart = new MyChart(this.chartRef.nativeElement);
  18074. * }
  18075. * });
  18076. * }
  18077. * }
  18078. * ```
  18079. *
  18080. * @developerPreview
  18081. */
  18082. declare function afterNextRender<E = never, W = never, M = never>(spec: {
  18083. earlyRead?: () => E;
  18084. write?: (...args: ɵFirstAvailable<[E]>) => W;
  18085. mixedReadWrite?: (...args: ɵFirstAvailable<[W, E]>) => M;
  18086. read?: (...args: ɵFirstAvailable<[M, W, E]>) => void;
  18087. }, options?: Omit<AfterRenderOptions, 'phase'>): AfterRenderRef;
  18088. /**
  18089. * Register a callback to be invoked the next time the application finishes rendering, during the
  18090. * `mixedReadWrite` phase.
  18091. *
  18092. * <div class="docs-alert docs-alert-critical">
  18093. *
  18094. * You should prefer specifying an explicit phase for the callback instead, or you risk significant
  18095. * performance degradation.
  18096. *
  18097. * </div>
  18098. *
  18099. * Note that the callback will run
  18100. * - in the order it was registered
  18101. * - on browser platforms only
  18102. * - during the `mixedReadWrite` phase
  18103. *
  18104. * <div class="docs-alert docs-alert-important">
  18105. *
  18106. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  18107. * You must use caution when directly reading or writing the DOM and layout.
  18108. *
  18109. * </div>
  18110. *
  18111. * @param callback A callback function to register
  18112. * @param options Options to control the behavior of the callback
  18113. *
  18114. * @usageNotes
  18115. *
  18116. * Use `afterNextRender` to read or write the DOM once,
  18117. * for example to initialize a non-Angular library.
  18118. *
  18119. * ### Example
  18120. * ```angular-ts
  18121. * @Component({
  18122. * selector: 'my-chart-cmp',
  18123. * template: `<div #chart>{{ ... }}</div>`,
  18124. * })
  18125. * export class MyChartCmp {
  18126. * @ViewChild('chart') chartRef: ElementRef;
  18127. * chart: MyChart|null;
  18128. *
  18129. * constructor() {
  18130. * afterNextRender({
  18131. * write: () => {
  18132. * this.chart = new MyChart(this.chartRef.nativeElement);
  18133. * }
  18134. * });
  18135. * }
  18136. * }
  18137. * ```
  18138. *
  18139. * @developerPreview
  18140. */
  18141. declare function afterNextRender(callback: VoidFunction, options?: AfterRenderOptions): AfterRenderRef;
  18142. /**
  18143. * An argument list containing the first non-never type in the given type array, or an empty
  18144. * argument list if there are no non-never types in the type array.
  18145. */
  18146. type ɵFirstAvailableSignal<T extends unknown[]> = T extends [infer H, ...infer R] ? [H] extends [never] ? ɵFirstAvailableSignal<R> : [Signal<H>] : [];
  18147. /**
  18148. * Register an effect that, when triggered, is invoked when the application finishes rendering, during the
  18149. * `mixedReadWrite` phase.
  18150. *
  18151. * <div class="docs-alert docs-alert-critical">
  18152. *
  18153. * You should prefer specifying an explicit phase for the effect instead, or you risk significant
  18154. * performance degradation.
  18155. *
  18156. * </div>
  18157. *
  18158. * Note that callback-based `afterRenderEffect`s will run
  18159. * - in the order it they are registered
  18160. * - only when dirty
  18161. * - on browser platforms only
  18162. * - during the `mixedReadWrite` phase
  18163. *
  18164. * <div class="docs-alert docs-alert-important">
  18165. *
  18166. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  18167. * You must use caution when directly reading or writing the DOM and layout.
  18168. *
  18169. * </div>
  18170. *
  18171. * @param callback An effect callback function to register
  18172. * @param options Options to control the behavior of the callback
  18173. *
  18174. * @experimental
  18175. */
  18176. declare function afterRenderEffect(callback: (onCleanup: EffectCleanupRegisterFn) => void, options?: Omit<AfterRenderOptions, 'phase'>): AfterRenderRef;
  18177. /**
  18178. * Register effects that, when triggered, are invoked when the application finishes rendering,
  18179. * during the specified phases. The available phases are:
  18180. * - `earlyRead`
  18181. * Use this phase to **read** from the DOM before a subsequent `write` callback, for example to
  18182. * perform custom layout that the browser doesn't natively support. Prefer the `read` phase if
  18183. * reading can wait until after the write phase. **Never** write to the DOM in this phase.
  18184. * - `write`
  18185. * Use this phase to **write** to the DOM. **Never** read from the DOM in this phase.
  18186. * - `mixedReadWrite`
  18187. * Use this phase to read from and write to the DOM simultaneously. **Never** use this phase if
  18188. * it is possible to divide the work among the other phases instead.
  18189. * - `read`
  18190. * Use this phase to **read** from the DOM. **Never** write to the DOM in this phase.
  18191. *
  18192. * <div class="docs-alert docs-alert-critical">
  18193. *
  18194. * You should prefer using the `read` and `write` phases over the `earlyRead` and `mixedReadWrite`
  18195. * phases when possible, to avoid performance degradation.
  18196. *
  18197. * </div>
  18198. *
  18199. * Note that:
  18200. * - Effects run in the following phase order, only when dirty through signal dependencies:
  18201. * 1. `earlyRead`
  18202. * 2. `write`
  18203. * 3. `mixedReadWrite`
  18204. * 4. `read`
  18205. * - `afterRenderEffect`s in the same phase run in the order they are registered.
  18206. * - `afterRenderEffect`s run on browser platforms only, they will not run on the server.
  18207. * - `afterRenderEffect`s will run at least once.
  18208. *
  18209. * The first phase callback to run as part of this spec will receive no parameters. Each
  18210. * subsequent phase callback in this spec will receive the return value of the previously run
  18211. * phase callback as a `Signal`. This can be used to coordinate work across multiple phases.
  18212. *
  18213. * Angular is unable to verify or enforce that phases are used correctly, and instead
  18214. * relies on each developer to follow the guidelines documented for each value and
  18215. * carefully choose the appropriate one, refactoring their code if necessary. By doing
  18216. * so, Angular is better able to minimize the performance degradation associated with
  18217. * manual DOM access, ensuring the best experience for the end users of your application
  18218. * or library.
  18219. *
  18220. * <div class="docs-alert docs-alert-important">
  18221. *
  18222. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  18223. * You must use caution when directly reading or writing the DOM and layout.
  18224. *
  18225. * </div>
  18226. *
  18227. * @param spec The effect functions to register
  18228. * @param options Options to control the behavior of the effects
  18229. *
  18230. * @usageNotes
  18231. *
  18232. * Use `afterRenderEffect` to create effects that will read or write from the DOM and thus should
  18233. * run after rendering.
  18234. *
  18235. * @experimental
  18236. */
  18237. declare function afterRenderEffect<E = never, W = never, M = never>(spec: {
  18238. earlyRead?: (onCleanup: EffectCleanupRegisterFn) => E;
  18239. write?: (...args: [...ɵFirstAvailableSignal<[E]>, EffectCleanupRegisterFn]) => W;
  18240. mixedReadWrite?: (...args: [...ɵFirstAvailableSignal<[W, E]>, EffectCleanupRegisterFn]) => M;
  18241. read?: (...args: [...ɵFirstAvailableSignal<[M, W, E]>, EffectCleanupRegisterFn]) => void;
  18242. }, options?: Omit<AfterRenderOptions, 'phase'>): AfterRenderRef;
  18243. /**
  18244. * Asserts that the current stack frame is not within a reactive context. Useful
  18245. * to disallow certain code from running inside a reactive context (see {@link /api/core/rxjs/toSignal toSignal})
  18246. *
  18247. * @param debugFn a reference to the function making the assertion (used for the error message).
  18248. *
  18249. * @publicApi
  18250. */
  18251. declare function assertNotInReactiveContext(debugFn: Function, extraContext?: string): void;
  18252. /**
  18253. * Creates a `ComponentRef` instance based on provided component type and a set of options.
  18254. *
  18255. * @usageNotes
  18256. *
  18257. * The example below demonstrates how the `createComponent` function can be used
  18258. * to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,
  18259. * so that it gets included into change detection cycles.
  18260. *
  18261. * Note: the example uses standalone components, but the function can also be used for
  18262. * non-standalone components (declared in an NgModule) as well.
  18263. *
  18264. * ```angular-ts
  18265. * @Component({
  18266. * standalone: true,
  18267. * template: `Hello {{ name }}!`
  18268. * })
  18269. * class HelloComponent {
  18270. * name = 'Angular';
  18271. * }
  18272. *
  18273. * @Component({
  18274. * standalone: true,
  18275. * template: `<div id="hello-component-host"></div>`
  18276. * })
  18277. * class RootComponent {}
  18278. *
  18279. * // Bootstrap an application.
  18280. * const applicationRef = await bootstrapApplication(RootComponent);
  18281. *
  18282. * // Locate a DOM node that would be used as a host.
  18283. * const hostElement = document.getElementById('hello-component-host');
  18284. *
  18285. * // Get an `EnvironmentInjector` instance from the `ApplicationRef`.
  18286. * const environmentInjector = applicationRef.injector;
  18287. *
  18288. * // We can now create a `ComponentRef` instance.
  18289. * const componentRef = createComponent(HelloComponent, {hostElement, environmentInjector});
  18290. *
  18291. * // Last step is to register the newly created ref using the `ApplicationRef` instance
  18292. * // to include the component view into change detection cycles.
  18293. * applicationRef.attachView(componentRef.hostView);
  18294. * componentRef.changeDetectorRef.detectChanges();
  18295. * ```
  18296. *
  18297. * @param component Component class reference.
  18298. * @param options Set of options to use:
  18299. * * `environmentInjector`: An `EnvironmentInjector` instance to be used for the component.
  18300. * * `hostElement` (optional): A DOM node that should act as a host node for the component. If not
  18301. * provided, Angular creates one based on the tag name used in the component selector (and falls
  18302. * back to using `div` if selector doesn't have tag name info).
  18303. * * `elementInjector` (optional): An `ElementInjector` instance, see additional info about it
  18304. * [here](guide/di/hierarchical-dependency-injection#elementinjector).
  18305. * * `projectableNodes` (optional): A list of DOM nodes that should be projected through
  18306. * [`<ng-content>`](api/core/ng-content) of the new component instance, e.g.,
  18307. * `[[element1, element2]]`: projects `element1` and `element2` into the same `<ng-content>`.
  18308. * `[[element1, element2], [element3]]`: projects `element1` and `element2` into one `<ng-content>`,
  18309. * and `element3` into a separate `<ng-content>`.
  18310. * @returns ComponentRef instance that represents a given Component.
  18311. *
  18312. * @publicApi
  18313. */
  18314. declare function createComponent<C>(component: Type$1<C>, options: {
  18315. environmentInjector: EnvironmentInjector;
  18316. hostElement?: Element;
  18317. elementInjector?: Injector;
  18318. projectableNodes?: Node[][];
  18319. }): ComponentRef$1<C>;
  18320. /**
  18321. * An interface that describes the subset of component metadata
  18322. * that can be retrieved using the `reflectComponentType` function.
  18323. *
  18324. * @publicApi
  18325. */
  18326. interface ComponentMirror<C> {
  18327. /**
  18328. * The component's HTML selector.
  18329. */
  18330. get selector(): string;
  18331. /**
  18332. * The type of component the factory will create.
  18333. */
  18334. get type(): Type$1<C>;
  18335. /**
  18336. * The inputs of the component.
  18337. */
  18338. get inputs(): ReadonlyArray<{
  18339. readonly propName: string;
  18340. readonly templateName: string;
  18341. readonly transform?: (value: any) => any;
  18342. readonly isSignal: boolean;
  18343. }>;
  18344. /**
  18345. * The outputs of the component.
  18346. */
  18347. get outputs(): ReadonlyArray<{
  18348. readonly propName: string;
  18349. readonly templateName: string;
  18350. }>;
  18351. /**
  18352. * Selector for all <ng-content> elements in the component.
  18353. */
  18354. get ngContentSelectors(): ReadonlyArray<string>;
  18355. /**
  18356. * Whether this component is marked as standalone.
  18357. * Note: an extra flag, not present in `ComponentFactory`.
  18358. */
  18359. get isStandalone(): boolean;
  18360. }
  18361. /**
  18362. * Creates an object that allows to retrieve component metadata.
  18363. *
  18364. * @usageNotes
  18365. *
  18366. * The example below demonstrates how to use the function and how the fields
  18367. * of the returned object map to the component metadata.
  18368. *
  18369. * ```angular-ts
  18370. * @Component({
  18371. * standalone: true,
  18372. * selector: 'foo-component',
  18373. * template: `
  18374. * <ng-content></ng-content>
  18375. * <ng-content select="content-selector-a"></ng-content>
  18376. * `,
  18377. * })
  18378. * class FooComponent {
  18379. * @Input('inputName') inputPropName: string;
  18380. * @Output('outputName') outputPropName = new EventEmitter<void>();
  18381. * }
  18382. *
  18383. * const mirror = reflectComponentType(FooComponent);
  18384. * expect(mirror.type).toBe(FooComponent);
  18385. * expect(mirror.selector).toBe('foo-component');
  18386. * expect(mirror.isStandalone).toBe(true);
  18387. * expect(mirror.inputs).toEqual([{propName: 'inputName', templateName: 'inputPropName'}]);
  18388. * expect(mirror.outputs).toEqual([{propName: 'outputName', templateName: 'outputPropName'}]);
  18389. * expect(mirror.ngContentSelectors).toEqual([
  18390. * '*', // first `<ng-content>` in a template, the selector defaults to `*`
  18391. * 'content-selector-a' // second `<ng-content>` in a template
  18392. * ]);
  18393. * ```
  18394. *
  18395. * @param component Component class reference.
  18396. * @returns An object that allows to retrieve component metadata.
  18397. *
  18398. * @publicApi
  18399. */
  18400. declare function reflectComponentType<C>(component: Type$1<C>): ComponentMirror<C> | null;
  18401. /**
  18402. * Set of config options available during the application bootstrap operation.
  18403. *
  18404. * @publicApi
  18405. */
  18406. interface ApplicationConfig {
  18407. /**
  18408. * List of providers that should be available to the root component and all its children.
  18409. */
  18410. providers: Array<Provider | EnvironmentProviders>;
  18411. }
  18412. /**
  18413. * Merge multiple application configurations from left to right.
  18414. *
  18415. * @param configs Two or more configurations to be merged.
  18416. * @returns A merged [ApplicationConfig](api/core/ApplicationConfig).
  18417. *
  18418. * @publicApi
  18419. */
  18420. declare function mergeApplicationConfig(...configs: ApplicationConfig[]): ApplicationConfig;
  18421. /**
  18422. * Injection token representing the current HTTP request object.
  18423. *
  18424. * Use this token to access the current request when handling server-side
  18425. * rendering (SSR).
  18426. *
  18427. * @remarks
  18428. * This token may be `null` in the following scenarios:
  18429. *
  18430. * * During the build processes.
  18431. * * When the application is rendered in the browser (client-side rendering).
  18432. * * When performing static site generation (SSG).
  18433. * * During route extraction in development (at the time of the request).
  18434. *
  18435. * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request | `Request` on MDN}
  18436. *
  18437. * @developerPreview
  18438. */
  18439. declare const REQUEST: InjectionToken<Request | null>;
  18440. /**
  18441. * Injection token for response initialization options.
  18442. *
  18443. * Use this token to provide response options for configuring or initializing
  18444. * HTTP responses in server-side rendering or API endpoints.
  18445. *
  18446. * @remarks
  18447. * This token may be `null` in the following scenarios:
  18448. *
  18449. * * During the build processes.
  18450. * * When the application is rendered in the browser (client-side rendering).
  18451. * * When performing static site generation (SSG).
  18452. * * During route extraction in development (at the time of the request).
  18453. *
  18454. * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response | `ResponseInit` on MDN}
  18455. *
  18456. * @developerPreview
  18457. */
  18458. declare const RESPONSE_INIT: InjectionToken<ResponseInit | null>;
  18459. /**
  18460. * Injection token for additional request context.
  18461. *
  18462. * Use this token to pass custom metadata or context related to the current request in server-side rendering.
  18463. *
  18464. * @remarks
  18465. * This token is only available during server-side rendering and will be `null` in other contexts.
  18466. *
  18467. * @developerPreview
  18468. */
  18469. declare const REQUEST_CONTEXT: InjectionToken<unknown>;
  18470. export { ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AfterRenderPhase, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy$1 as ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, DestroyRef, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, HOST_TAG_NAME, Host, HostAttributeToken, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, OutputEmitterRef, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, PendingTasks, Pipe, PlatformRef, Query, QueryList, REQUEST, REQUEST_CONTEXT, RESPONSE_INIT, Renderer2, RendererFactory2, RendererStyleFlags2, ResourceStatus, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TransferState, Type$1 as Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef$1 as ViewRef, 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, CLIENT_RENDER_MODE_FLAG as ɵCLIENT_RENDER_MODE_FLAG, CONTAINER_HEADER_OFFSET as ɵCONTAINER_HEADER_OFFSET, ChangeDetectionScheduler as ɵChangeDetectionScheduler, ChangeDetectionSchedulerImpl as ɵChangeDetectionSchedulerImpl, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, 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, DEHYDRATED_BLOCK_REGISTRY as ɵDEHYDRATED_BLOCK_REGISTRY, DeferBlockBehavior as ɵDeferBlockBehavior, DeferBlockState as ɵDeferBlockState, ENABLE_ROOT_COMPONENT_BOOTSTRAP as ɵENABLE_ROOT_COMPONENT_BOOTSTRAP, EffectScheduler as ɵEffectScheduler, ExtraLocaleDataIndex as ɵExtraLocaleDataIndex, HydrationStatus as ɵHydrationStatus, 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, JSACTION_BLOCK_ELEMENT_MAP as ɵJSACTION_BLOCK_ELEMENT_MAP, 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, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, NotificationSource as ɵNotificationSource, PERFORMANCE_MARK_PREFIX as ɵPERFORMANCE_MARK_PREFIX, PROVIDED_NG_ZONE as ɵPROVIDED_NG_ZONE, PendingTasksInternal as ɵPendingTasksInternal, ProfilerEvent as ɵProfilerEvent, R3Injector as ɵR3Injector, 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, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, TimerScheduler as ɵTimerScheduler, TracingAction as ɵTracingAction, TracingService as ɵTracingService, USE_RUNTIME_DEPS_TRACKER_FOR_JIT as ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, ViewRef as ɵViewRef, 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, createOrReusePlatformInjector as ɵcreateOrReusePlatformInjector, 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, getComponentDef as ɵgetComponentDef, getDebugNode as ɵgetDebugNode, getDeferBlocks$1 as ɵgetDeferBlocks, getDirectives as ɵgetDirectives, getDocument as ɵgetDocument, 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, ɵɵCopyDefinitionFeature, ɵɵExternalStylesFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵ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, ɵɵgetReplaceMetadataURL, ɵɵ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 };
  18471. export type { AbstractType, AfterContentChecked, AfterContentInit, AfterRenderOptions, AfterRenderRef, AfterViewChecked, AfterViewInit, ApplicationConfig, AttributeDecorator, BaseResourceOptions, BootstrapOptions, ClassProvider, ClassSansProvider, CompilerOptions, ComponentDecorator, ComponentMirror, ConstructorProvider, ConstructorSansProvider, ContentChildDecorator, ContentChildFunction, ContentChildrenDecorator, CreateComputedOptions, CreateEffectOptions, CreateSignalOptions, DirectiveDecorator, DoBootstrap, DoCheck, EffectCleanupFn, EffectCleanupRegisterFn, EffectRef, EnvironmentProviders, ExistingProvider, ExistingSansProvider, FactoryProvider, FactorySansProvider, ForwardRefFn, GetTestability, HostBindingDecorator, HostDecorator, HostListenerDecorator, ImportProvidersSource, ImportedNgModuleProviders, InjectDecorator, InjectOptions, InjectableDecorator, InjectableProvider, InjectableType, InjectorType, InputDecorator, InputFunction, InputOptions, InputOptionsWithTransform, InputOptionsWithoutTransform, InputSignal, InputSignalWithTransform, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory, ListenerOptions, ModelFunction, ModelOptions, ModelSignal, ModuleWithProviders, NgIterable, NgModuleDecorator, NgZoneOptions, OnChanges, OnDestroy, OnInit, OptionalDecorator, OutputDecorator, OutputOptions, OutputRef, OutputRefSubscription, PipeDecorator, PipeTransform, Predicate, PromiseResourceOptions, Provider, ProviderToken, RendererType2, Resource, ResourceLoader, ResourceLoaderParams, ResourceOptions, ResourceRef, ResourceStreamItem, ResourceStreamingLoader, SchemaMetadata, SelfDecorator, Signal, SimpleChanges, SkipSelfDecorator, StateKey, StaticClassProvider, StaticClassSansProvider, StaticProvider, StreamingResourceOptions, TrackByFunction, TypeDecorator, TypeProvider, ValueEqualityFn, ValueProvider, ValueSansProvider, ViewChildDecorator, ViewChildFunction, ViewChildrenDecorator, WritableResource, WritableSignal, ComponentDebugMetadata as ɵComponentDebugMetadata, ComponentDef as ɵComponentDef, ComponentType as ɵComponentType, CssSelectorList as ɵCssSelectorList, DeferBlockConfig as ɵDeferBlockConfig, DeferBlockDependencyInterceptor as ɵDeferBlockDependencyInterceptor, DeferBlockDetails as ɵDeferBlockDetails, DirectiveDef as ɵDirectiveDef, DirectiveType as ɵDirectiveType, ɵFirstAvailable, ɵFirstAvailableSignal, GlobalDevModeUtils as ɵGlobalDevModeUtils, HydratedNode as ɵHydratedNode, HydrationInfo as ɵHydrationInfo, ImageConfig as ɵImageConfig, InjectorProfilerContext as ɵInjectorProfilerContext, InputSignalNode as ɵInputSignalNode, InternalEnvironmentProviders as ɵInternalEnvironmentProviders, NgModuleDef as ɵNgModuleDef, NgModuleTransitiveScopes as ɵNgModuleTransitiveScopes, NgModuleType as ɵNgModuleType, PipeDef as ɵPipeDef, Profiler as ɵProfiler, ProviderRecord as ɵProviderRecord, SafeHtml as ɵSafeHtml, SafeResourceUrl as ɵSafeResourceUrl, SafeScript as ɵSafeScript, SafeStyle as ɵSafeStyle, SafeUrl as ɵSafeUrl, SafeValue as ɵSafeValue, TracingSnapshot as ɵTracingSnapshot, ɵUnwrapDirectiveSignalInputs, Writable as ɵWritable, ɵɵComponentDeclaration, ɵɵDirectiveDeclaration, ɵɵFactoryDeclaration, ɵɵInjectableDeclaration, ɵɵInjectorDeclaration, ɵɵInjectorDef, ɵɵNgModuleDeclaration, ɵɵPipeDeclaration };