index.d.ts 351 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301
  1. /**
  2. * @license Angular v20.1.0
  3. * (c) 2010-2025 Google LLC. https://angular.io/
  4. * License: MIT
  5. */
  6. import { SIGNAL, ValueEqualityFn as ValueEqualityFn$1 } from './graph.d.js';
  7. import { Signal, WritableSignal, OutputRef, Provider, EnvironmentProviders, Type as Type$1, ModuleWithProviders, TypeProvider, ValueProvider, ClassProvider, ConstructorProvider, ExistingProvider, FactoryProvider, StaticClassProvider, ProviderToken, StaticProvider, Injector, ValueSansProvider, ExistingSansProvider, StaticClassSansProvider, ConstructorSansProvider, FactorySansProvider, ClassSansProvider, InjectionToken, InternalInjectFlags, InjectOptions, ValueEqualityFn, EventCallback, isSignal, enableProfiling as enableProfiling$1 } from './chrome_dev_tools_performance.d.js';
  8. export { AbstractType, CreateSignalOptions, DestroyRef, DestroyableInjector, ImportedNgModuleProviders, OutputRefSubscription, signal, InternalEnvironmentProviders as ɵInternalEnvironmentProviders, JSACTION_EVENT_CONTRACT as ɵJSACTION_EVENT_CONTRACT, Writable as ɵWritable, isEnvironmentProviders as ɵisEnvironmentProviders, ɵunwrapWritableSignal } from './chrome_dev_tools_performance.d.js';
  9. import { InputSignalNode, TypeDecorator, AfterRenderRef, EffectCleanupRegisterFn, SchemaMetadata, ComponentDef, DirectiveDef, CssSelectorList, DirectiveDefFeature, HostBindingsFunction, TAttributes, ContentQueriesFunction, ViewQueriesFunction, ComponentTemplate, TConstantsOrFactory, ComponentDefFeature, ViewEncapsulation as ViewEncapsulation$1, ChangeDetectionStrategy as ChangeDetectionStrategy$1, TypeOrFactory, DependencyTypeList, InputFlags, InputTransformFunction, EmbeddedViewRef, LView, ApplicationRef, ChangeDetectorRef, ComponentFactory as ComponentFactory$1, NgModuleRef as NgModuleRef$1, EnvironmentInjector, DirectiveWithBindings, Binding, ComponentRef as ComponentRef$1, ElementRef, ComponentFactoryResolver as ComponentFactoryResolver$1, InternalNgModuleRef, NgModuleFactory as NgModuleFactory$1, ViewRef as ViewRef$1, PlatformRef, NgZone, ChangeDetectionScheduler, NotificationSource, ɵɵFactoryDeclaration as __FactoryDeclaration, ɵɵInjectableDeclaration as __InjectableDeclaration, ɵɵNgModuleDeclaration as __NgModuleDeclaration, ɵɵInjectorDeclaration as __InjectorDeclaration, DeferBlockDependencyInterceptor, DeferBlockConfig, DeferBlockState, TNode, LContainer, TView, TDeferBlockDetails, RNode, Component, TrustedHTML, DehydratedDeferBlock, CompilerOptions, HostDirectiveConfig, ComponentType, NgModuleScopeInfoFromDecorator, DependencyResolverFn, TDeferDetailsFlags, SanitizerFn, LocalRefExtractor, OpaqueViewState, GlobalTargetResolver, ProjectionSlots, QueryFlags, QueryList, RElement, RawScopeInfoFromDecorator, ClassDebugInfo, Directive, NgModule, Pipe, TrustedScriptURL, TrustedScript, PipeType, DirectiveType } from './discovery.d.js';
  10. export { APP_BOOTSTRAP_LISTENER, BootstrapOptions, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, Compiler, CompilerFactory, ComponentDecorator, CreateEffectOptions, DebugElement, DebugEventListener, DebugNode, DirectiveDecorator, EffectCleanupFn, EffectRef, EventEmitter, HostBinding, HostBindingDecorator, HostListener, HostListenerDecorator, InjectableType, InjectorType, Input, InputDecorator, ListenerOptions, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModuleDecorator, NgProbeToken, Output, OutputDecorator, PipeDecorator, Predicate, Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2, Sanitizer, SecurityContext, asNativeElements, defineInjectable, effect, getDebugNode, inputBinding, outputBinding, twoWayBinding, AfterRenderManager as ɵAfterRenderManager, AnimationRendererType as ɵAnimationRendererType, AttributeMarker as ɵAttributeMarker, CONTAINER_HEADER_OFFSET as ɵCONTAINER_HEADER_OFFSET, DeferBlockBehavior as ɵDeferBlockBehavior, DeferBlockDetails as ɵDeferBlockDetails, EffectScheduler as ɵEffectScheduler, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, NG_INJ_DEF as ɵNG_INJ_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, 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, NoopNgZone as ɵNoopNgZone, PipeDef as ɵPipeDef, R3Injector as ɵR3Injector, RenderFlags as ɵRenderFlags, TracingAction as ɵTracingAction, TracingService as ɵTracingService, TracingSnapshot as ɵTracingSnapshot, ZONELESS_ENABLED as ɵZONELESS_ENABLED, getDebugNode as ɵgetDebugNode, getDeferBlocks as ɵgetDeferBlocks, getInjectableDef as ɵgetInjectableDef, injectChangeDetectorRef as ɵinjectChangeDetectorRef, isBoundToModule as ɵisBoundToModule, isInjectable as ɵisInjectable, ɵɵComponentDeclaration, ɵɵDirectiveDeclaration, ɵɵInjectorDef, ɵɵPipeDeclaration, ɵɵdefineInjectable, ɵɵdefineInjector } from './discovery.d.js';
  11. import { ResourceOptions, ResourceRef, ResourceStreamingLoader, ResourceStatus, WritableResource, Resource } from './api.d.js';
  12. export { BaseResourceOptions, OutputEmitterRef, OutputOptions, PromiseResourceOptions, ResourceLoader, ResourceLoaderParams, ResourceStreamItem, StreamingResourceOptions, output, getOutputDestroyRef as ɵgetOutputDestroyRef } from './api.d.js';
  13. import './event_dispatcher.d.js';
  14. import { Observable, Subscribable } from 'rxjs';
  15. export { setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl } from './weak_ref.d.js';
  16. export { setCurrentInjector as ɵsetCurrentInjector } from './primitives/di/index.js';
  17. import './signal.d.js';
  18. import '@angular/core/primitives/di';
  19. /**
  20. * @publicAPI
  21. *
  22. * Options for signal inputs.
  23. */
  24. interface InputOptions<T, TransformT> {
  25. /** Optional public name for the input. By default, the class field name is used. */
  26. alias?: string;
  27. /**
  28. * Optional transform that runs whenever a new value is bound. Can be used to
  29. * transform the input value before the input is updated.
  30. *
  31. * The transform function can widen the type of the input. For example, consider
  32. * an input for `disabled`. In practice, as the component author, you want to only
  33. * deal with a boolean, but users may want to bind a string if they just use the
  34. * attribute form to bind to the input via `<my-dir input>`. A transform can then
  35. * handle such string values and convert them to `boolean`. See: {@link booleanAttribute}.
  36. */
  37. transform?: (v: TransformT) => T;
  38. /**
  39. * A debug name for the input signal. Used in Angular DevTools to identify the signal.
  40. */
  41. debugName?: string;
  42. }
  43. /**
  44. * Signal input options without the transform option.
  45. *
  46. * @publicApi 19.0
  47. */
  48. type InputOptionsWithoutTransform<T> = Omit<InputOptions<T, T>, 'transform'> & {
  49. transform?: undefined;
  50. };
  51. /**
  52. * Signal input options with the transform option required.
  53. *
  54. * @publicAPI
  55. */
  56. type InputOptionsWithTransform<T, TransformT> = Required<Pick<InputOptions<T, TransformT>, 'transform'>> & InputOptions<T, TransformT>;
  57. declare const ɵINPUT_SIGNAL_BRAND_READ_TYPE: unique symbol;
  58. declare const ɵINPUT_SIGNAL_BRAND_WRITE_TYPE: unique symbol;
  59. /**
  60. * `InputSignalWithTransform` represents a special `Signal` for a
  61. * directive/component input with a `transform` function.
  62. *
  63. * Signal inputs with transforms capture an extra generic for their transform write
  64. * type. Transforms can expand the accepted bound values for an input while ensuring
  65. * value retrievals of the signal input are still matching the generic input type.
  66. *
  67. * ```ts
  68. * class MyDir {
  69. * disabled = input(false, {
  70. * transform: (v: string|boolean) => convertToBoolean(v),
  71. * }); // InputSignalWithTransform<boolean, string|boolean>
  72. *
  73. * click() {
  74. * this.disabled() // always returns a `boolean`.
  75. * }
  76. * }
  77. * ```
  78. *
  79. * @see {@link InputSignal} for additional information.
  80. *
  81. * @publicApi 19.0
  82. */
  83. interface InputSignalWithTransform<T, TransformT> extends Signal<T> {
  84. [SIGNAL]: InputSignalNode<T, TransformT>;
  85. [ɵINPUT_SIGNAL_BRAND_READ_TYPE]: T;
  86. [ɵINPUT_SIGNAL_BRAND_WRITE_TYPE]: TransformT;
  87. }
  88. /**
  89. * `InputSignal` represents a special `Signal` for a directive/component input.
  90. *
  91. * An input signal is similar to a non-writable signal except that it also
  92. * carries additional type-information for transforms, and that Angular internally
  93. * updates the signal whenever a new value is bound.
  94. *
  95. * @see {@link InputOptionsWithTransform} for inputs with transforms.
  96. *
  97. * @publicApi 19.0
  98. */
  99. interface InputSignal<T> extends InputSignalWithTransform<T, T> {
  100. }
  101. /**
  102. * The `input` function allows declaration of inputs in directives and
  103. * components.
  104. *
  105. * The function exposes an API for also declaring required inputs via the
  106. * `input.required` function.
  107. *
  108. * @publicAPI
  109. * @docsPrivate Ignored because `input` is the canonical API entry.
  110. */
  111. interface InputFunction {
  112. /**
  113. * Initializes an input of type `T` with an initial value of `undefined`.
  114. * Angular will implicitly use `undefined` as initial value.
  115. */
  116. <T>(): InputSignal<T | undefined>;
  117. /** Declares an input of type `T` with an explicit initial value. */
  118. <T>(initialValue: T, opts?: InputOptionsWithoutTransform<T>): InputSignal<T>;
  119. /** Declares an input of type `T|undefined` without an initial value, but with input options */
  120. <T>(initialValue: undefined, opts: InputOptionsWithoutTransform<T>): InputSignal<T | undefined>;
  121. /**
  122. * Declares an input of type `T` with an initial value and a transform
  123. * function.
  124. *
  125. * The input accepts values of type `TransformT` and the given
  126. * transform function will transform the value to type `T`.
  127. */
  128. <T, TransformT>(initialValue: T, opts: InputOptionsWithTransform<T, TransformT>): InputSignalWithTransform<T, TransformT>;
  129. /**
  130. * Declares an input of type `T|undefined` without an initial value and with a transform
  131. * function.
  132. *
  133. * The input accepts values of type `TransformT` and the given
  134. * transform function will transform the value to type `T|undefined`.
  135. */ <T, TransformT>(initialValue: undefined, opts: InputOptionsWithTransform<T | undefined, TransformT>): InputSignalWithTransform<T | undefined, TransformT>;
  136. /**
  137. * Initializes a required input.
  138. *
  139. * Consumers of your directive/component need to bind to this
  140. * input. If unset, a compile time error will be reported.
  141. *
  142. * @publicAPI
  143. */
  144. required: {
  145. /** Declares a required input of type `T`. */
  146. <T>(opts?: InputOptionsWithoutTransform<T>): InputSignal<T>;
  147. /**
  148. * Declares a required input of type `T` with a transform function.
  149. *
  150. * The input accepts values of type `TransformT` and the given
  151. * transform function will transform the value to type `T`.
  152. */
  153. <T, TransformT>(opts: InputOptionsWithTransform<T, TransformT>): InputSignalWithTransform<T, TransformT>;
  154. };
  155. }
  156. /**
  157. * The `input` function allows declaration of Angular inputs in directives
  158. * and components.
  159. *
  160. * There are two variants of inputs that can be declared:
  161. *
  162. * 1. **Optional inputs** with an initial value.
  163. * 2. **Required inputs** that consumers need to set.
  164. *
  165. * By default, the `input` function will declare optional inputs that
  166. * always have an initial value. Required inputs can be declared
  167. * using the `input.required()` function.
  168. *
  169. * Inputs are signals. The values of an input are exposed as a `Signal`.
  170. * The signal always holds the latest value of the input that is bound
  171. * from the parent.
  172. *
  173. * @usageNotes
  174. * To use signal-based inputs, import `input` from `@angular/core`.
  175. *
  176. * ```ts
  177. * import {input} from '@angular/core`;
  178. * ```
  179. *
  180. * Inside your component, introduce a new class member and initialize
  181. * it with a call to `input` or `input.required`.
  182. *
  183. * ```ts
  184. * @Component({
  185. * ...
  186. * })
  187. * export class UserProfileComponent {
  188. * firstName = input<string>(); // Signal<string|undefined>
  189. * lastName = input.required<string>(); // Signal<string>
  190. * age = input(0) // Signal<number>
  191. * }
  192. * ```
  193. *
  194. * Inside your component template, you can display values of the inputs
  195. * by calling the signal.
  196. *
  197. * ```html
  198. * <span>{{firstName()}}</span>
  199. * ```
  200. *
  201. * @publicAPI
  202. * @initializerApiFunction
  203. */
  204. declare const input: InputFunction;
  205. /** Retrieves the write type of an `InputSignal` and `InputSignalWithTransform`. */
  206. type ɵUnwrapInputSignalWriteType<Field> = Field extends InputSignalWithTransform<any, infer WriteT> ? WriteT : never;
  207. /**
  208. * Unwraps all `InputSignal`/`InputSignalWithTransform` class fields of
  209. * the given directive.
  210. */
  211. type ɵUnwrapDirectiveSignalInputs<Dir, Fields extends keyof Dir> = {
  212. [P in Fields]: ɵUnwrapInputSignalWriteType<Dir[P]>;
  213. };
  214. /**
  215. * @publicAPI
  216. *
  217. * Options for model signals.
  218. */
  219. interface ModelOptions {
  220. /**
  221. * Optional public name of the input side of the model. The output side will have the same
  222. * name as the input, but suffixed with `Change`. By default, the class field name is used.
  223. */
  224. alias?: string;
  225. /**
  226. * A debug name for the model signal. Used in Angular DevTools to identify the signal.
  227. */
  228. debugName?: string;
  229. }
  230. /**
  231. * `ModelSignal` represents a special `Signal` for a directive/component model field.
  232. *
  233. * A model signal is a writeable signal that can be exposed as an output.
  234. * Whenever its value is updated, it emits to the output.
  235. *
  236. * @publicAPI
  237. */
  238. interface ModelSignal<T> extends WritableSignal<T>, InputSignal<T>, OutputRef<T> {
  239. [SIGNAL]: InputSignalNode<T, T>;
  240. }
  241. /**
  242. * `model` declares a writeable signal that is exposed as an input/output pair on the containing
  243. * directive. The input name is taken either from the class member or from the `alias` option.
  244. * The output name is generated by taking the input name and appending `Change`.
  245. *
  246. * The function exposes an API for also declaring required models via the
  247. * `model.required` function.
  248. *
  249. * @publicAPI
  250. * @docsPrivate Ignored because `model` is the canonical API entry.
  251. */
  252. interface ModelFunction {
  253. /**
  254. * Initializes a model of type `T` with an initial value of `undefined`.
  255. * Angular will implicitly use `undefined` as initial value.
  256. */
  257. <T>(): ModelSignal<T | undefined>;
  258. /** Initializes a model of type `T` with the given initial value. */
  259. <T>(initialValue: T, opts?: ModelOptions): ModelSignal<T>;
  260. required: {
  261. /**
  262. * Initializes a required model.
  263. *
  264. * Users of your directive/component need to bind to the input side of the model.
  265. * If unset, a compile time error will be reported.
  266. */
  267. <T>(opts?: ModelOptions): ModelSignal<T>;
  268. };
  269. }
  270. /**
  271. * `model` declares a writeable signal that is exposed as an input/output
  272. * pair on the containing directive.
  273. *
  274. * The input name is taken either from the class member or from the `alias` option.
  275. * The output name is generated by taking the input name and appending `Change`.
  276. *
  277. * @usageNotes
  278. *
  279. * To use `model()`, import the function from `@angular/core`.
  280. *
  281. * ```ts
  282. * import {model} from '@angular/core`;
  283. * ```
  284. *
  285. * Inside your component, introduce a new class member and initialize
  286. * it with a call to `model` or `model.required`.
  287. *
  288. * ```ts
  289. * @Directive({
  290. * ...
  291. * })
  292. * export class MyDir {
  293. * firstName = model<string>(); // ModelSignal<string|undefined>
  294. * lastName = model.required<string>(); // ModelSignal<string>
  295. * age = model(0); // ModelSignal<number>
  296. * }
  297. * ```
  298. *
  299. * Inside your component template, you can display the value of a `model`
  300. * by calling the signal.
  301. *
  302. * ```html
  303. * <span>{{firstName()}}</span>
  304. * ```
  305. *
  306. * Updating the `model` is equivalent to updating a writable signal.
  307. *
  308. * ```ts
  309. * updateName(newFirstName: string): void {
  310. * this.firstName.set(newFirstName);
  311. * }
  312. * ```
  313. *
  314. * @publicApi 19.0
  315. * @initializerApiFunction
  316. */
  317. declare const model: ModelFunction;
  318. /**
  319. * Wrap an array of `Provider`s into `EnvironmentProviders`, preventing them from being accidentally
  320. * referenced in `@Component` in a component injector.
  321. *
  322. * @publicApi
  323. */
  324. declare function makeEnvironmentProviders(providers: (Provider | EnvironmentProviders)[]): EnvironmentProviders;
  325. /**
  326. * @description
  327. * This function is used to provide initialization functions that will be executed upon construction
  328. * of an environment injector.
  329. *
  330. * Note that the provided initializer is run in the injection context.
  331. *
  332. * Previously, this was achieved using the `ENVIRONMENT_INITIALIZER` token which is now deprecated.
  333. *
  334. * @see {@link ENVIRONMENT_INITIALIZER}
  335. *
  336. * @usageNotes
  337. * The following example illustrates how to configure an initialization function using
  338. * `provideEnvironmentInitializer()`
  339. * ```ts
  340. * createEnvironmentInjector(
  341. * [
  342. * provideEnvironmentInitializer(() => {
  343. * console.log('environment initialized');
  344. * }),
  345. * ],
  346. * parentInjector
  347. * );
  348. * ```
  349. *
  350. * @publicApi
  351. */
  352. declare function provideEnvironmentInitializer(initializerFn: () => void): EnvironmentProviders;
  353. /**
  354. * A source of providers for the `importProvidersFrom` function.
  355. *
  356. * @publicApi
  357. */
  358. type ImportProvidersSource = Type$1<unknown> | ModuleWithProviders<unknown> | Array<ImportProvidersSource>;
  359. /**
  360. * Collects providers from all NgModules and standalone components, including transitively imported
  361. * ones.
  362. *
  363. * Providers extracted via `importProvidersFrom` are only usable in an application injector or
  364. * another environment injector (such as a route injector). They should not be used in component
  365. * providers.
  366. *
  367. * More information about standalone components can be found in [this
  368. * guide](guide/components/importing).
  369. *
  370. * @usageNotes
  371. * The results of the `importProvidersFrom` call can be used in the `bootstrapApplication` call:
  372. *
  373. * ```ts
  374. * await bootstrapApplication(RootComponent, {
  375. * providers: [
  376. * importProvidersFrom(NgModuleOne, NgModuleTwo)
  377. * ]
  378. * });
  379. * ```
  380. *
  381. * You can also use the `importProvidersFrom` results in the `providers` field of a route, when a
  382. * standalone component is used:
  383. *
  384. * ```ts
  385. * export const ROUTES: Route[] = [
  386. * {
  387. * path: 'foo',
  388. * providers: [
  389. * importProvidersFrom(NgModuleOne, NgModuleTwo)
  390. * ],
  391. * component: YourStandaloneComponent
  392. * }
  393. * ];
  394. * ```
  395. *
  396. * @returns Collected providers from the specified list of types.
  397. * @publicApi
  398. */
  399. declare function importProvidersFrom(...sources: ImportProvidersSource[]): EnvironmentProviders;
  400. /**
  401. * Internal type for a single provider in a deep provider array.
  402. */
  403. type SingleProvider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | StaticClassProvider;
  404. /**
  405. * Type of the `viewChild` function. The viewChild function creates a singular view query.
  406. *
  407. * It is a special function that also provides access to required query results via the `.required`
  408. * property.
  409. *
  410. * @publicApi
  411. * @docsPrivate Ignored because `viewChild` is the canonical API entry.
  412. */
  413. interface ViewChildFunction {
  414. /**
  415. * Initializes a view child query. Consider using `viewChild.required` for queries that should
  416. * always match.
  417. *
  418. * @publicAPI
  419. */
  420. <LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  421. read: ProviderToken<ReadT>;
  422. debugName?: string;
  423. }): Signal<ReadT | undefined>;
  424. <LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  425. debugName?: string;
  426. }): Signal<LocatorT | undefined>;
  427. /**
  428. * Initializes a view child query that is expected to always match an element.
  429. *
  430. * @publicAPI
  431. */
  432. required: {
  433. <LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  434. debugName?: string;
  435. }): Signal<LocatorT>;
  436. <LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  437. read: ProviderToken<ReadT>;
  438. debugName?: string;
  439. }): Signal<ReadT>;
  440. };
  441. }
  442. /**
  443. * Initializes a view child query.
  444. *
  445. * Consider using `viewChild.required` for queries that should always match.
  446. *
  447. * @usageNotes
  448. * Create a child query in your component by declaring a
  449. * class field and initializing it with the `viewChild()` function.
  450. *
  451. * ```angular-ts
  452. * @Component({template: '<div #el></div><my-component #cmp />'})
  453. * export class TestComponent {
  454. * divEl = viewChild<ElementRef>('el'); // Signal<ElementRef|undefined>
  455. * divElRequired = viewChild.required<ElementRef>('el'); // Signal<ElementRef>
  456. * cmp = viewChild(MyComponent); // Signal<MyComponent|undefined>
  457. * cmpRequired = viewChild.required(MyComponent); // Signal<MyComponent>
  458. * }
  459. * ```
  460. *
  461. * @publicApi 19.0
  462. * @initializerApiFunction
  463. */
  464. declare const viewChild: ViewChildFunction;
  465. declare function viewChildren<LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  466. debugName?: string;
  467. }): Signal<ReadonlyArray<LocatorT>>;
  468. declare function viewChildren<LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  469. read: ProviderToken<ReadT>;
  470. debugName?: string;
  471. }): Signal<ReadonlyArray<ReadT>>;
  472. /**
  473. * Type of the `contentChild` function.
  474. *
  475. * The contentChild function creates a singular content query. It is a special function that also
  476. * provides access to required query results via the `.required` property.
  477. *
  478. * @publicApi 19.0
  479. * @docsPrivate Ignored because `contentChild` is the canonical API entry.
  480. */
  481. interface ContentChildFunction {
  482. /**
  483. * Initializes a content child query.
  484. *
  485. * Consider using `contentChild.required` for queries that should always match.
  486. * @publicAPI
  487. */
  488. <LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  489. descendants?: boolean;
  490. read?: undefined;
  491. debugName?: string;
  492. }): Signal<LocatorT | undefined>;
  493. <LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  494. descendants?: boolean;
  495. read: ProviderToken<ReadT>;
  496. debugName?: string;
  497. }): Signal<ReadT | undefined>;
  498. /**
  499. * Initializes a content child query that is always expected to match.
  500. */
  501. required: {
  502. <LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  503. descendants?: boolean;
  504. read?: undefined;
  505. debugName?: string;
  506. }): Signal<LocatorT>;
  507. <LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  508. descendants?: boolean;
  509. read: ProviderToken<ReadT>;
  510. debugName?: string;
  511. }): Signal<ReadT>;
  512. };
  513. }
  514. /**
  515. * Initializes a content child query. Consider using `contentChild.required` for queries that should
  516. * always match.
  517. *
  518. * @usageNotes
  519. * Create a child query in your component by declaring a
  520. * class field and initializing it with the `contentChild()` function.
  521. *
  522. * ```ts
  523. * @Component({...})
  524. * export class TestComponent {
  525. * headerEl = contentChild<ElementRef>('h'); // Signal<ElementRef|undefined>
  526. * headerElElRequired = contentChild.required<ElementRef>('h'); // Signal<ElementRef>
  527. * header = contentChild(MyHeader); // Signal<MyHeader|undefined>
  528. * headerRequired = contentChild.required(MyHeader); // Signal<MyHeader>
  529. * }
  530. * ```
  531. *
  532. * Note: By default `descendants` is `true` which means the query will traverse all descendants in the same template.
  533. *
  534. * @initializerApiFunction
  535. * @publicApi 19.0
  536. */
  537. declare const contentChild: ContentChildFunction;
  538. declare function contentChildren<LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
  539. descendants?: boolean;
  540. read?: undefined;
  541. debugName?: string;
  542. }): Signal<ReadonlyArray<LocatorT>>;
  543. declare function contentChildren<LocatorT, ReadT>(locator: ProviderToken<LocatorT> | string, opts: {
  544. descendants?: boolean;
  545. read: ProviderToken<ReadT>;
  546. debugName?: string;
  547. }): Signal<ReadonlyArray<ReadT>>;
  548. /**
  549. * Type of the Attribute decorator / constructor function.
  550. *
  551. * @publicApi
  552. */
  553. interface AttributeDecorator {
  554. /**
  555. * Parameter decorator for a directive constructor that designates
  556. * a host-element attribute whose value is injected as a constant string literal.
  557. *
  558. * @usageNotes
  559. *
  560. * Suppose we have an `<input>` element and want to know its `type`.
  561. *
  562. * ```html
  563. * <input type="text">
  564. * ```
  565. *
  566. * The following example uses the decorator to inject the string literal `text` in a directive.
  567. *
  568. * {@example core/ts/metadata/metadata.ts region='attributeMetadata'}
  569. *
  570. * The following example uses the decorator in a component constructor.
  571. *
  572. * {@example core/ts/metadata/metadata.ts region='attributeFactory'}
  573. *
  574. */
  575. (name: string): any;
  576. new (name: string): Attribute;
  577. }
  578. /**
  579. * Type of the Attribute metadata.
  580. *
  581. * @publicApi
  582. */
  583. interface Attribute {
  584. /**
  585. * The name of the attribute whose value can be injected.
  586. */
  587. attributeName: string;
  588. }
  589. /**
  590. * Attribute decorator and metadata.
  591. *
  592. * @Annotation
  593. * @publicApi
  594. */
  595. declare const Attribute: AttributeDecorator;
  596. /**
  597. * Represents a basic change from a previous to a new value for a single
  598. * property on a directive instance. Passed as a value in a
  599. * {@link SimpleChanges} object to the `ngOnChanges` hook.
  600. *
  601. * @see {@link OnChanges}
  602. *
  603. * @publicApi
  604. */
  605. declare class SimpleChange {
  606. previousValue: any;
  607. currentValue: any;
  608. firstChange: boolean;
  609. constructor(previousValue: any, currentValue: any, firstChange: boolean);
  610. /**
  611. * Check whether the new value is the first value assigned.
  612. */
  613. isFirstChange(): boolean;
  614. }
  615. /**
  616. * A hashtable of changes represented by {@link SimpleChange} objects stored
  617. * at the declared property name they belong to on a Directive or Component. This is
  618. * the type passed to the `ngOnChanges` hook.
  619. *
  620. * @see {@link OnChanges}
  621. *
  622. * @publicApi
  623. */
  624. interface SimpleChanges {
  625. [propName: string]: SimpleChange;
  626. }
  627. /**
  628. * @description
  629. * A lifecycle hook that is called when any data-bound property of a directive changes.
  630. * Define an `ngOnChanges()` method to handle the changes.
  631. *
  632. * @see {@link DoCheck}
  633. * @see {@link OnInit}
  634. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  635. *
  636. * @usageNotes
  637. * The following snippet shows how a component can implement this interface to
  638. * define an on-changes handler for an input property.
  639. *
  640. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnChanges'}
  641. *
  642. * @publicApi
  643. */
  644. interface OnChanges {
  645. /**
  646. * A callback method that is invoked immediately after the
  647. * default change detector has checked data-bound properties
  648. * if at least one has changed, and before the view and content
  649. * children are checked.
  650. * @param changes The changed properties.
  651. */
  652. ngOnChanges(changes: SimpleChanges): void;
  653. }
  654. /**
  655. * @description
  656. * A lifecycle hook that is called after Angular has initialized
  657. * all data-bound properties of a directive.
  658. * Define an `ngOnInit()` method to handle any additional initialization tasks.
  659. *
  660. * @see {@link AfterContentInit}
  661. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  662. *
  663. * @usageNotes
  664. * The following snippet shows how a component can implement this interface to
  665. * define its own initialization method.
  666. *
  667. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnInit'}
  668. *
  669. * @publicApi
  670. */
  671. interface OnInit {
  672. /**
  673. * A callback method that is invoked immediately after the
  674. * default change detector has checked the directive's
  675. * data-bound properties for the first time,
  676. * and before any of the view or content children have been checked.
  677. * It is invoked only once when the directive is instantiated.
  678. */
  679. ngOnInit(): void;
  680. }
  681. /**
  682. * A lifecycle hook that invokes a custom change-detection function for a directive,
  683. * in addition to the check performed by the default change-detector.
  684. *
  685. * The default change-detection algorithm looks for differences by comparing
  686. * bound-property values by reference across change detection runs. You can use this
  687. * hook to check for and respond to changes by some other means.
  688. *
  689. * When the default change detector detects changes, it invokes `ngOnChanges()` if supplied,
  690. * regardless of whether you perform additional change detection.
  691. * Typically, you should not use both `DoCheck` and `OnChanges` to respond to
  692. * changes on the same input.
  693. *
  694. * @see {@link OnChanges}
  695. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  696. *
  697. * @usageNotes
  698. * The following snippet shows how a component can implement this interface
  699. * to invoke it own change-detection cycle.
  700. *
  701. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='DoCheck'}
  702. *
  703. * For a more complete example and discussion, see
  704. * [Defining custom change detection](guide/components/lifecycle#defining-custom-change-detection).
  705. *
  706. * @publicApi
  707. */
  708. interface DoCheck {
  709. /**
  710. * A callback method that performs change-detection, invoked
  711. * after the default change-detector runs.
  712. * See `KeyValueDiffers` and `IterableDiffers` for implementing
  713. * custom change checking for collections.
  714. *
  715. */
  716. ngDoCheck(): void;
  717. }
  718. /**
  719. * A lifecycle hook that is called when a directive, pipe, or service is destroyed.
  720. * Use for any custom cleanup that needs to occur when the
  721. * instance is destroyed.
  722. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  723. *
  724. * @usageNotes
  725. * The following snippet shows how a component can implement this interface
  726. * to define its own custom clean-up method.
  727. *
  728. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='OnDestroy'}
  729. *
  730. * @publicApi
  731. */
  732. interface OnDestroy {
  733. /**
  734. * A callback method that performs custom clean-up, invoked immediately
  735. * before a directive, pipe, or service instance is destroyed.
  736. */
  737. ngOnDestroy(): void;
  738. }
  739. /**
  740. * @description
  741. * A lifecycle hook that is called after Angular has fully initialized
  742. * all content of a directive. It will run only once when the projected content is initialized.
  743. * Define an `ngAfterContentInit()` method to handle any additional initialization tasks.
  744. *
  745. * @see {@link OnInit}
  746. * @see {@link AfterViewInit}
  747. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  748. *
  749. * @usageNotes
  750. * The following snippet shows how a component can implement this interface to
  751. * define its own content initialization method.
  752. *
  753. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterContentInit'}
  754. *
  755. * @publicApi
  756. */
  757. interface AfterContentInit {
  758. /**
  759. * A callback method that is invoked immediately after
  760. * Angular has completed initialization of all of the directive's
  761. * content.
  762. * It is invoked only once when the directive is instantiated.
  763. */
  764. ngAfterContentInit(): void;
  765. }
  766. /**
  767. * @description
  768. * A lifecycle hook that is called after the default change detector has
  769. * completed checking all content of a directive. It will run after the content
  770. * has been checked and most of the time it's during a change detection cycle.
  771. *
  772. * @see {@link AfterViewChecked}
  773. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  774. *
  775. * @usageNotes
  776. * The following snippet shows how a component can implement this interface to
  777. * define its own after-check functionality.
  778. *
  779. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterContentChecked'}
  780. *
  781. * @publicApi
  782. */
  783. interface AfterContentChecked {
  784. /**
  785. * A callback method that is invoked immediately after the
  786. * default change detector has completed checking all of the directive's
  787. * content.
  788. */
  789. ngAfterContentChecked(): void;
  790. }
  791. /**
  792. * @description
  793. * A lifecycle hook that is called after Angular has fully initialized
  794. * a component's view.
  795. * Define an `ngAfterViewInit()` method to handle any additional initialization tasks.
  796. *
  797. * @see {@link OnInit}
  798. * @see {@link AfterContentInit}
  799. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  800. *
  801. * @usageNotes
  802. * The following snippet shows how a component can implement this interface to
  803. * define its own view initialization method.
  804. *
  805. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterViewInit'}
  806. *
  807. * @publicApi
  808. */
  809. interface AfterViewInit {
  810. /**
  811. * A callback method that is invoked immediately after
  812. * Angular has completed initialization of a component's view.
  813. * It is invoked only once when the view is instantiated.
  814. *
  815. */
  816. ngAfterViewInit(): void;
  817. }
  818. /**
  819. * @description
  820. * A lifecycle hook that is called after the default change detector has
  821. * completed checking a component's view for changes.
  822. *
  823. * @see {@link AfterContentChecked}
  824. * @see [Lifecycle hooks guide](guide/components/lifecycle)
  825. *
  826. * @usageNotes
  827. * The following snippet shows how a component can implement this interface to
  828. * define its own after-check functionality.
  829. *
  830. * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='AfterViewChecked'}
  831. *
  832. * @publicApi
  833. */
  834. interface AfterViewChecked {
  835. /**
  836. * A callback method that is invoked immediately after the
  837. * default change detector has completed one change-check cycle
  838. * for a component's view.
  839. */
  840. ngAfterViewChecked(): void;
  841. }
  842. /**
  843. * Type of the Query metadata.
  844. *
  845. * @publicApi
  846. */
  847. interface Query {
  848. descendants: boolean;
  849. emitDistinctChangesOnly: boolean;
  850. first: boolean;
  851. read: any;
  852. isViewQuery: boolean;
  853. selector: any;
  854. static?: boolean;
  855. }
  856. /**
  857. * Base class for query metadata.
  858. *
  859. * @see {@link ContentChildren}
  860. * @see {@link ContentChild}
  861. * @see {@link ViewChildren}
  862. * @see {@link ViewChild}
  863. *
  864. * @publicApi
  865. */
  866. declare abstract class Query {
  867. }
  868. /**
  869. * Type of the ContentChildren decorator / constructor function.
  870. *
  871. * @see {@link ContentChildren}
  872. * @publicApi
  873. */
  874. interface ContentChildrenDecorator {
  875. /**
  876. * @description
  877. * Property decorator that configures a content query.
  878. *
  879. * Use to get the `QueryList` of elements or directives from the content DOM.
  880. * Any time a child element is added, removed, or moved, the query list will be
  881. * updated, and the changes observable of the query list will emit a new value.
  882. *
  883. * Content queries are set before the `ngAfterContentInit` callback is called.
  884. *
  885. * Does not retrieve elements or directives that are in other components' templates,
  886. * since a component's template is always a black box to its ancestors.
  887. *
  888. * **Metadata Properties**:
  889. *
  890. * * **selector** - The directive type or the name used for querying.
  891. * * **descendants** - If `true` include all descendants of the element. If `false` then only
  892. * query direct children of the element.
  893. * * **emitDistinctChangesOnly** - The ` QueryList#changes` observable will emit new values only
  894. * if the QueryList result has changed. When `false` the `changes` observable might emit even
  895. * if the QueryList has not changed.
  896. * ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and
  897. * removed in future versions of Angular.
  898. * * **read** - Used to read a different token from the queried elements.
  899. *
  900. * The following selectors are supported.
  901. * * Any class with the `@Component` or `@Directive` decorator
  902. * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
  903. * with `@ContentChildren('cmp')`)
  904. * * Any provider defined in the child component tree of the current component (e.g.
  905. * `@ContentChildren(SomeService) someService: SomeService`)
  906. * * Any provider defined through a string token (e.g. `@ContentChildren('someToken')
  907. * someTokenVal: any`)
  908. * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with
  909. * `@ContentChildren(TemplateRef) template;`)
  910. *
  911. * In addition, multiple string selectors can be separated with a comma (e.g.
  912. * `@ContentChildren('cmp1,cmp2')`)
  913. *
  914. * The following values are supported by `read`:
  915. * * Any class with the `@Component` or `@Directive` decorator
  916. * * Any provider defined on the injector of the component that is matched by the `selector` of
  917. * this query
  918. * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
  919. * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
  920. *
  921. * @usageNotes
  922. *
  923. * Here is a simple demonstration of how the `ContentChildren` decorator can be used.
  924. *
  925. * {@example core/di/ts/contentChildren/content_children_howto.ts region='HowTo'}
  926. *
  927. * ### Tab-pane example
  928. *
  929. * Here is a slightly more realistic example that shows how `ContentChildren` decorators
  930. * can be used to implement a tab pane component.
  931. *
  932. * {@example core/di/ts/contentChildren/content_children_example.ts region='Component'}
  933. *
  934. * @Annotation
  935. */
  936. (selector: ProviderToken<unknown> | Function | string, opts?: {
  937. descendants?: boolean;
  938. emitDistinctChangesOnly?: boolean;
  939. read?: any;
  940. }): any;
  941. new (selector: ProviderToken<unknown> | Function | string, opts?: {
  942. descendants?: boolean;
  943. emitDistinctChangesOnly?: boolean;
  944. read?: any;
  945. }): Query;
  946. }
  947. /**
  948. * Type of the ContentChildren metadata.
  949. *
  950. *
  951. * @Annotation
  952. * @publicApi
  953. */
  954. type ContentChildren = Query;
  955. /**
  956. * ContentChildren decorator and metadata.
  957. *
  958. *
  959. * @Annotation
  960. * @publicApi
  961. */
  962. declare const ContentChildren: ContentChildrenDecorator;
  963. /**
  964. * Type of the ContentChild decorator / constructor function.
  965. *
  966. * @publicApi
  967. */
  968. interface ContentChildDecorator {
  969. /**
  970. * @description
  971. * Property decorator that configures a content query.
  972. *
  973. * Use to get the first element or the directive matching the selector from the content DOM.
  974. * If the content DOM changes, and a new child matches the selector,
  975. * the property will be updated.
  976. *
  977. * Does not retrieve elements or directives that are in other components' templates,
  978. * since a component's template is always a black box to its ancestors.
  979. *
  980. * **Metadata Properties**:
  981. *
  982. * * **selector** - The directive type or the name used for querying.
  983. * * **descendants** - If `true` (default) include all descendants of the element. If `false` then
  984. * only query direct children of the element.
  985. * * **read** - Used to read a different token from the queried element.
  986. * * **static** - True to resolve query results before change detection runs,
  987. * false to resolve after change detection. Defaults to false.
  988. *
  989. * The following selectors are supported.
  990. * * Any class with the `@Component` or `@Directive` decorator
  991. * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
  992. * with `@ContentChild('cmp')`)
  993. * * Any provider defined in the child component tree of the current component (e.g.
  994. * `@ContentChild(SomeService) someService: SomeService`)
  995. * * Any provider defined through a string token (e.g. `@ContentChild('someToken') someTokenVal:
  996. * any`)
  997. * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ContentChild(TemplateRef)
  998. * template;`)
  999. *
  1000. * The following values are supported by `read`:
  1001. * * Any class with the `@Component` or `@Directive` decorator
  1002. * * Any provider defined on the injector of the component that is matched by the `selector` of
  1003. * this query
  1004. * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
  1005. * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
  1006. *
  1007. * Difference between dynamic and static queries:
  1008. *
  1009. * | Queries | Details |
  1010. * |:--- |:--- |
  1011. * | Dynamic queries \(`static: false`\) | The query resolves before the `ngAfterContentInit()`
  1012. * callback is called. The result will be updated for changes to your view, such as changes to
  1013. * `ngIf` and `ngFor` blocks. | | Static queries \(`static: true`\) | The query resolves once
  1014. * the view has been created, but before change detection runs (before the `ngOnInit()` callback
  1015. * is called). The result, though, will never be updated to reflect changes to your view, such as
  1016. * changes to `ngIf` and `ngFor` blocks. |
  1017. *
  1018. * @usageNotes
  1019. *
  1020. * {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'}
  1021. *
  1022. * ### Example
  1023. *
  1024. * {@example core/di/ts/contentChild/content_child_example.ts region='Component'}
  1025. *
  1026. * @Annotation
  1027. */
  1028. (selector: ProviderToken<unknown> | Function | string, opts?: {
  1029. descendants?: boolean;
  1030. read?: any;
  1031. static?: boolean;
  1032. }): any;
  1033. new (selector: ProviderToken<unknown> | Function | string, opts?: {
  1034. descendants?: boolean;
  1035. read?: any;
  1036. static?: boolean;
  1037. }): ContentChild;
  1038. }
  1039. /**
  1040. * Type of the ContentChild metadata.
  1041. *
  1042. * @publicApi
  1043. */
  1044. type ContentChild = Query;
  1045. /**
  1046. * ContentChild decorator and metadata.
  1047. *
  1048. *
  1049. * @Annotation
  1050. *
  1051. * @publicApi
  1052. */
  1053. declare const ContentChild: ContentChildDecorator;
  1054. /**
  1055. * Type of the ViewChildren decorator / constructor function.
  1056. *
  1057. * @see {@link ViewChildren}
  1058. *
  1059. * @publicApi
  1060. */
  1061. interface ViewChildrenDecorator {
  1062. /**
  1063. * @description
  1064. * Property decorator that configures a view query.
  1065. *
  1066. * Use to get the `QueryList` of elements or directives from the view DOM.
  1067. * Any time a child element is added, removed, or moved, the query list will be updated,
  1068. * and the changes observable of the query list will emit a new value.
  1069. *
  1070. * View queries are set before the `ngAfterViewInit` callback is called.
  1071. *
  1072. * **Metadata Properties**:
  1073. *
  1074. * * **selector** - The directive type or the name used for querying.
  1075. * * **read** - Used to read a different token from the queried elements.
  1076. * * **emitDistinctChangesOnly** - The ` QueryList#changes` observable will emit new values only
  1077. * if the QueryList result has changed. When `false` the `changes` observable might emit even
  1078. * if the QueryList has not changed.
  1079. * ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and
  1080. * removed in future versions of Angular.
  1081. *
  1082. * The following selectors are supported.
  1083. * * Any class with the `@Component` or `@Directive` decorator
  1084. * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
  1085. * with `@ViewChildren('cmp')`)
  1086. * * Any provider defined in the child component tree of the current component (e.g.
  1087. * `@ViewChildren(SomeService) someService!: SomeService`)
  1088. * * Any provider defined through a string token (e.g. `@ViewChildren('someToken')
  1089. * someTokenVal!: any`)
  1090. * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChildren(TemplateRef)
  1091. * template;`)
  1092. *
  1093. * In addition, multiple string selectors can be separated with a comma (e.g.
  1094. * `@ViewChildren('cmp1,cmp2')`)
  1095. *
  1096. * The following values are supported by `read`:
  1097. * * Any class with the `@Component` or `@Directive` decorator
  1098. * * Any provider defined on the injector of the component that is matched by the `selector` of
  1099. * this query
  1100. * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
  1101. * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
  1102. *
  1103. * @usageNotes
  1104. *
  1105. * {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'}
  1106. *
  1107. * ### Another example
  1108. *
  1109. * {@example core/di/ts/viewChildren/view_children_example.ts region='Component'}
  1110. *
  1111. * @Annotation
  1112. */
  1113. (selector: ProviderToken<unknown> | Function | string, opts?: {
  1114. read?: any;
  1115. emitDistinctChangesOnly?: boolean;
  1116. }): any;
  1117. new (selector: ProviderToken<unknown> | Function | string, opts?: {
  1118. read?: any;
  1119. emitDistinctChangesOnly?: boolean;
  1120. }): ViewChildren;
  1121. }
  1122. /**
  1123. * Type of the ViewChildren metadata.
  1124. *
  1125. * @publicApi
  1126. */
  1127. type ViewChildren = Query;
  1128. /**
  1129. * ViewChildren decorator and metadata.
  1130. *
  1131. * @Annotation
  1132. * @publicApi
  1133. */
  1134. declare const ViewChildren: ViewChildrenDecorator;
  1135. /**
  1136. * Type of the ViewChild decorator / constructor function.
  1137. *
  1138. * @see {@link ViewChild}
  1139. * @publicApi
  1140. */
  1141. interface ViewChildDecorator {
  1142. /**
  1143. * @description
  1144. * Property decorator that configures a view query.
  1145. * The change detector looks for the first element or the directive matching the selector
  1146. * in the view DOM. If the view DOM changes, and a new child matches the selector,
  1147. * the property is updated.
  1148. *
  1149. * **Metadata Properties**:
  1150. *
  1151. * * **selector** - The directive type or the name used for querying.
  1152. * * **read** - Used to read a different token from the queried elements.
  1153. * * **static** - `true` to resolve query results before change detection runs,
  1154. * `false` to resolve after change detection. Defaults to `false`.
  1155. *
  1156. *
  1157. * The following selectors are supported.
  1158. * * Any class with the `@Component` or `@Directive` decorator
  1159. * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
  1160. * with `@ViewChild('cmp')`)
  1161. * * Any provider defined in the child component tree of the current component (e.g.
  1162. * `@ViewChild(SomeService) someService: SomeService`)
  1163. * * Any provider defined through a string token (e.g. `@ViewChild('someToken') someTokenVal:
  1164. * any`)
  1165. * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChild(TemplateRef)
  1166. * template;`)
  1167. *
  1168. * The following values are supported by `read`:
  1169. * * Any class with the `@Component` or `@Directive` decorator
  1170. * * Any provider defined on the injector of the component that is matched by the `selector` of
  1171. * this query
  1172. * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
  1173. * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
  1174. *
  1175. * Difference between dynamic and static queries:
  1176. * * Dynamic queries \(`static: false`\) - The query resolves before the `ngAfterViewInit()`
  1177. * callback is called. The result will be updated for changes to your view, such as changes to
  1178. * `ngIf` and `ngFor` blocks.
  1179. * * Static queries \(`static: true`\) - The query resolves once
  1180. * the view has been created, but before change detection runs (before the `ngOnInit()` callback
  1181. * is called). The result, though, will never be updated to reflect changes to your view, such as
  1182. * changes to `ngIf` and `ngFor` blocks.
  1183. *
  1184. * @usageNotes
  1185. *
  1186. * ### Example 1
  1187. *
  1188. * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}
  1189. *
  1190. * ### Example 2
  1191. *
  1192. * {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'}
  1193. *
  1194. * @Annotation
  1195. */
  1196. (selector: ProviderToken<unknown> | Function | string, opts?: {
  1197. read?: any;
  1198. static?: boolean;
  1199. }): any;
  1200. new (selector: ProviderToken<unknown> | Function | string, opts?: {
  1201. read?: any;
  1202. static?: boolean;
  1203. }): ViewChild;
  1204. }
  1205. /**
  1206. * Type of the ViewChild metadata.
  1207. *
  1208. * @publicApi
  1209. */
  1210. type ViewChild = Query;
  1211. /**
  1212. * ViewChild decorator and metadata.
  1213. *
  1214. * @Annotation
  1215. * @publicApi
  1216. */
  1217. declare const ViewChild: ViewChildDecorator;
  1218. /**
  1219. * A type describing supported iterable types.
  1220. *
  1221. * @publicApi
  1222. */
  1223. type NgIterable<T> = Array<T> | Iterable<T>;
  1224. /**
  1225. * A strategy for tracking changes over time to an iterable. Used by {@link /api/common/NgForOf NgForOf} to
  1226. * respond to changes in an iterable by effecting equivalent changes in the DOM.
  1227. *
  1228. * @publicApi
  1229. */
  1230. interface IterableDiffer<V> {
  1231. /**
  1232. * Compute a difference between the previous state and the new `object` state.
  1233. *
  1234. * @param object containing the new value.
  1235. * @returns an object describing the difference. The return value is only valid until the next
  1236. * `diff()` invocation.
  1237. */
  1238. diff(object: NgIterable<V> | undefined | null): IterableChanges<V> | null;
  1239. }
  1240. /**
  1241. * An object describing the changes in the `Iterable` collection since last time
  1242. * `IterableDiffer#diff()` was invoked.
  1243. *
  1244. * @publicApi
  1245. */
  1246. interface IterableChanges<V> {
  1247. /**
  1248. * Iterate over all changes. `IterableChangeRecord` will contain information about changes
  1249. * to each item.
  1250. */
  1251. forEachItem(fn: (record: IterableChangeRecord<V>) => void): void;
  1252. /**
  1253. * Iterate over a set of operations which when applied to the original `Iterable` will produce the
  1254. * new `Iterable`.
  1255. *
  1256. * NOTE: These are not necessarily the actual operations which were applied to the original
  1257. * `Iterable`, rather these are a set of computed operations which may not be the same as the
  1258. * ones applied.
  1259. *
  1260. * @param record A change which needs to be applied
  1261. * @param previousIndex The `IterableChangeRecord#previousIndex` of the `record` refers to the
  1262. * original `Iterable` location, where as `previousIndex` refers to the transient location
  1263. * of the item, after applying the operations up to this point.
  1264. * @param currentIndex The `IterableChangeRecord#currentIndex` of the `record` refers to the
  1265. * original `Iterable` location, where as `currentIndex` refers to the transient location
  1266. * of the item, after applying the operations up to this point.
  1267. */
  1268. forEachOperation(fn: (record: IterableChangeRecord<V>, previousIndex: number | null, currentIndex: number | null) => void): void;
  1269. /**
  1270. * Iterate over changes in the order of original `Iterable` showing where the original items
  1271. * have moved.
  1272. */
  1273. forEachPreviousItem(fn: (record: IterableChangeRecord<V>) => void): void;
  1274. /** Iterate over all added items. */
  1275. forEachAddedItem(fn: (record: IterableChangeRecord<V>) => void): void;
  1276. /** Iterate over all moved items. */
  1277. forEachMovedItem(fn: (record: IterableChangeRecord<V>) => void): void;
  1278. /** Iterate over all removed items. */
  1279. forEachRemovedItem(fn: (record: IterableChangeRecord<V>) => void): void;
  1280. /**
  1281. * Iterate over all items which had their identity (as computed by the `TrackByFunction`)
  1282. * changed.
  1283. */
  1284. forEachIdentityChange(fn: (record: IterableChangeRecord<V>) => void): void;
  1285. }
  1286. /**
  1287. * Record representing the item change information.
  1288. *
  1289. * @publicApi
  1290. */
  1291. interface IterableChangeRecord<V> {
  1292. /** Current index of the item in `Iterable` or null if removed. */
  1293. readonly currentIndex: number | null;
  1294. /** Previous index of the item in `Iterable` or null if added. */
  1295. readonly previousIndex: number | null;
  1296. /** The item. */
  1297. readonly item: V;
  1298. /** Track by identity as computed by the `TrackByFunction`. */
  1299. readonly trackById: any;
  1300. }
  1301. /**
  1302. * A function optionally passed into the `NgForOf` directive to customize how `NgForOf` uniquely
  1303. * identifies items in an iterable.
  1304. *
  1305. * `NgForOf` needs to uniquely identify items in the iterable to correctly perform DOM updates
  1306. * when items in the iterable are reordered, new items are added, or existing items are removed.
  1307. *
  1308. *
  1309. * In all of these scenarios it is usually desirable to only update the DOM elements associated
  1310. * with the items affected by the change. This behavior is important to:
  1311. *
  1312. * - preserve any DOM-specific UI state (like cursor position, focus, text selection) when the
  1313. * iterable is modified
  1314. * - enable animation of item addition, removal, and iterable reordering
  1315. * - preserve the value of the `<select>` element when nested `<option>` elements are dynamically
  1316. * populated using `NgForOf` and the bound iterable is updated
  1317. *
  1318. * A common use for custom `trackBy` functions is when the model that `NgForOf` iterates over
  1319. * contains a property with a unique identifier. For example, given a model:
  1320. *
  1321. * ```ts
  1322. * class User {
  1323. * id: number;
  1324. * name: string;
  1325. * ...
  1326. * }
  1327. * ```
  1328. * a custom `trackBy` function could look like the following:
  1329. * ```ts
  1330. * function userTrackBy(index, user) {
  1331. * return user.id;
  1332. * }
  1333. * ```
  1334. *
  1335. * A custom `trackBy` function must have several properties:
  1336. *
  1337. * - be [idempotent](https://en.wikipedia.org/wiki/Idempotence) (be without side effects, and always
  1338. * return the same value for a given input)
  1339. * - return unique value for all unique inputs
  1340. * - be fast
  1341. *
  1342. * @see [`NgForOf#ngForTrackBy`](api/common/NgForOf#ngForTrackBy)
  1343. * @publicApi
  1344. */
  1345. interface TrackByFunction<T> {
  1346. /**
  1347. * @param index The index of the item within the iterable.
  1348. * @param item The item in the iterable.
  1349. */
  1350. <U extends T>(index: number, item: T & U): any;
  1351. }
  1352. /**
  1353. * Provides a factory for {@link IterableDiffer}.
  1354. *
  1355. * @publicApi
  1356. */
  1357. interface IterableDifferFactory {
  1358. supports(objects: any): boolean;
  1359. create<V>(trackByFn?: TrackByFunction<V>): IterableDiffer<V>;
  1360. }
  1361. /**
  1362. * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.
  1363. *
  1364. * @publicApi
  1365. */
  1366. declare class IterableDiffers {
  1367. private factories;
  1368. /** @nocollapse */
  1369. static ɵprov: unknown;
  1370. constructor(factories: IterableDifferFactory[]);
  1371. static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers;
  1372. /**
  1373. * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the
  1374. * inherited {@link IterableDiffers} instance with the provided factories and return a new
  1375. * {@link IterableDiffers} instance.
  1376. *
  1377. * @usageNotes
  1378. * ### Example
  1379. *
  1380. * The following example shows how to extend an existing list of factories,
  1381. * which will only be applied to the injector for this component and its children.
  1382. * This step is all that's required to make a new {@link IterableDiffer} available.
  1383. *
  1384. * ```ts
  1385. * @Component({
  1386. * viewProviders: [
  1387. * IterableDiffers.extend([new ImmutableListDiffer()])
  1388. * ]
  1389. * })
  1390. * ```
  1391. */
  1392. static extend(factories: IterableDifferFactory[]): StaticProvider;
  1393. find(iterable: any): IterableDifferFactory;
  1394. }
  1395. /**
  1396. * Type of the Inject decorator / constructor function.
  1397. *
  1398. * @publicApi
  1399. */
  1400. interface InjectDecorator {
  1401. /**
  1402. * Warning: String tokens are not recommended.
  1403. *
  1404. * Use an InjectionToken or a class as a token instead.
  1405. */
  1406. (token: string): any;
  1407. new (token: string): Inject;
  1408. /**
  1409. * Parameter decorator on a dependency parameter of a class constructor
  1410. * that specifies a custom provider of the dependency.
  1411. *
  1412. * @usageNotes
  1413. * The following example shows a class constructor that specifies a
  1414. * custom provider of a dependency using the parameter decorator.
  1415. *
  1416. * When `@Inject()` is not present, the injector uses the type annotation of the
  1417. * parameter as the provider.
  1418. *
  1419. * {@example core/di/ts/metadata_spec.ts region='InjectWithoutDecorator'}
  1420. *
  1421. * @see [Dependency Injection Guide](guide/di/dependency-injection
  1422. *
  1423. */
  1424. (token: any): any;
  1425. new (token: any): Inject;
  1426. }
  1427. /**
  1428. * Type of the Inject metadata.
  1429. *
  1430. * @publicApi
  1431. */
  1432. interface Inject {
  1433. /**
  1434. * A DI token that maps to the dependency to be injected.
  1435. */
  1436. token: any;
  1437. }
  1438. /**
  1439. * Inject decorator and metadata.
  1440. *
  1441. * @Annotation
  1442. * @publicApi
  1443. */
  1444. declare const Inject: InjectDecorator;
  1445. /**
  1446. * Type of the Optional decorator / constructor function.
  1447. *
  1448. * @publicApi
  1449. */
  1450. interface OptionalDecorator {
  1451. /**
  1452. * Parameter decorator to be used on constructor parameters,
  1453. * which marks the parameter as being an optional dependency.
  1454. * The DI framework provides `null` if the dependency is not found.
  1455. *
  1456. * Can be used together with other parameter decorators
  1457. * that modify how dependency injection operates.
  1458. *
  1459. * @usageNotes
  1460. *
  1461. * The following code allows the possibility of a `null` result:
  1462. *
  1463. * {@example core/di/ts/metadata_spec.ts region='Optional'}
  1464. *
  1465. * @see [Dependency Injection Guide](guide/di/dependency-injection.
  1466. */
  1467. (): any;
  1468. new (): Optional;
  1469. }
  1470. /**
  1471. * Type of the Optional metadata.
  1472. *
  1473. * @publicApi
  1474. */
  1475. interface Optional {
  1476. }
  1477. /**
  1478. * Optional decorator and metadata.
  1479. *
  1480. * @Annotation
  1481. * @publicApi
  1482. */
  1483. declare const Optional: OptionalDecorator;
  1484. /**
  1485. * Type of the Self decorator / constructor function.
  1486. *
  1487. * @publicApi
  1488. */
  1489. interface SelfDecorator {
  1490. /**
  1491. * Parameter decorator to be used on constructor parameters,
  1492. * which tells the DI framework to start dependency resolution from the local injector.
  1493. *
  1494. * Resolution works upward through the injector hierarchy, so the children
  1495. * of this class must configure their own providers or be prepared for a `null` result.
  1496. *
  1497. * @usageNotes
  1498. *
  1499. * In the following example, the dependency can be resolved
  1500. * by the local injector when instantiating the class itself, but not
  1501. * when instantiating a child.
  1502. *
  1503. * {@example core/di/ts/metadata_spec.ts region='Self'}
  1504. *
  1505. * @see {@link SkipSelf}
  1506. * @see {@link Optional}
  1507. *
  1508. */
  1509. (): any;
  1510. new (): Self;
  1511. }
  1512. /**
  1513. * Type of the Self metadata.
  1514. *
  1515. * @publicApi
  1516. */
  1517. interface Self {
  1518. }
  1519. /**
  1520. * Self decorator and metadata.
  1521. *
  1522. * @Annotation
  1523. * @publicApi
  1524. */
  1525. declare const Self: SelfDecorator;
  1526. /**
  1527. * Type of the `SkipSelf` decorator / constructor function.
  1528. *
  1529. * @publicApi
  1530. */
  1531. interface SkipSelfDecorator {
  1532. /**
  1533. * Parameter decorator to be used on constructor parameters,
  1534. * which tells the DI framework to start dependency resolution from the parent injector.
  1535. * Resolution works upward through the injector hierarchy, so the local injector
  1536. * is not checked for a provider.
  1537. *
  1538. * @usageNotes
  1539. *
  1540. * In the following example, the dependency can be resolved when
  1541. * instantiating a child, but not when instantiating the class itself.
  1542. *
  1543. * {@example core/di/ts/metadata_spec.ts region='SkipSelf'}
  1544. *
  1545. * @see [Dependency Injection guide](guide/di/di-in-action#skip).
  1546. * @see {@link Self}
  1547. * @see {@link Optional}
  1548. *
  1549. */
  1550. (): any;
  1551. new (): SkipSelf;
  1552. }
  1553. /**
  1554. * Type of the `SkipSelf` metadata.
  1555. *
  1556. * @publicApi
  1557. */
  1558. interface SkipSelf {
  1559. }
  1560. /**
  1561. * `SkipSelf` decorator and metadata.
  1562. *
  1563. * @Annotation
  1564. * @publicApi
  1565. */
  1566. declare const SkipSelf: SkipSelfDecorator;
  1567. /**
  1568. * Type of the `Host` decorator / constructor function.
  1569. *
  1570. * @publicApi
  1571. */
  1572. interface HostDecorator {
  1573. /**
  1574. * Parameter decorator on a view-provider parameter of a class constructor
  1575. * that tells the DI framework to resolve the view by checking injectors of child
  1576. * elements, and stop when reaching the host element of the current component.
  1577. *
  1578. * @usageNotes
  1579. *
  1580. * The following shows use with the `@Optional` decorator, and allows for a `null` result.
  1581. *
  1582. * {@example core/di/ts/metadata_spec.ts region='Host'}
  1583. *
  1584. * For an extended example, see ["Dependency Injection
  1585. * Guide"](guide/di/di-in-action#optional).
  1586. */
  1587. (): any;
  1588. new (): Host;
  1589. }
  1590. /**
  1591. * Type of the Host metadata.
  1592. *
  1593. * @publicApi
  1594. */
  1595. interface Host {
  1596. }
  1597. /**
  1598. * Host decorator and metadata.
  1599. *
  1600. * @Annotation
  1601. * @publicApi
  1602. */
  1603. declare const Host: HostDecorator;
  1604. /**
  1605. * Runs the given function in the [context](guide/di/dependency-injection-context) of the given
  1606. * `Injector`.
  1607. *
  1608. * Within the function's stack frame, [`inject`](api/core/inject) can be used to inject dependencies
  1609. * from the given `Injector`. Note that `inject` is only usable synchronously, and cannot be used in
  1610. * any asynchronous callbacks or after any `await` points.
  1611. *
  1612. * @param injector the injector which will satisfy calls to [`inject`](api/core/inject) while `fn`
  1613. * is executing
  1614. * @param fn the closure to be run in the context of `injector`
  1615. * @returns the return value of the function, if any
  1616. * @publicApi
  1617. */
  1618. declare function runInInjectionContext<ReturnT>(injector: Injector, fn: () => ReturnT): ReturnT;
  1619. /**
  1620. * Asserts that the current stack frame is within an [injection
  1621. * context](guide/di/dependency-injection-context) and has access to `inject`.
  1622. *
  1623. * @param debugFn a reference to the function making the assertion (used for the error message).
  1624. *
  1625. * @publicApi
  1626. */
  1627. declare function assertInInjectionContext(debugFn: Function): void;
  1628. /**
  1629. * An interface that a function passed into `forwardRef` has to implement.
  1630. *
  1631. * @usageNotes
  1632. * ### Example
  1633. *
  1634. * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref_fn'}
  1635. * @publicApi
  1636. */
  1637. interface ForwardRefFn {
  1638. (): any;
  1639. }
  1640. /**
  1641. * Allows to refer to references which are not yet defined.
  1642. *
  1643. * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of
  1644. * DI is declared, but not yet defined. It is also used when the `token` which we use when creating
  1645. * a query is not yet defined.
  1646. *
  1647. * `forwardRef` is also used to break circularities in standalone components imports.
  1648. *
  1649. * @usageNotes
  1650. * ### Circular dependency example
  1651. * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}
  1652. *
  1653. * ### Circular standalone reference import example
  1654. * ```angular-ts
  1655. * @Component({
  1656. * imports: [ChildComponent],
  1657. * selector: 'app-parent',
  1658. * template: `<app-child [hideParent]="hideParent()"></app-child>`,
  1659. * })
  1660. * export class ParentComponent {
  1661. * hideParent = input.required<boolean>();
  1662. * }
  1663. *
  1664. *
  1665. * @Component({
  1666. * imports: [forwardRef(() => ParentComponent)],
  1667. * selector: 'app-child',
  1668. * template: `
  1669. * @if(!hideParent() {
  1670. * <app-parent/>
  1671. * }
  1672. * `,
  1673. * })
  1674. * export class ChildComponent {
  1675. * hideParent = input.required<boolean>();
  1676. * }
  1677. * ```
  1678. *
  1679. * @publicApi
  1680. */
  1681. declare function forwardRef(forwardRefFn: ForwardRefFn): Type$1<any>;
  1682. /**
  1683. * Lazily retrieves the reference value from a forwardRef.
  1684. *
  1685. * Acts as the identity function when given a non-forward-ref value.
  1686. *
  1687. * @usageNotes
  1688. * ### Example
  1689. *
  1690. * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}
  1691. *
  1692. * @see {@link forwardRef}
  1693. * @publicApi
  1694. */
  1695. declare function resolveForwardRef<T>(type: T): T;
  1696. /**
  1697. * Injectable providers used in `@Injectable` decorator.
  1698. *
  1699. * @publicApi
  1700. */
  1701. type InjectableProvider = ValueSansProvider | ExistingSansProvider | StaticClassSansProvider | ConstructorSansProvider | FactorySansProvider | ClassSansProvider;
  1702. /**
  1703. * Type of the Injectable decorator / constructor function.
  1704. *
  1705. * @publicApi
  1706. */
  1707. interface InjectableDecorator {
  1708. /**
  1709. * Decorator that marks a class as available to be
  1710. * provided and injected as a dependency.
  1711. *
  1712. * @see [Introduction to Services and DI](guide/di)
  1713. * @see [Dependency Injection Guide](guide/di/dependency-injection
  1714. *
  1715. * @usageNotes
  1716. *
  1717. * Marking a class with `@Injectable` ensures that the compiler
  1718. * will generate the necessary metadata to create the class's
  1719. * dependencies when the class is injected.
  1720. *
  1721. * The following example shows how a service class is properly
  1722. * marked so that a supporting service can be injected upon creation.
  1723. *
  1724. * {@example core/di/ts/metadata_spec.ts region='Injectable'}
  1725. *
  1726. */
  1727. (): TypeDecorator;
  1728. (options?: {
  1729. providedIn: Type$1<any> | 'root' | 'platform' | 'any' | null;
  1730. } & InjectableProvider): TypeDecorator;
  1731. new (): Injectable;
  1732. new (options?: {
  1733. providedIn: Type$1<any> | 'root' | 'platform' | 'any' | null;
  1734. } & InjectableProvider): Injectable;
  1735. }
  1736. /**
  1737. * Type of the Injectable metadata.
  1738. *
  1739. * @publicApi
  1740. */
  1741. interface Injectable {
  1742. /**
  1743. * Determines which injectors will provide the injectable.
  1744. *
  1745. * - `Type<any>` - associates the injectable with an `@NgModule` or other `InjectorType`. This
  1746. * option is DEPRECATED.
  1747. * - 'null' : Equivalent to `undefined`. The injectable is not provided in any scope automatically
  1748. * and must be added to a `providers` array.
  1749. *
  1750. * The following options specify that this injectable should be provided in one of the following
  1751. * injectors:
  1752. * - 'root' : The application-level injector in most apps.
  1753. * - 'platform' : A special singleton platform injector shared by all
  1754. * applications on the page.
  1755. * - 'any' : Provides a unique instance in each lazy loaded module while all eagerly loaded
  1756. * modules share one instance. This option is DEPRECATED.
  1757. *
  1758. */
  1759. providedIn?: Type$1<any> | 'root' | 'platform' | 'any' | null;
  1760. }
  1761. /**
  1762. * Injectable decorator and metadata.
  1763. *
  1764. * @Annotation
  1765. * @publicApi
  1766. */
  1767. declare const Injectable: InjectableDecorator;
  1768. /**
  1769. * A multi-provider token for initialization functions that will run upon construction of an
  1770. * environment injector.
  1771. *
  1772. * @deprecated from v19.0.0, use provideEnvironmentInitializer instead
  1773. *
  1774. * @see {@link provideEnvironmentInitializer}
  1775. *
  1776. * Note: As opposed to the `APP_INITIALIZER` token, the `ENVIRONMENT_INITIALIZER` functions are not awaited,
  1777. * hence they should not be `async`.
  1778. *
  1779. * @publicApi
  1780. */
  1781. declare const ENVIRONMENT_INITIALIZER: InjectionToken<readonly (() => void)[]>;
  1782. /*!
  1783. * @license
  1784. * Copyright Google LLC All Rights Reserved.
  1785. *
  1786. * Use of this source code is governed by an MIT-style license that can be
  1787. * found in the LICENSE file at https://angular.dev/license
  1788. */
  1789. /**
  1790. * Creates a token that can be used to inject static attributes of the host node.
  1791. *
  1792. * @usageNotes
  1793. * ### Injecting an attribute that is known to exist
  1794. * ```ts
  1795. * @Directive()
  1796. * class MyDir {
  1797. * attr: string = inject(new HostAttributeToken('some-attr'));
  1798. * }
  1799. * ```
  1800. *
  1801. * ### Optionally injecting an attribute
  1802. * ```ts
  1803. * @Directive()
  1804. * class MyDir {
  1805. * attr: string | null = inject(new HostAttributeToken('some-attr'), {optional: true});
  1806. * }
  1807. * ```
  1808. * @publicApi
  1809. */
  1810. declare class HostAttributeToken {
  1811. private attributeName;
  1812. constructor(attributeName: string);
  1813. toString(): string;
  1814. }
  1815. /**
  1816. * Generated instruction: injects a token from the currently active injector.
  1817. *
  1818. * (Additional documentation moved to `inject`, as it is the public API, and an alias for this
  1819. * instruction)
  1820. *
  1821. * @see inject
  1822. * @codeGenApi
  1823. * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to npm.
  1824. */
  1825. declare function ɵɵinject<T>(token: ProviderToken<T>): T;
  1826. declare function ɵɵinject<T>(token: ProviderToken<T>, flags?: InternalInjectFlags): T | null;
  1827. declare function ɵɵinject(token: HostAttributeToken): string;
  1828. declare function ɵɵinject(token: HostAttributeToken, flags?: InternalInjectFlags): string | null;
  1829. declare function ɵɵinject<T>(token: ProviderToken<T> | HostAttributeToken, flags?: InternalInjectFlags): string | null;
  1830. /**
  1831. * Throws an error indicating that a factory function could not be generated by the compiler for a
  1832. * particular class.
  1833. *
  1834. * The name of the class is not mentioned here, but will be in the generated factory function name
  1835. * and thus in the stack trace.
  1836. *
  1837. * @codeGenApi
  1838. */
  1839. declare function ɵɵinvalidFactoryDep(index: number): never;
  1840. /**
  1841. * @param token A token that represents a dependency that should be injected.
  1842. * @returns the injected value if operation is successful, `null` otherwise.
  1843. * @throws if called outside of a supported context.
  1844. *
  1845. * @publicApi
  1846. */
  1847. declare function inject<T>(token: ProviderToken<T>): T;
  1848. /**
  1849. * @param token A token that represents a dependency that should be injected.
  1850. * @param options Control how injection is executed. Options correspond to injection strategies
  1851. * that can be specified with parameter decorators `@Host`, `@Self`, `@SkipSelf`, and
  1852. * `@Optional`.
  1853. * @returns the injected value if operation is successful.
  1854. * @throws if called outside of a supported context, or if the token is not found.
  1855. *
  1856. * @publicApi
  1857. */
  1858. declare function inject<T>(token: ProviderToken<T>, options: InjectOptions & {
  1859. optional?: false;
  1860. }): T;
  1861. /**
  1862. * @param token A token that represents a dependency that should be injected.
  1863. * @param options Control how injection is executed. Options correspond to injection strategies
  1864. * that can be specified with parameter decorators `@Host`, `@Self`, `@SkipSelf`, and
  1865. * `@Optional`.
  1866. * @returns the injected value if operation is successful, `null` if the token is not
  1867. * found and optional injection has been requested.
  1868. * @throws if called outside of a supported context, or if the token is not found and optional
  1869. * injection was not requested.
  1870. *
  1871. * @publicApi
  1872. */
  1873. declare function inject<T>(token: ProviderToken<T>, options: InjectOptions): T | null;
  1874. /**
  1875. * @param token A token that represents a static attribute on the host node that should be injected.
  1876. * @returns Value of the attribute if it exists.
  1877. * @throws If called outside of a supported context or the attribute does not exist.
  1878. *
  1879. * @publicApi
  1880. */
  1881. declare function inject(token: HostAttributeToken): string;
  1882. /**
  1883. * @param token A token that represents a static attribute on the host node that should be injected.
  1884. * @returns Value of the attribute if it exists, otherwise `null`.
  1885. * @throws If called outside of a supported context.
  1886. *
  1887. * @publicApi
  1888. */
  1889. declare function inject(token: HostAttributeToken, options: {
  1890. optional: true;
  1891. }): string | null;
  1892. /**
  1893. * @param token A token that represents a static attribute on the host node that should be injected.
  1894. * @returns Value of the attribute if it exists.
  1895. * @throws If called outside of a supported context or the attribute does not exist.
  1896. *
  1897. * @publicApi
  1898. */
  1899. declare function inject(token: HostAttributeToken, options: {
  1900. optional: false;
  1901. }): string;
  1902. declare function convertToBitFlags(flags: InjectOptions | InternalInjectFlags | undefined): InternalInjectFlags | undefined;
  1903. /**
  1904. * An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors.
  1905. *
  1906. * Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a
  1907. * project.
  1908. *
  1909. * @publicApi
  1910. */
  1911. declare const INJECTOR: InjectionToken<Injector>;
  1912. /**
  1913. * A token that can be used to inject the tag name of the host node.
  1914. *
  1915. * @usageNotes
  1916. * ### Injecting a tag name that is known to exist
  1917. * ```ts
  1918. * @Directive()
  1919. * class MyDir {
  1920. * tagName: string = inject(HOST_TAG_NAME);
  1921. * }
  1922. * ```
  1923. *
  1924. * ### Optionally injecting a tag name
  1925. * ```ts
  1926. * @Directive()
  1927. * class MyDir {
  1928. * tagName: string | null = inject(HOST_TAG_NAME, {optional: true});
  1929. * }
  1930. * ```
  1931. * @publicApi
  1932. */
  1933. declare const HOST_TAG_NAME: InjectionToken<string>;
  1934. /**
  1935. * A differ that tracks changes made to an object over time.
  1936. *
  1937. * @publicApi
  1938. */
  1939. interface KeyValueDiffer<K, V> {
  1940. /**
  1941. * Compute a difference between the previous state and the new `object` state.
  1942. *
  1943. * @param object containing the new value.
  1944. * @returns an object describing the difference. The return value is only valid until the next
  1945. * `diff()` invocation.
  1946. */
  1947. diff(object: Map<K, V>): KeyValueChanges<K, V> | null;
  1948. /**
  1949. * Compute a difference between the previous state and the new `object` state.
  1950. *
  1951. * @param object containing the new value.
  1952. * @returns an object describing the difference. The return value is only valid until the next
  1953. * `diff()` invocation.
  1954. */
  1955. diff(object: {
  1956. [key: string]: V;
  1957. }): KeyValueChanges<string, V> | null;
  1958. }
  1959. /**
  1960. * An object describing the changes in the `Map` or `{[k:string]: string}` since last time
  1961. * `KeyValueDiffer#diff()` was invoked.
  1962. *
  1963. * @publicApi
  1964. */
  1965. interface KeyValueChanges<K, V> {
  1966. /**
  1967. * Iterate over all changes. `KeyValueChangeRecord` will contain information about changes
  1968. * to each item.
  1969. */
  1970. forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  1971. /**
  1972. * Iterate over changes in the order of original Map showing where the original items
  1973. * have moved.
  1974. */
  1975. forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  1976. /**
  1977. * Iterate over all keys for which values have changed.
  1978. */
  1979. forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  1980. /**
  1981. * Iterate over all added items.
  1982. */
  1983. forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  1984. /**
  1985. * Iterate over all removed items.
  1986. */
  1987. forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;
  1988. }
  1989. /**
  1990. * Record representing the item change information.
  1991. *
  1992. * @publicApi
  1993. */
  1994. interface KeyValueChangeRecord<K, V> {
  1995. /**
  1996. * Current key in the Map.
  1997. */
  1998. readonly key: K;
  1999. /**
  2000. * Current value for the key or `null` if removed.
  2001. */
  2002. readonly currentValue: V | null;
  2003. /**
  2004. * Previous value for the key or `null` if added.
  2005. */
  2006. readonly previousValue: V | null;
  2007. }
  2008. /**
  2009. * Provides a factory for {@link KeyValueDiffer}.
  2010. *
  2011. * @publicApi
  2012. */
  2013. interface KeyValueDifferFactory {
  2014. /**
  2015. * Test to see if the differ knows how to diff this kind of object.
  2016. */
  2017. supports(objects: any): boolean;
  2018. /**
  2019. * Create a `KeyValueDiffer`.
  2020. */
  2021. create<K, V>(): KeyValueDiffer<K, V>;
  2022. }
  2023. /**
  2024. * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.
  2025. *
  2026. * @publicApi
  2027. */
  2028. declare class KeyValueDiffers {
  2029. /** @nocollapse */
  2030. static ɵprov: unknown;
  2031. private readonly factories;
  2032. constructor(factories: KeyValueDifferFactory[]);
  2033. static create<S>(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers;
  2034. /**
  2035. * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the
  2036. * inherited {@link KeyValueDiffers} instance with the provided factories and return a new
  2037. * {@link KeyValueDiffers} instance.
  2038. *
  2039. * @usageNotes
  2040. * ### Example
  2041. *
  2042. * The following example shows how to extend an existing list of factories,
  2043. * which will only be applied to the injector for this component and its children.
  2044. * This step is all that's required to make a new {@link KeyValueDiffer} available.
  2045. *
  2046. * ```ts
  2047. * @Component({
  2048. * viewProviders: [
  2049. * KeyValueDiffers.extend([new ImmutableMapDiffer()])
  2050. * ]
  2051. * })
  2052. * ```
  2053. */
  2054. static extend<S>(factories: KeyValueDifferFactory[]): StaticProvider;
  2055. find(kv: any): KeyValueDifferFactory;
  2056. }
  2057. declare function devModeEqual(a: any, b: any): boolean;
  2058. /**
  2059. * @deprecated v4.0.0 - Should not be part of public API.
  2060. * @publicApi
  2061. */
  2062. declare class DefaultIterableDiffer<V> implements IterableDiffer<V>, IterableChanges<V> {
  2063. readonly length: number;
  2064. readonly collection: V[] | Iterable<V> | null;
  2065. private _linkedRecords;
  2066. private _unlinkedRecords;
  2067. private _previousItHead;
  2068. private _itHead;
  2069. private _itTail;
  2070. private _additionsHead;
  2071. private _additionsTail;
  2072. private _movesHead;
  2073. private _movesTail;
  2074. private _removalsHead;
  2075. private _removalsTail;
  2076. private _identityChangesHead;
  2077. private _identityChangesTail;
  2078. private _trackByFn;
  2079. constructor(trackByFn?: TrackByFunction<V>);
  2080. forEachItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  2081. forEachOperation(fn: (item: IterableChangeRecord<V>, previousIndex: number | null, currentIndex: number | null) => void): void;
  2082. forEachPreviousItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  2083. forEachAddedItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  2084. forEachMovedItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  2085. forEachRemovedItem(fn: (record: IterableChangeRecord_<V>) => void): void;
  2086. forEachIdentityChange(fn: (record: IterableChangeRecord_<V>) => void): void;
  2087. diff(collection: NgIterable<V> | null | undefined): DefaultIterableDiffer<V> | null;
  2088. onDestroy(): void;
  2089. check(collection: NgIterable<V>): boolean;
  2090. get isDirty(): boolean;
  2091. private _addToRemovals;
  2092. }
  2093. declare class IterableChangeRecord_<V> implements IterableChangeRecord<V> {
  2094. item: V;
  2095. trackById: any;
  2096. currentIndex: number | null;
  2097. previousIndex: number | null;
  2098. constructor(item: V, trackById: any);
  2099. }
  2100. /**
  2101. * An interface that is implemented by pipes in order to perform a transformation.
  2102. * Angular invokes the `transform` method with the value of a binding
  2103. * as the first argument, and any parameters as the second argument in list form.
  2104. *
  2105. * @usageNotes
  2106. *
  2107. * In the following example, `TruncatePipe` returns the shortened value with an added ellipses.
  2108. *
  2109. * <code-example path="core/ts/pipes/simple_truncate.ts" header="simple_truncate.ts"></code-example>
  2110. *
  2111. * Invoking `{{ 'It was the best of times' | truncate }}` in a template will produce `It was...`.
  2112. *
  2113. * In the following example, `TruncatePipe` takes parameters that sets the truncated length and the
  2114. * string to append with.
  2115. *
  2116. * <code-example path="core/ts/pipes/truncate.ts" header="truncate.ts"></code-example>
  2117. *
  2118. * Invoking `{{ 'It was the best of times' | truncate:4:'....' }}` in a template will produce `It
  2119. * was the best....`.
  2120. *
  2121. * @publicApi
  2122. */
  2123. interface PipeTransform {
  2124. transform(value: any, ...args: any[]): any;
  2125. }
  2126. declare const defaultIterableDiffers: IterableDiffers;
  2127. declare const defaultKeyValueDiffers: KeyValueDiffers;
  2128. /**
  2129. * Options passed to the `computed` creation function.
  2130. */
  2131. interface CreateComputedOptions<T> {
  2132. /**
  2133. * A comparison function which defines equality for computed values.
  2134. */
  2135. equal?: ValueEqualityFn<T>;
  2136. /**
  2137. * A debug name for the computed signal. Used in Angular DevTools to identify the signal.
  2138. */
  2139. debugName?: string;
  2140. }
  2141. /**
  2142. * Create a computed `Signal` which derives a reactive value from an expression.
  2143. */
  2144. declare function computed<T>(computation: () => T, options?: CreateComputedOptions<T>): Signal<T>;
  2145. /**
  2146. * Creates a writable signal whose value is initialized and reset by the linked, reactive computation.
  2147. *
  2148. * @publicApi 20.0
  2149. */
  2150. declare function linkedSignal<D>(computation: () => D, options?: {
  2151. equal?: ValueEqualityFn<NoInfer<D>>;
  2152. }): WritableSignal<D>;
  2153. /**
  2154. * Creates a writable signal whose value is initialized and reset by the linked, reactive computation.
  2155. * This is an advanced API form where the computation has access to the previous value of the signal and the computation result.
  2156. *
  2157. * Note: The computation is reactive, meaning the linked signal will automatically update whenever any of the signals used within the computation change.
  2158. *
  2159. * @publicApi 20.0
  2160. */
  2161. declare function linkedSignal<S, D>(options: {
  2162. source: () => S;
  2163. computation: (source: NoInfer<S>, previous?: {
  2164. source: NoInfer<S>;
  2165. value: NoInfer<D>;
  2166. }) => D;
  2167. equal?: ValueEqualityFn<NoInfer<D>>;
  2168. }): WritableSignal<D>;
  2169. /**
  2170. * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function
  2171. * can, optionally, return a value.
  2172. */
  2173. declare function untracked<T>(nonReactiveReadsFn: () => T): T;
  2174. /**
  2175. * An argument list containing the first non-never type in the given type array, or an empty
  2176. * argument list if there are no non-never types in the type array.
  2177. */
  2178. type ɵFirstAvailable<T extends unknown[]> = T extends [infer H, ...infer R] ? [H] extends [never] ? ɵFirstAvailable<R> : [H] : [];
  2179. /**
  2180. * Options passed to `afterEveryRender` and `afterNextRender`.
  2181. *
  2182. * @publicApi 20.0
  2183. */
  2184. interface AfterRenderOptions {
  2185. /**
  2186. * The `Injector` to use during creation.
  2187. *
  2188. * If this is not provided, the current injection context will be used instead (via `inject`).
  2189. */
  2190. injector?: Injector;
  2191. /**
  2192. * Whether the hook should require manual cleanup.
  2193. *
  2194. * If this is `false` (the default) the hook will automatically register itself to be cleaned up
  2195. * with the current `DestroyRef`.
  2196. */
  2197. manualCleanup?: boolean;
  2198. }
  2199. /**
  2200. * Register callbacks to be invoked each time the application finishes rendering, during the
  2201. * specified phases. The available phases are:
  2202. * - `earlyRead`
  2203. * Use this phase to **read** from the DOM before a subsequent `write` callback, for example to
  2204. * perform custom layout that the browser doesn't natively support. Prefer the `read` phase if
  2205. * reading can wait until after the write phase. **Never** write to the DOM in this phase.
  2206. * - `write`
  2207. * Use this phase to **write** to the DOM. **Never** read from the DOM in this phase.
  2208. * - `mixedReadWrite`
  2209. * Use this phase to read from and write to the DOM simultaneously. **Never** use this phase if
  2210. * it is possible to divide the work among the other phases instead.
  2211. * - `read`
  2212. * Use this phase to **read** from the DOM. **Never** write to the DOM in this phase.
  2213. *
  2214. * <div class="docs-alert docs-alert-critical">
  2215. *
  2216. * You should prefer using the `read` and `write` phases over the `earlyRead` and `mixedReadWrite`
  2217. * phases when possible, to avoid performance degradation.
  2218. *
  2219. * </div>
  2220. *
  2221. * Note that:
  2222. * - Callbacks run in the following phase order *after each render*:
  2223. * 1. `earlyRead`
  2224. * 2. `write`
  2225. * 3. `mixedReadWrite`
  2226. * 4. `read`
  2227. * - Callbacks in the same phase run in the order they are registered.
  2228. * - Callbacks run on browser platforms only, they will not run on the server.
  2229. *
  2230. * The first phase callback to run as part of this spec will receive no parameters. Each
  2231. * subsequent phase callback in this spec will receive the return value of the previously run
  2232. * phase callback as a parameter. This can be used to coordinate work across multiple phases.
  2233. *
  2234. * Angular is unable to verify or enforce that phases are used correctly, and instead
  2235. * relies on each developer to follow the guidelines documented for each value and
  2236. * carefully choose the appropriate one, refactoring their code if necessary. By doing
  2237. * so, Angular is better able to minimize the performance degradation associated with
  2238. * manual DOM access, ensuring the best experience for the end users of your application
  2239. * or library.
  2240. *
  2241. * <div class="docs-alert docs-alert-important">
  2242. *
  2243. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  2244. * You must use caution when directly reading or writing the DOM and layout.
  2245. *
  2246. * </div>
  2247. *
  2248. * @param spec The callback functions to register
  2249. * @param options Options to control the behavior of the callback
  2250. *
  2251. * @usageNotes
  2252. *
  2253. * Use `afterEveryRender` to read or write the DOM after each render.
  2254. *
  2255. * ### Example
  2256. * ```angular-ts
  2257. * @Component({
  2258. * selector: 'my-cmp',
  2259. * template: `<span #content>{{ ... }}</span>`,
  2260. * })
  2261. * export class MyComponent {
  2262. * @ViewChild('content') contentRef: ElementRef;
  2263. *
  2264. * constructor() {
  2265. * afterEveryRender({
  2266. * read: () => {
  2267. * console.log('content height: ' + this.contentRef.nativeElement.scrollHeight);
  2268. * }
  2269. * });
  2270. * }
  2271. * }
  2272. * ```
  2273. *
  2274. * @publicApi 20.0
  2275. */
  2276. declare function afterEveryRender<E = never, W = never, M = never>(spec: {
  2277. earlyRead?: () => E;
  2278. write?: (...args: ɵFirstAvailable<[E]>) => W;
  2279. mixedReadWrite?: (...args: ɵFirstAvailable<[W, E]>) => M;
  2280. read?: (...args: ɵFirstAvailable<[M, W, E]>) => void;
  2281. }, options?: AfterRenderOptions): AfterRenderRef;
  2282. /**
  2283. * Register a callback to be invoked each time the application finishes rendering, during the
  2284. * `mixedReadWrite` phase.
  2285. *
  2286. * <div class="docs-alert docs-alert-critical">
  2287. *
  2288. * You should prefer specifying an explicit phase for the callback instead, or you risk significant
  2289. * performance degradation.
  2290. *
  2291. * </div>
  2292. *
  2293. * Note that the callback will run
  2294. * - in the order it was registered
  2295. * - once per render
  2296. * - on browser platforms only
  2297. * - during the `mixedReadWrite` phase
  2298. *
  2299. * <div class="docs-alert docs-alert-important">
  2300. *
  2301. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  2302. * You must use caution when directly reading or writing the DOM and layout.
  2303. *
  2304. * </div>
  2305. *
  2306. * @param callback A callback function to register
  2307. * @param options Options to control the behavior of the callback
  2308. *
  2309. * @usageNotes
  2310. *
  2311. * Use `afterEveryRender` to read or write the DOM after each render.
  2312. *
  2313. * ### Example
  2314. * ```angular-ts
  2315. * @Component({
  2316. * selector: 'my-cmp',
  2317. * template: `<span #content>{{ ... }}</span>`,
  2318. * })
  2319. * export class MyComponent {
  2320. * @ViewChild('content') contentRef: ElementRef;
  2321. *
  2322. * constructor() {
  2323. * afterEveryRender({
  2324. * read: () => {
  2325. * console.log('content height: ' + this.contentRef.nativeElement.scrollHeight);
  2326. * }
  2327. * });
  2328. * }
  2329. * }
  2330. * ```
  2331. *
  2332. * @publicApi 20.0
  2333. */
  2334. declare function afterEveryRender(callback: VoidFunction, options?: AfterRenderOptions): AfterRenderRef;
  2335. /**
  2336. * Register callbacks to be invoked the next time the application finishes rendering, during the
  2337. * specified phases. The available phases are:
  2338. * - `earlyRead`
  2339. * Use this phase to **read** from the DOM before a subsequent `write` callback, for example to
  2340. * perform custom layout that the browser doesn't natively support. Prefer the `read` phase if
  2341. * reading can wait until after the write phase. **Never** write to the DOM in this phase.
  2342. * - `write`
  2343. * Use this phase to **write** to the DOM. **Never** read from the DOM in this phase.
  2344. * - `mixedReadWrite`
  2345. * Use this phase to read from and write to the DOM simultaneously. **Never** use this phase if
  2346. * it is possible to divide the work among the other phases instead.
  2347. * - `read`
  2348. * Use this phase to **read** from the DOM. **Never** write to the DOM in this phase.
  2349. *
  2350. * <div class="docs-alert docs-alert-critical">
  2351. *
  2352. * You should prefer using the `read` and `write` phases over the `earlyRead` and `mixedReadWrite`
  2353. * phases when possible, to avoid performance degradation.
  2354. *
  2355. * </div>
  2356. *
  2357. * Note that:
  2358. * - Callbacks run in the following phase order *once, after the next render*:
  2359. * 1. `earlyRead`
  2360. * 2. `write`
  2361. * 3. `mixedReadWrite`
  2362. * 4. `read`
  2363. * - Callbacks in the same phase run in the order they are registered.
  2364. * - Callbacks run on browser platforms only, they will not run on the server.
  2365. *
  2366. * The first phase callback to run as part of this spec will receive no parameters. Each
  2367. * subsequent phase callback in this spec will receive the return value of the previously run
  2368. * phase callback as a parameter. This can be used to coordinate work across multiple phases.
  2369. *
  2370. * Angular is unable to verify or enforce that phases are used correctly, and instead
  2371. * relies on each developer to follow the guidelines documented for each value and
  2372. * carefully choose the appropriate one, refactoring their code if necessary. By doing
  2373. * so, Angular is better able to minimize the performance degradation associated with
  2374. * manual DOM access, ensuring the best experience for the end users of your application
  2375. * or library.
  2376. *
  2377. * <div class="docs-alert docs-alert-important">
  2378. *
  2379. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  2380. * You must use caution when directly reading or writing the DOM and layout.
  2381. *
  2382. * </div>
  2383. *
  2384. * @param spec The callback functions to register
  2385. * @param options Options to control the behavior of the callback
  2386. *
  2387. * @usageNotes
  2388. *
  2389. * Use `afterNextRender` to read or write the DOM once,
  2390. * for example to initialize a non-Angular library.
  2391. *
  2392. * ### Example
  2393. * ```angular-ts
  2394. * @Component({
  2395. * selector: 'my-chart-cmp',
  2396. * template: `<div #chart>{{ ... }}</div>`,
  2397. * })
  2398. * export class MyChartCmp {
  2399. * @ViewChild('chart') chartRef: ElementRef;
  2400. * chart: MyChart|null;
  2401. *
  2402. * constructor() {
  2403. * afterNextRender({
  2404. * write: () => {
  2405. * this.chart = new MyChart(this.chartRef.nativeElement);
  2406. * }
  2407. * });
  2408. * }
  2409. * }
  2410. * ```
  2411. *
  2412. * @publicApi 20.0
  2413. */
  2414. declare function afterNextRender<E = never, W = never, M = never>(spec: {
  2415. earlyRead?: () => E;
  2416. write?: (...args: ɵFirstAvailable<[E]>) => W;
  2417. mixedReadWrite?: (...args: ɵFirstAvailable<[W, E]>) => M;
  2418. read?: (...args: ɵFirstAvailable<[M, W, E]>) => void;
  2419. }, options?: AfterRenderOptions): AfterRenderRef;
  2420. /**
  2421. * Register a callback to be invoked the next time the application finishes rendering, during the
  2422. * `mixedReadWrite` phase.
  2423. *
  2424. * <div class="docs-alert docs-alert-critical">
  2425. *
  2426. * You should prefer specifying an explicit phase for the callback instead, or you risk significant
  2427. * performance degradation.
  2428. *
  2429. * </div>
  2430. *
  2431. * Note that the callback will run
  2432. * - in the order it was registered
  2433. * - on browser platforms only
  2434. * - during the `mixedReadWrite` phase
  2435. *
  2436. * <div class="docs-alert docs-alert-important">
  2437. *
  2438. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  2439. * You must use caution when directly reading or writing the DOM and layout.
  2440. *
  2441. * </div>
  2442. *
  2443. * @param callback A callback function to register
  2444. * @param options Options to control the behavior of the callback
  2445. *
  2446. * @usageNotes
  2447. *
  2448. * Use `afterNextRender` to read or write the DOM once,
  2449. * for example to initialize a non-Angular library.
  2450. *
  2451. * ### Example
  2452. * ```angular-ts
  2453. * @Component({
  2454. * selector: 'my-chart-cmp',
  2455. * template: `<div #chart>{{ ... }}</div>`,
  2456. * })
  2457. * export class MyChartCmp {
  2458. * @ViewChild('chart') chartRef: ElementRef;
  2459. * chart: MyChart|null;
  2460. *
  2461. * constructor() {
  2462. * afterNextRender({
  2463. * write: () => {
  2464. * this.chart = new MyChart(this.chartRef.nativeElement);
  2465. * }
  2466. * });
  2467. * }
  2468. * }
  2469. * ```
  2470. *
  2471. * @publicApi 20.0
  2472. */
  2473. declare function afterNextRender(callback: VoidFunction, options?: AfterRenderOptions): AfterRenderRef;
  2474. /**
  2475. * An argument list containing the first non-never type in the given type array, or an empty
  2476. * argument list if there are no non-never types in the type array.
  2477. */
  2478. type ɵFirstAvailableSignal<T extends unknown[]> = T extends [infer H, ...infer R] ? [H] extends [never] ? ɵFirstAvailableSignal<R> : [Signal<H>] : [];
  2479. /**
  2480. * Register an effect that, when triggered, is invoked when the application finishes rendering, during the
  2481. * `mixedReadWrite` phase.
  2482. *
  2483. * <div class="docs-alert docs-alert-critical">
  2484. *
  2485. * You should prefer specifying an explicit phase for the effect instead, or you risk significant
  2486. * performance degradation.
  2487. *
  2488. * </div>
  2489. *
  2490. * Note that callback-based `afterRenderEffect`s will run
  2491. * - in the order it they are registered
  2492. * - only when dirty
  2493. * - on browser platforms only
  2494. * - during the `mixedReadWrite` phase
  2495. *
  2496. * <div class="docs-alert docs-alert-important">
  2497. *
  2498. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  2499. * You must use caution when directly reading or writing the DOM and layout.
  2500. *
  2501. * </div>
  2502. *
  2503. * @param callback An effect callback function to register
  2504. * @param options Options to control the behavior of the callback
  2505. *
  2506. * @publicApi
  2507. */
  2508. declare function afterRenderEffect(callback: (onCleanup: EffectCleanupRegisterFn) => void, options?: AfterRenderOptions): AfterRenderRef;
  2509. /**
  2510. * Register effects that, when triggered, are invoked when the application finishes rendering,
  2511. * during the specified phases. The available phases are:
  2512. * - `earlyRead`
  2513. * Use this phase to **read** from the DOM before a subsequent `write` callback, for example to
  2514. * perform custom layout that the browser doesn't natively support. Prefer the `read` phase if
  2515. * reading can wait until after the write phase. **Never** write to the DOM in this phase.
  2516. * - `write`
  2517. * Use this phase to **write** to the DOM. **Never** read from the DOM in this phase.
  2518. * - `mixedReadWrite`
  2519. * Use this phase to read from and write to the DOM simultaneously. **Never** use this phase if
  2520. * it is possible to divide the work among the other phases instead.
  2521. * - `read`
  2522. * Use this phase to **read** from the DOM. **Never** write to the DOM in this phase.
  2523. *
  2524. * <div class="docs-alert docs-alert-critical">
  2525. *
  2526. * You should prefer using the `read` and `write` phases over the `earlyRead` and `mixedReadWrite`
  2527. * phases when possible, to avoid performance degradation.
  2528. *
  2529. * </div>
  2530. *
  2531. * Note that:
  2532. * - Effects run in the following phase order, only when dirty through signal dependencies:
  2533. * 1. `earlyRead`
  2534. * 2. `write`
  2535. * 3. `mixedReadWrite`
  2536. * 4. `read`
  2537. * - `afterRenderEffect`s in the same phase run in the order they are registered.
  2538. * - `afterRenderEffect`s run on browser platforms only, they will not run on the server.
  2539. * - `afterRenderEffect`s will run at least once.
  2540. *
  2541. * The first phase callback to run as part of this spec will receive no parameters. Each
  2542. * subsequent phase callback in this spec will receive the return value of the previously run
  2543. * phase callback as a `Signal`. This can be used to coordinate work across multiple phases.
  2544. *
  2545. * Angular is unable to verify or enforce that phases are used correctly, and instead
  2546. * relies on each developer to follow the guidelines documented for each value and
  2547. * carefully choose the appropriate one, refactoring their code if necessary. By doing
  2548. * so, Angular is better able to minimize the performance degradation associated with
  2549. * manual DOM access, ensuring the best experience for the end users of your application
  2550. * or library.
  2551. *
  2552. * <div class="docs-alert docs-alert-important">
  2553. *
  2554. * Components are not guaranteed to be [hydrated](guide/hydration) before the callback runs.
  2555. * You must use caution when directly reading or writing the DOM and layout.
  2556. *
  2557. * </div>
  2558. *
  2559. * @param spec The effect functions to register
  2560. * @param options Options to control the behavior of the effects
  2561. *
  2562. * @usageNotes
  2563. *
  2564. * Use `afterRenderEffect` to create effects that will read or write from the DOM and thus should
  2565. * run after rendering.
  2566. *
  2567. * @publicApi
  2568. */
  2569. declare function afterRenderEffect<E = never, W = never, M = never>(spec: {
  2570. earlyRead?: (onCleanup: EffectCleanupRegisterFn) => E;
  2571. write?: (...args: [...ɵFirstAvailableSignal<[E]>, EffectCleanupRegisterFn]) => W;
  2572. mixedReadWrite?: (...args: [...ɵFirstAvailableSignal<[W, E]>, EffectCleanupRegisterFn]) => M;
  2573. read?: (...args: [...ɵFirstAvailableSignal<[M, W, E]>, EffectCleanupRegisterFn]) => void;
  2574. }, options?: AfterRenderOptions): AfterRenderRef;
  2575. /**
  2576. * Asserts that the current stack frame is not within a reactive context. Useful
  2577. * to disallow certain code from running inside a reactive context (see {@link /api/core/rxjs-interop/toSignal toSignal})
  2578. *
  2579. * @param debugFn a reference to the function making the assertion (used for the error message).
  2580. *
  2581. * @publicApi
  2582. */
  2583. declare function assertNotInReactiveContext(debugFn: Function, extraContext?: string): void;
  2584. interface NgModuleType<T = any> extends Type$1<T> {
  2585. ɵmod: NgModuleDef<T>;
  2586. }
  2587. /**
  2588. * Represents the expansion of an `NgModule` into its scopes.
  2589. *
  2590. * A scope is a set of directives and pipes that are visible in a particular context. Each
  2591. * `NgModule` has two scopes. The `compilation` scope is the set of directives and pipes that will
  2592. * be recognized in the templates of components declared by the module. The `exported` scope is the
  2593. * set of directives and pipes exported by a module (that is, module B's exported scope gets added
  2594. * to module A's compilation scope when module A imports B).
  2595. */
  2596. interface NgModuleTransitiveScopes {
  2597. compilation: {
  2598. directives: Set<any>;
  2599. pipes: Set<any>;
  2600. };
  2601. exported: {
  2602. directives: Set<any>;
  2603. pipes: Set<any>;
  2604. };
  2605. schemas: SchemaMetadata[] | null;
  2606. }
  2607. /**
  2608. * Runtime link information for NgModules.
  2609. *
  2610. * This is the internal data structure used by the runtime to assemble components, directives,
  2611. * pipes, and injectors.
  2612. *
  2613. * NOTE: Always use `ɵɵdefineNgModule` function to create this object,
  2614. * never create the object directly since the shape of this object
  2615. * can change between versions.
  2616. */
  2617. interface NgModuleDef<T> {
  2618. /** Token representing the module. Used by DI. */
  2619. type: T;
  2620. /**
  2621. * List of components to bootstrap.
  2622. *
  2623. * @see {NgModuleScopeInfoFromDecorator} This field is only used in global compilation mode. In local compilation mode the bootstrap info is computed and added in runtime.
  2624. */
  2625. bootstrap: Type$1<any>[] | (() => Type$1<any>[]);
  2626. /** List of components, directives, and pipes declared by this module. */
  2627. declarations: Type$1<any>[] | (() => Type$1<any>[]);
  2628. /** List of modules or `ModuleWithProviders` imported by this module. */
  2629. imports: Type$1<any>[] | (() => Type$1<any>[]);
  2630. /**
  2631. * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this
  2632. * module.
  2633. */
  2634. exports: Type$1<any>[] | (() => Type$1<any>[]);
  2635. /**
  2636. * Cached value of computed `transitiveCompileScopes` for this module.
  2637. *
  2638. * This should never be read directly, but accessed via `transitiveScopesFor`.
  2639. */
  2640. transitiveCompileScopes: NgModuleTransitiveScopes | null;
  2641. /** The set of schemas that declare elements to be allowed in the NgModule. */
  2642. schemas: SchemaMetadata[] | null;
  2643. /** Unique ID for the module with which it should be registered. */
  2644. id: string | null;
  2645. }
  2646. /**
  2647. * Map of inputs for a given directive/component.
  2648. *
  2649. * Given:
  2650. * ```ts
  2651. * class MyComponent {
  2652. * @Input()
  2653. * publicInput1: string;
  2654. *
  2655. * @Input('publicInput2')
  2656. * declaredInput2: string;
  2657. *
  2658. * @Input({transform: (value: boolean) => value ? 1 : 0})
  2659. * transformedInput3: number;
  2660. *
  2661. * signalInput = input(3);
  2662. * }
  2663. * ```
  2664. *
  2665. * is described as:
  2666. * ```ts
  2667. * {
  2668. * publicInput1: 'publicInput1',
  2669. * declaredInput2: [InputFlags.None, 'declaredInput2', 'publicInput2'],
  2670. * transformedInput3: [
  2671. * InputFlags.None,
  2672. * 'transformedInput3',
  2673. * 'transformedInput3',
  2674. * (value: boolean) => value ? 1 : 0
  2675. * ],
  2676. * signalInput: [InputFlags.SignalBased, "signalInput"],
  2677. * }
  2678. * ```
  2679. *
  2680. * Which the minifier may translate to:
  2681. * ```ts
  2682. * {
  2683. * minifiedPublicInput1: 'publicInput1',
  2684. * minifiedDeclaredInput2: [InputFlags.None, 'publicInput2', 'declaredInput2'],
  2685. * minifiedTransformedInput3: [
  2686. * InputFlags.None,
  2687. * 'transformedInput3',
  2688. * 'transformedInput3',
  2689. * (value: boolean) => value ? 1 : 0
  2690. * ],
  2691. * minifiedSignalInput: [InputFlags.SignalBased, "signalInput"],
  2692. * }
  2693. * ```
  2694. *
  2695. * This allows the render to re-construct the minified, public, and declared names
  2696. * of properties.
  2697. *
  2698. * NOTE:
  2699. * - Because declared and public name are usually same we only generate the array
  2700. * `['declared', 'public']` format when they differ, or there is a transform.
  2701. * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has
  2702. * inconsistent behavior in that it uses declared names rather than minified or public.
  2703. */
  2704. type DirectiveInputs<T> = {
  2705. [P in keyof T]?: string | [
  2706. flags: InputFlags,
  2707. publicName: string,
  2708. declaredName?: string,
  2709. transform?: InputTransformFunction
  2710. ];
  2711. };
  2712. interface DirectiveDefinition<T> {
  2713. /**
  2714. * Directive type, needed to configure the injector.
  2715. */
  2716. type: Type$1<T>;
  2717. /** The selectors that will be used to match nodes to this directive. */
  2718. selectors?: CssSelectorList;
  2719. /**
  2720. * A map of input names.
  2721. */
  2722. inputs?: DirectiveInputs<T>;
  2723. /**
  2724. * A map of output names.
  2725. *
  2726. * The format is in: `{[actualPropertyName: string]:string}`.
  2727. *
  2728. * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.
  2729. *
  2730. * This allows the render to re-construct the minified and non-minified names
  2731. * of properties.
  2732. */
  2733. outputs?: {
  2734. [P in keyof T]?: string;
  2735. };
  2736. /**
  2737. * A list of optional features to apply.
  2738. *
  2739. * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}, {@link InheritDefinitionFeature}
  2740. */
  2741. features?: DirectiveDefFeature[];
  2742. /**
  2743. * Function executed by the parent template to allow child directive to apply host bindings.
  2744. */
  2745. hostBindings?: HostBindingsFunction<T>;
  2746. /**
  2747. * The number of bindings in this directive `hostBindings` (including pure fn bindings).
  2748. *
  2749. * Used to calculate the length of the component's LView array, so we
  2750. * can pre-fill the array and set the host binding start index.
  2751. */
  2752. hostVars?: number;
  2753. /**
  2754. * Assign static attribute values to a host element.
  2755. *
  2756. * This property will assign static attribute values as well as class and style
  2757. * values to a host element. Since attribute values can consist of different types of values,
  2758. * the `hostAttrs` array must include the values in the following format:
  2759. *
  2760. * attrs = [
  2761. * // static attributes (like `title`, `name`, `id`...)
  2762. * attr1, value1, attr2, value,
  2763. *
  2764. * // a single namespace value (like `x:id`)
  2765. * NAMESPACE_MARKER, namespaceUri1, name1, value1,
  2766. *
  2767. * // another single namespace value (like `x:name`)
  2768. * NAMESPACE_MARKER, namespaceUri2, name2, value2,
  2769. *
  2770. * // a series of CSS classes that will be applied to the element (no spaces)
  2771. * CLASSES_MARKER, class1, class2, class3,
  2772. *
  2773. * // a series of CSS styles (property + value) that will be applied to the element
  2774. * STYLES_MARKER, prop1, value1, prop2, value2
  2775. * ]
  2776. *
  2777. * All non-class and non-style attributes must be defined at the start of the list
  2778. * first before all class and style values are set. When there is a change in value
  2779. * type (like when classes and styles are introduced) a marker must be used to separate
  2780. * the entries. The marker values themselves are set via entries found in the
  2781. * [AttributeMarker] enum.
  2782. */
  2783. hostAttrs?: TAttributes;
  2784. /**
  2785. * Function to create instances of content queries associated with a given directive.
  2786. */
  2787. contentQueries?: ContentQueriesFunction<T>;
  2788. /**
  2789. * Additional set of instructions specific to view query processing. This could be seen as a
  2790. * set of instructions to be inserted into the template function.
  2791. */
  2792. viewQuery?: ViewQueriesFunction<T> | null;
  2793. /**
  2794. * Defines the name that can be used in the template to assign this directive to a variable.
  2795. *
  2796. * See: {@link Directive.exportAs}
  2797. */
  2798. exportAs?: string[];
  2799. /**
  2800. * Whether this directive/component is standalone.
  2801. */
  2802. standalone?: boolean;
  2803. /**
  2804. * Whether this directive/component is signal-based.
  2805. */
  2806. signals?: boolean;
  2807. }
  2808. interface ComponentDefinition<T> extends Omit<DirectiveDefinition<T>, 'features'> {
  2809. /**
  2810. * The number of nodes, local refs, and pipes in this component template.
  2811. *
  2812. * Used to calculate the length of this component's LView array, so we
  2813. * can pre-fill the array and set the binding start index.
  2814. */
  2815. decls: number;
  2816. /**
  2817. * The number of bindings in this component template (including pure fn bindings).
  2818. *
  2819. * Used to calculate the length of this component's LView array, so we
  2820. * can pre-fill the array and set the host binding start index.
  2821. */
  2822. vars: number;
  2823. /**
  2824. * Template function use for rendering DOM.
  2825. *
  2826. * This function has following structure.
  2827. *
  2828. * ```ts
  2829. * function Template<T>(ctx:T, creationMode: boolean) {
  2830. * if (creationMode) {
  2831. * // Contains creation mode instructions.
  2832. * }
  2833. * // Contains binding update instructions
  2834. * }
  2835. * ```
  2836. *
  2837. * Common instructions are:
  2838. * Creation mode instructions:
  2839. * - `elementStart`, `elementEnd`
  2840. * - `text`
  2841. * - `container`
  2842. * - `listener`
  2843. *
  2844. * Binding update instructions:
  2845. * - `bind`
  2846. * - `elementAttribute`
  2847. * - `elementProperty`
  2848. * - `elementClass`
  2849. * - `elementStyle`
  2850. *
  2851. */
  2852. template: ComponentTemplate<T>;
  2853. /**
  2854. * Constants for the nodes in the component's view.
  2855. * Includes attribute arrays, local definition arrays etc.
  2856. */
  2857. consts?: TConstantsOrFactory;
  2858. /**
  2859. * An array of `ngContent[selector]` values that were found in the template.
  2860. */
  2861. ngContentSelectors?: string[];
  2862. /**
  2863. * A list of optional features to apply.
  2864. *
  2865. * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}
  2866. */
  2867. features?: ComponentDefFeature[];
  2868. /**
  2869. * Defines template and style encapsulation options available for Component's {@link /api/core/Component Component}.
  2870. */
  2871. encapsulation?: ViewEncapsulation$1;
  2872. /**
  2873. * Defines arbitrary developer-defined data to be stored on a renderer instance.
  2874. * This is useful for renderers that delegate to other renderers.
  2875. *
  2876. * see: animation
  2877. */
  2878. data?: {
  2879. [kind: string]: any;
  2880. };
  2881. /**
  2882. * A set of styles that the component needs to be present for component to render correctly.
  2883. */
  2884. styles?: string[];
  2885. /**
  2886. * The strategy that the default change detector uses to detect changes.
  2887. * When set, takes effect the next time change detection is triggered.
  2888. */
  2889. changeDetection?: ChangeDetectionStrategy$1;
  2890. /**
  2891. * Registry of directives, components, and pipes that may be found in this component's view.
  2892. *
  2893. * This property is either an array of types or a function that returns the array of types. This
  2894. * function may be necessary to support forward declarations.
  2895. */
  2896. dependencies?: TypeOrFactory<DependencyTypeList>;
  2897. /**
  2898. * The set of schemas that declare elements to be allowed in the component's template.
  2899. */
  2900. schemas?: SchemaMetadata[] | null;
  2901. }
  2902. /**
  2903. * Create a component definition object.
  2904. *
  2905. *
  2906. * # Example
  2907. * ```ts
  2908. * class MyComponent {
  2909. * // Generated by Angular Template Compiler
  2910. * // [Symbol] syntax will not be supported by TypeScript until v2.7
  2911. * static ɵcmp = defineComponent({
  2912. * ...
  2913. * });
  2914. * }
  2915. * ```
  2916. * @codeGenApi
  2917. */
  2918. declare function ɵɵdefineComponent<T>(componentDefinition: ComponentDefinition<T>): ComponentDef<any>;
  2919. /**
  2920. * @codeGenApi
  2921. */
  2922. declare function ɵɵdefineNgModule<T>(def: {
  2923. /** Token representing the module. Used by DI. */
  2924. type: T;
  2925. /** List of components to bootstrap. */
  2926. bootstrap?: Type$1<any>[] | (() => Type$1<any>[]);
  2927. /** List of components, directives, and pipes declared by this module. */
  2928. declarations?: Type$1<any>[] | (() => Type$1<any>[]);
  2929. /** List of modules or `ModuleWithProviders` imported by this module. */
  2930. imports?: Type$1<any>[] | (() => Type$1<any>[]);
  2931. /**
  2932. * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this
  2933. * module.
  2934. */
  2935. exports?: Type$1<any>[] | (() => Type$1<any>[]);
  2936. /** The set of schemas that declare elements to be allowed in the NgModule. */
  2937. schemas?: SchemaMetadata[] | null;
  2938. /** Unique ID for the module that is used with `getModuleFactory`. */
  2939. id?: string | null;
  2940. }): unknown;
  2941. /**
  2942. * Create a directive definition object.
  2943. *
  2944. * # Example
  2945. * ```ts
  2946. * class MyDirective {
  2947. * // Generated by Angular Template Compiler
  2948. * // [Symbol] syntax will not be supported by TypeScript until v2.7
  2949. * static ɵdir = ɵɵdefineDirective({
  2950. * ...
  2951. * });
  2952. * }
  2953. * ```
  2954. *
  2955. * @codeGenApi
  2956. */
  2957. declare function ɵɵdefineDirective<T>(directiveDefinition: DirectiveDefinition<T>): DirectiveDef<any>;
  2958. /**
  2959. * Create a pipe definition object.
  2960. *
  2961. * # Example
  2962. * ```ts
  2963. * class MyPipe implements PipeTransform {
  2964. * // Generated by Angular Template Compiler
  2965. * static ɵpipe = definePipe({
  2966. * ...
  2967. * });
  2968. * }
  2969. * ```
  2970. * @param pipeDef Pipe definition generated by the compiler
  2971. *
  2972. * @codeGenApi
  2973. */
  2974. declare function ɵɵdefinePipe<T>(pipeDef: {
  2975. /** Name of the pipe. Used for matching pipes in template to pipe defs. */
  2976. name: string;
  2977. /** Pipe class reference. Needed to extract pipe lifecycle hooks. */
  2978. type: Type$1<T>;
  2979. /** Whether the pipe is pure. */
  2980. pure?: boolean;
  2981. /**
  2982. * Whether the pipe is standalone.
  2983. */
  2984. standalone?: boolean;
  2985. }): unknown;
  2986. /**
  2987. * If a given component has unresolved async metadata - returns a reference
  2988. * to a function that applies component metadata after resolving defer-loadable
  2989. * dependencies. Otherwise - this function returns `null`.
  2990. */
  2991. declare function getAsyncClassMetadataFn(type: Type$1<unknown>): (() => Promise<Array<Type$1<unknown>>>) | null;
  2992. /**
  2993. * Handles the process of applying metadata info to a component class in case
  2994. * component template has defer blocks (thus some dependencies became deferrable).
  2995. *
  2996. * @param type Component class where metadata should be added
  2997. * @param dependencyLoaderFn Function that loads dependencies
  2998. * @param metadataSetterFn Function that forms a scope in which the `setClassMetadata` is invoked
  2999. */
  3000. declare function setClassMetadataAsync(type: Type$1<any>, dependencyLoaderFn: () => Array<Promise<Type$1<unknown>>>, metadataSetterFn: (...types: Type$1<unknown>[]) => void): () => Promise<Array<Type$1<unknown>>>;
  3001. /**
  3002. * Adds decorator, constructor, and property metadata to a given type via static metadata fields
  3003. * on the type.
  3004. *
  3005. * These metadata fields can later be read with Angular's `ReflectionCapabilities` API.
  3006. *
  3007. * Calls to `setClassMetadata` can be guarded by ngDevMode, resulting in the metadata assignments
  3008. * being tree-shaken away during production builds.
  3009. */
  3010. declare function setClassMetadata(type: Type$1<any>, decorators: any[] | null, ctorParameters: (() => any[]) | null, propDecorators: {
  3011. [field: string]: any;
  3012. } | null): void;
  3013. interface ChangeDetectorRefInterface extends ChangeDetectorRef {
  3014. }
  3015. declare class ViewRef<T> implements EmbeddedViewRef<T>, ChangeDetectorRefInterface {
  3016. /**
  3017. * This represents the `LView` associated with the point where `ChangeDetectorRef` was
  3018. * requested.
  3019. *
  3020. * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.
  3021. */
  3022. private _cdRefInjectingView?;
  3023. private _appRef;
  3024. private _attachedToViewContainer;
  3025. private exhaustive?;
  3026. get rootNodes(): any[];
  3027. constructor(
  3028. /**
  3029. * This represents `LView` associated with the component when ViewRef is a ChangeDetectorRef.
  3030. *
  3031. * When ViewRef is created for a dynamic component, this also represents the `LView` for the
  3032. * component.
  3033. *
  3034. * For a "regular" ViewRef created for an embedded view, this is the `LView` for the embedded
  3035. * view.
  3036. *
  3037. * @internal
  3038. */
  3039. _lView: LView,
  3040. /**
  3041. * This represents the `LView` associated with the point where `ChangeDetectorRef` was
  3042. * requested.
  3043. *
  3044. * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.
  3045. */
  3046. _cdRefInjectingView?: LView | undefined);
  3047. get context(): T;
  3048. /**
  3049. * @deprecated Replacing the full context object is not supported. Modify the context
  3050. * directly, or consider using a `Proxy` if you need to replace the full object.
  3051. * // TODO(devversion): Remove this.
  3052. */
  3053. set context(value: T);
  3054. get destroyed(): boolean;
  3055. destroy(): void;
  3056. onDestroy(callback: Function): void;
  3057. /**
  3058. * Marks a view and all of its ancestors dirty.
  3059. *
  3060. * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush} component is
  3061. * checked when it needs to be re-rendered but the two normal triggers haven't marked it
  3062. * dirty (i.e. inputs haven't changed and events haven't fired in the view).
  3063. *
  3064. * <!-- TODO: Add a link to a chapter on OnPush components -->
  3065. *
  3066. * @usageNotes
  3067. * ### Example
  3068. *
  3069. * ```ts
  3070. * @Component({
  3071. * selector: 'app-root',
  3072. * template: `Number of ticks: {{numberOfTicks}}`
  3073. * changeDetection: ChangeDetectionStrategy.OnPush,
  3074. * })
  3075. * class AppComponent {
  3076. * numberOfTicks = 0;
  3077. *
  3078. * constructor(private ref: ChangeDetectorRef) {
  3079. * setInterval(() => {
  3080. * this.numberOfTicks++;
  3081. * // the following is required, otherwise the view will not be updated
  3082. * this.ref.markForCheck();
  3083. * }, 1000);
  3084. * }
  3085. * }
  3086. * ```
  3087. */
  3088. markForCheck(): void;
  3089. /**
  3090. * Detaches the view from the change detection tree.
  3091. *
  3092. * Detached views will not be checked during change detection runs until they are
  3093. * re-attached, even if they are dirty. `detach` can be used in combination with
  3094. * {@link ChangeDetectorRef#detectChanges} to implement local change
  3095. * detection checks.
  3096. *
  3097. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  3098. * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
  3099. *
  3100. * @usageNotes
  3101. * ### Example
  3102. *
  3103. * The following example defines a component with a large list of readonly data.
  3104. * Imagine the data changes constantly, many times per second. For performance reasons,
  3105. * we want to check and update the list every five seconds. We can do that by detaching
  3106. * the component's change detector and doing a local check every five seconds.
  3107. *
  3108. * ```ts
  3109. * class DataProvider {
  3110. * // in a real application the returned data will be different every time
  3111. * get data() {
  3112. * return [1,2,3,4,5];
  3113. * }
  3114. * }
  3115. *
  3116. * @Component({
  3117. * selector: 'giant-list',
  3118. * template: `
  3119. * @for(d of dataProvider.data; track $index) {
  3120. * <li>Data {{d}}</li>
  3121. * }
  3122. * `,
  3123. * })
  3124. * class GiantList {
  3125. * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {
  3126. * ref.detach();
  3127. * setInterval(() => {
  3128. * this.ref.detectChanges();
  3129. * }, 5000);
  3130. * }
  3131. * }
  3132. *
  3133. * @Component({
  3134. * selector: 'app',
  3135. * providers: [DataProvider],
  3136. * template: `
  3137. * <giant-list><giant-list>
  3138. * `,
  3139. * })
  3140. * class App {
  3141. * }
  3142. * ```
  3143. */
  3144. detach(): void;
  3145. /**
  3146. * Re-attaches a view to the change detection tree.
  3147. *
  3148. * This can be used to re-attach views that were previously detached from the tree
  3149. * using {@link ChangeDetectorRef#detach}. Views are attached to the tree by default.
  3150. *
  3151. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  3152. *
  3153. * @usageNotes
  3154. * ### Example
  3155. *
  3156. * The following example creates a component displaying `live` data. The component will detach
  3157. * its change detector from the main change detector tree when the component's live property
  3158. * is set to false.
  3159. *
  3160. * ```ts
  3161. * class DataProvider {
  3162. * data = 1;
  3163. *
  3164. * constructor() {
  3165. * setInterval(() => {
  3166. * this.data = this.data * 2;
  3167. * }, 500);
  3168. * }
  3169. * }
  3170. *
  3171. * @Component({
  3172. * selector: 'live-data',
  3173. * inputs: ['live'],
  3174. * template: 'Data: {{dataProvider.data}}'
  3175. * })
  3176. * class LiveData {
  3177. * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}
  3178. *
  3179. * set live(value) {
  3180. * if (value) {
  3181. * this.ref.reattach();
  3182. * } else {
  3183. * this.ref.detach();
  3184. * }
  3185. * }
  3186. * }
  3187. *
  3188. * @Component({
  3189. * selector: 'app-root',
  3190. * providers: [DataProvider],
  3191. * template: `
  3192. * Live Update: <input type="checkbox" [(ngModel)]="live">
  3193. * <live-data [live]="live"><live-data>
  3194. * `,
  3195. * })
  3196. * class AppComponent {
  3197. * live = true;
  3198. * }
  3199. * ```
  3200. */
  3201. reattach(): void;
  3202. /**
  3203. * Checks the view and its children.
  3204. *
  3205. * This can also be used in combination with {@link ChangeDetectorRef#detach} to implement
  3206. * local change detection checks.
  3207. *
  3208. * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
  3209. * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
  3210. *
  3211. * @usageNotes
  3212. * ### Example
  3213. *
  3214. * The following example defines a component with a large list of readonly data.
  3215. * Imagine, the data changes constantly, many times per second. For performance reasons,
  3216. * we want to check and update the list every five seconds.
  3217. *
  3218. * We can do that by detaching the component's change detector and doing a local change detection
  3219. * check every five seconds.
  3220. *
  3221. * See {@link ChangeDetectorRef#detach} for more information.
  3222. */
  3223. detectChanges(): void;
  3224. /**
  3225. * Checks the change detector and its children, and throws if any changes are detected.
  3226. *
  3227. * This is used in development mode to verify that running change detection doesn't
  3228. * introduce other changes.
  3229. */
  3230. checkNoChanges(): void;
  3231. attachToViewContainerRef(): void;
  3232. detachFromAppRef(): void;
  3233. attachToAppRef(appRef: ApplicationRef): void;
  3234. }
  3235. /**
  3236. * Reports whether the given view is considered dirty according to the different marking mechanisms.
  3237. */
  3238. declare function isViewDirty(view: ViewRef<unknown>): boolean;
  3239. declare function markForRefresh(view: ViewRef<unknown>): void;
  3240. declare class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
  3241. private ngModule?;
  3242. /**
  3243. * @param ngModule The NgModuleRef to which all resolved factories are bound.
  3244. */
  3245. constructor(ngModule?: NgModuleRef$1<any> | undefined);
  3246. resolveComponentFactory<T>(component: Type$1<T>): ComponentFactory$1<T>;
  3247. }
  3248. /**
  3249. * ComponentFactory interface implementation.
  3250. */
  3251. declare class ComponentFactory<T> extends ComponentFactory$1<T> {
  3252. private componentDef;
  3253. private ngModule?;
  3254. selector: string;
  3255. componentType: Type$1<any>;
  3256. ngContentSelectors: string[];
  3257. isBoundToModule: boolean;
  3258. private cachedInputs;
  3259. private cachedOutputs;
  3260. get inputs(): {
  3261. propName: string;
  3262. templateName: string;
  3263. isSignal: boolean;
  3264. transform?: (value: any) => any;
  3265. }[];
  3266. get outputs(): {
  3267. propName: string;
  3268. templateName: string;
  3269. }[];
  3270. /**
  3271. * @param componentDef The component definition.
  3272. * @param ngModule The NgModuleRef to which the factory is bound.
  3273. */
  3274. constructor(componentDef: ComponentDef<any>, ngModule?: NgModuleRef$1<any> | undefined);
  3275. create(injector: Injector, projectableNodes?: any[][] | undefined, rootSelectorOrNode?: any, environmentInjector?: NgModuleRef$1<any> | EnvironmentInjector | undefined, directives?: (Type$1<unknown> | DirectiveWithBindings<unknown>)[], componentBindings?: Binding[]): ComponentRef$1<T>;
  3276. }
  3277. /**
  3278. * Represents an instance of a Component created via a {@link ComponentFactory}.
  3279. *
  3280. * `ComponentRef` provides access to the Component Instance as well other objects related to this
  3281. * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
  3282. * method.
  3283. *
  3284. */
  3285. declare class ComponentRef<T> extends ComponentRef$1<T> {
  3286. private readonly _rootLView;
  3287. private readonly _hasInputBindings;
  3288. instance: T;
  3289. hostView: ViewRef<T>;
  3290. changeDetectorRef: ChangeDetectorRef;
  3291. componentType: Type$1<T>;
  3292. location: ElementRef;
  3293. private previousInputValues;
  3294. private _tNode;
  3295. constructor(componentType: Type$1<T>, _rootLView: LView, _hasInputBindings: boolean);
  3296. setInput(name: string, value: unknown): void;
  3297. get injector(): Injector;
  3298. destroy(): void;
  3299. onDestroy(callback: () => void): void;
  3300. }
  3301. /**
  3302. * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
  3303. *
  3304. * @param ngModule NgModule class.
  3305. * @param parentInjector Optional injector instance to use as a parent for the module injector. If
  3306. * not provided, `NullInjector` will be used instead.
  3307. * @returns NgModuleRef that represents an NgModule instance.
  3308. *
  3309. * @publicApi
  3310. */
  3311. declare function createNgModule<T>(ngModule: Type$1<T>, parentInjector?: Injector): NgModuleRef$1<T>;
  3312. /**
  3313. * The `createNgModule` function alias for backwards-compatibility.
  3314. * Please avoid using it directly and use `createNgModule` instead.
  3315. *
  3316. * @deprecated Use `createNgModule` instead.
  3317. */
  3318. declare const createNgModuleRef: typeof createNgModule;
  3319. declare class NgModuleRef<T> extends NgModuleRef$1<T> implements InternalNgModuleRef<T> {
  3320. private readonly ngModuleType;
  3321. _parent: Injector | null;
  3322. _bootstrapComponents: Type$1<any>[];
  3323. private readonly _r3Injector;
  3324. instance: T;
  3325. destroyCbs: (() => void)[] | null;
  3326. readonly componentFactoryResolver: ComponentFactoryResolver;
  3327. constructor(ngModuleType: Type$1<T>, _parent: Injector | null, additionalProviders: StaticProvider[], runInjectorInitializers?: boolean);
  3328. resolveInjectorInitializers(): void;
  3329. get injector(): EnvironmentInjector;
  3330. destroy(): void;
  3331. onDestroy(callback: () => void): void;
  3332. }
  3333. declare class NgModuleFactory<T> extends NgModuleFactory$1<T> {
  3334. moduleType: Type$1<T>;
  3335. constructor(moduleType: Type$1<T>);
  3336. create(parentInjector: Injector | null): NgModuleRef$1<T>;
  3337. }
  3338. /**
  3339. * Create a new environment injector.
  3340. *
  3341. * @param providers An array of providers.
  3342. * @param parent A parent environment injector.
  3343. * @param debugName An optional name for this injector instance, which will be used in error
  3344. * messages.
  3345. *
  3346. * @publicApi
  3347. */
  3348. declare function createEnvironmentInjector(providers: Array<Provider | EnvironmentProviders>, parent: EnvironmentInjector, debugName?: string | null): EnvironmentInjector;
  3349. /**
  3350. * Convince closure compiler that the wrapped function has no side-effects.
  3351. *
  3352. * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to
  3353. * allow us to execute a function but have closure compiler mark the call as no-side-effects.
  3354. * It is important that the return value for the `noSideEffects` function be assigned
  3355. * to something which is retained otherwise the call to `noSideEffects` will be removed by closure
  3356. * compiler.
  3357. */
  3358. declare function noSideEffects<T>(fn: () => T): T;
  3359. /**
  3360. * @description
  3361. * Hook for manual bootstrapping of the application instead of using `bootstrap` array in @NgModule
  3362. * annotation. This hook is invoked only when the `bootstrap` array is empty or not provided.
  3363. *
  3364. * Reference to the current application is provided as a parameter.
  3365. *
  3366. * See ["Bootstrapping"](guide/ngmodules/bootstrapping).
  3367. *
  3368. * @usageNotes
  3369. * The example below uses `ApplicationRef.bootstrap()` to render the
  3370. * `AppComponent` on the page.
  3371. *
  3372. * ```ts
  3373. * class AppModule implements DoBootstrap {
  3374. * ngDoBootstrap(appRef: ApplicationRef) {
  3375. * appRef.bootstrap(AppComponent); // Or some other component
  3376. * }
  3377. * }
  3378. * ```
  3379. *
  3380. * @publicApi
  3381. */
  3382. interface DoBootstrap {
  3383. ngDoBootstrap(appRef: ApplicationRef): void;
  3384. }
  3385. /**
  3386. * @description Represents the version of Angular
  3387. *
  3388. * @publicApi
  3389. */
  3390. declare class Version {
  3391. full: string;
  3392. readonly major: string;
  3393. readonly minor: string;
  3394. readonly patch: string;
  3395. constructor(full: string);
  3396. }
  3397. /**
  3398. * @publicApi
  3399. */
  3400. declare const VERSION: Version;
  3401. /**
  3402. * Returns the NgModuleFactory with the given id (specified using [@NgModule.id
  3403. * field](api/core/NgModule#id)), if it exists and has been loaded. Factories for NgModules that do
  3404. * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found.
  3405. * @publicApi
  3406. * @deprecated Use `getNgModuleById` instead.
  3407. */
  3408. declare function getModuleFactory(id: string): NgModuleFactory$1<any>;
  3409. /**
  3410. * Returns the NgModule class with the given id (specified using [@NgModule.id
  3411. * field](api/core/NgModule#id)), if it exists and has been loaded. Classes for NgModules that do
  3412. * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found.
  3413. * @publicApi
  3414. */
  3415. declare function getNgModuleById<T>(id: string): Type$1<T>;
  3416. /**
  3417. * Represents an embedded template that can be used to instantiate embedded views.
  3418. * To instantiate embedded views based on a template, use the `ViewContainerRef`
  3419. * method `createEmbeddedView()`.
  3420. *
  3421. * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`
  3422. * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view
  3423. * is injected into the constructor of the directive,
  3424. * using the `TemplateRef` token.
  3425. *
  3426. * You can also use a `Query` to find a `TemplateRef` associated with
  3427. * a component or a directive.
  3428. *
  3429. * @see {@link ViewContainerRef}
  3430. *
  3431. * @publicApi
  3432. */
  3433. declare class TemplateRef<C> {
  3434. private _declarationLView;
  3435. private _declarationTContainer;
  3436. /**
  3437. * The anchor element in the parent view for this embedded view.
  3438. *
  3439. * The data-binding and [injection contexts](guide/di/dependency-injection-context) of embedded
  3440. * views created from this `TemplateRef` inherit from the contexts of this location.
  3441. *
  3442. * Typically new embedded views are attached to the view container of this location, but in
  3443. * advanced use-cases, the view can be attached to a different container while keeping the
  3444. * data-binding and injection context from the original location.
  3445. *
  3446. */
  3447. readonly elementRef: ElementRef;
  3448. /**
  3449. * Instantiates an unattached embedded view based on this template.
  3450. * @param context The data-binding context of the embedded view, as declared
  3451. * in the `<ng-template>` usage.
  3452. * @param injector Injector to be used within the embedded view.
  3453. * @returns The new embedded view object.
  3454. */
  3455. createEmbeddedView(context: C, injector?: Injector): EmbeddedViewRef<C>;
  3456. }
  3457. /**
  3458. * Represents a container where one or more views can be attached to a component.
  3459. *
  3460. * Can contain *host views* (created by instantiating a
  3461. * component with the `createComponent()` method), and *embedded views*
  3462. * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).
  3463. *
  3464. * A view container instance can contain other view containers,
  3465. * creating a view hierarchy.
  3466. *
  3467. * @usageNotes
  3468. *
  3469. * The example below demonstrates how the `createComponent` function can be used
  3470. * to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,
  3471. * so that it gets included into change detection cycles.
  3472. *
  3473. * Note: the example uses standalone components, but the function can also be used for
  3474. * non-standalone components (declared in an NgModule) as well.
  3475. *
  3476. * ```angular-ts
  3477. * @Component({
  3478. * standalone: true,
  3479. * selector: 'dynamic',
  3480. * template: `<span>This is a content of a dynamic component.</span>`,
  3481. * })
  3482. * class DynamicComponent {
  3483. * vcr = inject(ViewContainerRef);
  3484. * }
  3485. *
  3486. * @Component({
  3487. * standalone: true,
  3488. * selector: 'app',
  3489. * template: `<main>Hi! This is the main content.</main>`,
  3490. * })
  3491. * class AppComponent {
  3492. * vcr = inject(ViewContainerRef);
  3493. *
  3494. * ngAfterViewInit() {
  3495. * const compRef = this.vcr.createComponent(DynamicComponent);
  3496. * compRef.changeDetectorRef.detectChanges();
  3497. * }
  3498. * }
  3499. * ```
  3500. *
  3501. * @see {@link ComponentRef}
  3502. * @see {@link EmbeddedViewRef}
  3503. *
  3504. * @publicApi
  3505. */
  3506. declare abstract class ViewContainerRef {
  3507. /**
  3508. * Anchor element that specifies the location of this container in the containing view.
  3509. * Each view container can have only one anchor element, and each anchor element
  3510. * can have only a single view container.
  3511. *
  3512. * Root elements of views attached to this container become siblings of the anchor element in
  3513. * the rendered view.
  3514. *
  3515. * Access the `ViewContainerRef` of an element by placing a `Directive` injected
  3516. * with `ViewContainerRef` on the element, or use a `ViewChild` query.
  3517. *
  3518. * <!-- TODO: rename to anchorElement -->
  3519. */
  3520. abstract get element(): ElementRef;
  3521. /**
  3522. * The dependency injector for this view container.
  3523. */
  3524. abstract get injector(): Injector;
  3525. /** @deprecated No replacement */
  3526. abstract get parentInjector(): Injector;
  3527. /**
  3528. * Destroys all views in this container.
  3529. */
  3530. abstract clear(): void;
  3531. /**
  3532. * Retrieves a view from this container.
  3533. * @param index The 0-based index of the view to retrieve.
  3534. * @returns The `ViewRef` instance, or null if the index is out of range.
  3535. */
  3536. abstract get(index: number): ViewRef$1 | null;
  3537. /**
  3538. * Reports how many views are currently attached to this container.
  3539. * @returns The number of views.
  3540. */
  3541. abstract get length(): number;
  3542. /**
  3543. * Instantiates an embedded view and inserts it
  3544. * into this container.
  3545. * @param templateRef The HTML template that defines the view.
  3546. * @param context The data-binding context of the embedded view, as declared
  3547. * in the `<ng-template>` usage.
  3548. * @param options Extra configuration for the created view. Includes:
  3549. * * index: The 0-based index at which to insert the new view into this container.
  3550. * If not specified, appends the new view as the last entry.
  3551. * * injector: Injector to be used within the embedded view.
  3552. *
  3553. * @returns The `ViewRef` instance for the newly created view.
  3554. */
  3555. abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, options?: {
  3556. index?: number;
  3557. injector?: Injector;
  3558. }): EmbeddedViewRef<C>;
  3559. /**
  3560. * Instantiates an embedded view and inserts it
  3561. * into this container.
  3562. * @param templateRef The HTML template that defines the view.
  3563. * @param context The data-binding context of the embedded view, as declared
  3564. * in the `<ng-template>` usage.
  3565. * @param index The 0-based index at which to insert the new view into this container.
  3566. * If not specified, appends the new view as the last entry.
  3567. *
  3568. * @returns The `ViewRef` instance for the newly created view.
  3569. */
  3570. abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number): EmbeddedViewRef<C>;
  3571. /**
  3572. * Instantiates a component and inserts its host view into this view container.
  3573. *
  3574. * @param componentType Component Type to use.
  3575. * @param options An object that contains extra parameters:
  3576. * * index: the index at which to insert the new component's host view into this container.
  3577. * If not specified, appends the new view as the last entry.
  3578. * * injector: the injector to use as the parent for the new component.
  3579. * * ngModuleRef: an NgModuleRef of the component's NgModule, you should almost always provide
  3580. * this to ensure that all expected providers are available for the component
  3581. * instantiation.
  3582. * * environmentInjector: an EnvironmentInjector which will provide the component's environment.
  3583. * you should almost always provide this to ensure that all expected providers
  3584. * are available for the component instantiation. This option is intended to
  3585. * replace the `ngModuleRef` parameter.
  3586. * * projectableNodes: list of DOM nodes that should be projected through
  3587. * [`<ng-content>`](api/core/ng-content) of the new component instance.
  3588. * * directives: Directives that should be applied to the component.
  3589. * * bindings: Bindings that should be applied to the component.
  3590. *
  3591. * @returns The new `ComponentRef` which contains the component instance and the host view.
  3592. */
  3593. abstract createComponent<C>(componentType: Type$1<C>, options?: {
  3594. index?: number;
  3595. injector?: Injector;
  3596. ngModuleRef?: NgModuleRef$1<unknown>;
  3597. environmentInjector?: EnvironmentInjector | NgModuleRef$1<unknown>;
  3598. projectableNodes?: Node[][];
  3599. directives?: (Type$1<unknown> | DirectiveWithBindings<unknown>)[];
  3600. bindings?: Binding[];
  3601. }): ComponentRef$1<C>;
  3602. /**
  3603. * Instantiates a single component and inserts its host view into this container.
  3604. *
  3605. * @param componentFactory Component factory to use.
  3606. * @param index The index at which to insert the new component's host view into this container.
  3607. * If not specified, appends the new view as the last entry.
  3608. * @param injector The injector to use as the parent for the new component.
  3609. * @param projectableNodes List of DOM nodes that should be projected through
  3610. * [`<ng-content>`](api/core/ng-content) of the new component instance.
  3611. * @param ngModuleRef An instance of the NgModuleRef that represent an NgModule.
  3612. * This information is used to retrieve corresponding NgModule injector.
  3613. * @param directives Directives that should be applied to the component.
  3614. * @param bindings Bindings that should be applied to the component.
  3615. *
  3616. * @returns The new `ComponentRef` which contains the component instance and the host view.
  3617. *
  3618. * @deprecated Angular no longer requires component factories to dynamically create components.
  3619. * Use different signature of the `createComponent` method, which allows passing
  3620. * Component class directly.
  3621. */
  3622. abstract createComponent<C>(componentFactory: ComponentFactory$1<C>, index?: number, injector?: Injector, projectableNodes?: any[][], environmentInjector?: EnvironmentInjector | NgModuleRef$1<any>, directives?: (Type$1<unknown> | DirectiveWithBindings<unknown>)[], bindings?: Binding[]): ComponentRef$1<C>;
  3623. /**
  3624. * Inserts a view into this container.
  3625. * @param viewRef The view to insert.
  3626. * @param index The 0-based index at which to insert the view.
  3627. * If not specified, appends the new view as the last entry.
  3628. * @returns The inserted `ViewRef` instance.
  3629. *
  3630. */
  3631. abstract insert(viewRef: ViewRef$1, index?: number): ViewRef$1;
  3632. /**
  3633. * Moves a view to a new location in this container.
  3634. * @param viewRef The view to move.
  3635. * @param index The 0-based index of the new location.
  3636. * @returns The moved `ViewRef` instance.
  3637. */
  3638. abstract move(viewRef: ViewRef$1, currentIndex: number): ViewRef$1;
  3639. /**
  3640. * Returns the index of a view within the current container.
  3641. * @param viewRef The view to query.
  3642. * @returns The 0-based index of the view's position in this container,
  3643. * or `-1` if this container doesn't contain the view.
  3644. */
  3645. abstract indexOf(viewRef: ViewRef$1): number;
  3646. /**
  3647. * Destroys a view attached to this container
  3648. * @param index The 0-based index of the view to destroy.
  3649. * If not specified, the last view in the container is removed.
  3650. */
  3651. abstract remove(index?: number): void;
  3652. /**
  3653. * Detaches a view from this container without destroying it.
  3654. * Use along with `insert()` to move a view within the current container.
  3655. * @param index The 0-based index of the view to detach.
  3656. * If not specified, the last view in the container is detached.
  3657. */
  3658. abstract detach(index?: number): ViewRef$1 | null;
  3659. }
  3660. /**
  3661. * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
  3662. * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.
  3663. */
  3664. declare const ALLOW_MULTIPLE_PLATFORMS: InjectionToken<boolean>;
  3665. /**
  3666. * Creates a platform.
  3667. * Platforms must be created on launch using this function.
  3668. *
  3669. * @publicApi
  3670. */
  3671. declare function createPlatform(injector: Injector): PlatformRef;
  3672. /**
  3673. * Creates a factory for a platform. Can be used to provide or override `Providers` specific to
  3674. * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.
  3675. * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories
  3676. * to build up configurations that might be required by different libraries or parts of the
  3677. * application.
  3678. * @param name Identifies the new platform factory.
  3679. * @param providers A set of dependency providers for platforms created with the new factory.
  3680. *
  3681. * @publicApi
  3682. */
  3683. declare function createPlatformFactory(parentPlatformFactory: ((extraProviders?: StaticProvider[]) => PlatformRef) | null, name: string, providers?: StaticProvider[]): (extraProviders?: StaticProvider[]) => PlatformRef;
  3684. /**
  3685. * Checks that there is currently a platform that contains the given token as a provider.
  3686. *
  3687. * @publicApi
  3688. */
  3689. declare function assertPlatform(requiredToken: any): PlatformRef;
  3690. /**
  3691. * Returns the current platform.
  3692. *
  3693. * @publicApi
  3694. */
  3695. declare function getPlatform(): PlatformRef | null;
  3696. /**
  3697. * Destroys the current Angular platform and all Angular applications on the page.
  3698. * Destroys all modules and listeners registered with the platform.
  3699. *
  3700. * @publicApi
  3701. */
  3702. declare function destroyPlatform(): void;
  3703. /**
  3704. * The goal of this function is to bootstrap a platform injector,
  3705. * but avoid referencing `PlatformRef` class.
  3706. * This function is needed for bootstrapping a Standalone Component.
  3707. */
  3708. declare function createOrReusePlatformInjector(providers?: StaticProvider[]): Injector;
  3709. /**
  3710. * @description
  3711. * This function is used to provide initialization functions that will be executed upon
  3712. * initialization of the platform injector.
  3713. *
  3714. * Note that the provided initializer is run in the injection context.
  3715. *
  3716. * Previously, this was achieved using the `PLATFORM_INITIALIZER` token which is now deprecated.
  3717. *
  3718. * @see {@link PLATFORM_INITIALIZER}
  3719. *
  3720. * @publicApi
  3721. */
  3722. declare function providePlatformInitializer(initializerFn: () => void): EnvironmentProviders;
  3723. /**
  3724. * Internal token used to verify that `provideZoneChangeDetection` is not used
  3725. * with the bootstrapModule API.
  3726. */
  3727. declare const PROVIDED_NG_ZONE: InjectionToken<boolean>;
  3728. declare function internalProvideZoneChangeDetection({ ngZoneFactory, ignoreChangesOutsideZone, scheduleInRootZone, }: {
  3729. ngZoneFactory?: () => NgZone;
  3730. ignoreChangesOutsideZone?: boolean;
  3731. scheduleInRootZone?: boolean;
  3732. }): StaticProvider[];
  3733. /**
  3734. * Provides `NgZone`-based change detection for the application bootstrapped using
  3735. * `bootstrapApplication`.
  3736. *
  3737. * `NgZone` is already provided in applications by default. This provider allows you to configure
  3738. * options like `eventCoalescing` in the `NgZone`.
  3739. * This provider is not available for `platformBrowser().bootstrapModule`, which uses
  3740. * `BootstrapOptions` instead.
  3741. *
  3742. * @usageNotes
  3743. * ```ts
  3744. * bootstrapApplication(MyApp, {providers: [
  3745. * provideZoneChangeDetection({eventCoalescing: true}),
  3746. * ]});
  3747. * ```
  3748. *
  3749. * @publicApi
  3750. * @see {@link /api/platform-browser/bootstrapApplication bootstrapApplication}
  3751. * @see {@link NgZoneOptions}
  3752. */
  3753. declare function provideZoneChangeDetection(options?: NgZoneOptions): EnvironmentProviders;
  3754. /**
  3755. * Used to configure event and run coalescing with `provideZoneChangeDetection`.
  3756. *
  3757. * @publicApi
  3758. *
  3759. * @see {@link provideZoneChangeDetection}
  3760. */
  3761. interface NgZoneOptions {
  3762. /**
  3763. * Optionally specify coalescing event change detections or not.
  3764. * Consider the following case.
  3765. *
  3766. * ```html
  3767. * <div (click)="doSomething()">
  3768. * <button (click)="doSomethingElse()"></button>
  3769. * </div>
  3770. * ```
  3771. *
  3772. * When button is clicked, because of the event bubbling, both
  3773. * event handlers will be called and 2 change detections will be
  3774. * triggered. We can coalesce such kind of events to trigger
  3775. * change detection only once.
  3776. *
  3777. * By default, this option is set to false, meaning events will
  3778. * not be coalesced, and change detection will be triggered multiple times.
  3779. * If this option is set to true, change detection will be triggered
  3780. * once in the scenario described above.
  3781. */
  3782. eventCoalescing?: boolean;
  3783. /**
  3784. * Optionally specify if `NgZone#run()` method invocations should be coalesced
  3785. * into a single change detection.
  3786. *
  3787. * Consider the following case.
  3788. * ```ts
  3789. * for (let i = 0; i < 10; i ++) {
  3790. * ngZone.run(() => {
  3791. * // do something
  3792. * });
  3793. * }
  3794. * ```
  3795. *
  3796. * This case triggers the change detection multiple times.
  3797. * With ngZoneRunCoalescing options, all change detections in an event loop trigger only once.
  3798. * In addition, the change detection executes in requestAnimation.
  3799. *
  3800. */
  3801. runCoalescing?: boolean;
  3802. /**
  3803. * When false, change detection is scheduled when Angular receives
  3804. * a clear indication that templates need to be refreshed. This includes:
  3805. *
  3806. * - calling `ChangeDetectorRef.markForCheck`
  3807. * - calling `ComponentRef.setInput`
  3808. * - updating a signal that is read in a template
  3809. * - attaching a view that is marked dirty
  3810. * - removing a view
  3811. * - registering a render hook (templates are only refreshed if render hooks do one of the above)
  3812. *
  3813. * @deprecated This option was introduced out of caution as a way for developers to opt out of the
  3814. * new behavior in v18 which schedule change detection for the above events when they occur
  3815. * outside the Zone. After monitoring the results post-release, we have determined that this
  3816. * feature is working as desired and do not believe it should ever be disabled by setting
  3817. * this option to `true`.
  3818. */
  3819. ignoreChangesOutsideZone?: boolean;
  3820. }
  3821. declare class ChangeDetectionSchedulerImpl implements ChangeDetectionScheduler {
  3822. private readonly applicationErrorHandler;
  3823. private readonly appRef;
  3824. private readonly taskService;
  3825. private readonly ngZone;
  3826. private readonly zonelessEnabled;
  3827. private readonly tracing;
  3828. private readonly disableScheduling;
  3829. private readonly zoneIsDefined;
  3830. private readonly schedulerTickApplyArgs;
  3831. private readonly subscriptions;
  3832. private readonly angularZoneId;
  3833. private readonly scheduleInRootZone;
  3834. private cancelScheduledCallback;
  3835. private useMicrotaskScheduler;
  3836. runningTick: boolean;
  3837. pendingRenderTaskId: number | null;
  3838. constructor();
  3839. notify(source: NotificationSource): void;
  3840. private shouldScheduleTick;
  3841. /**
  3842. * Calls ApplicationRef._tick inside the `NgZone`.
  3843. *
  3844. * Calling `tick` directly runs change detection and cancels any change detection that had been
  3845. * scheduled previously.
  3846. *
  3847. * @param shouldRefreshViews Passed directly to `ApplicationRef._tick` and skips straight to
  3848. * render hooks when `false`.
  3849. */
  3850. private tick;
  3851. ngOnDestroy(): void;
  3852. private cleanup;
  3853. static ɵfac: __FactoryDeclaration<ChangeDetectionSchedulerImpl, never>;
  3854. static ɵprov: __InjectableDeclaration<ChangeDetectionSchedulerImpl>;
  3855. }
  3856. /**
  3857. * Provides change detection without ZoneJS for the application bootstrapped using
  3858. * `bootstrapApplication`.
  3859. *
  3860. * This function allows you to configure the application to not use the state/state changes of
  3861. * ZoneJS to schedule change detection in the application. This will work when ZoneJS is not present
  3862. * on the page at all or if it exists because something else is using it (either another Angular
  3863. * application which uses ZoneJS for scheduling or some other library that relies on ZoneJS).
  3864. *
  3865. * This can also be added to the `TestBed` providers to configure the test environment to more
  3866. * closely match production behavior. This will help give higher confidence that components are
  3867. * compatible with zoneless change detection.
  3868. *
  3869. * ZoneJS uses browser events to trigger change detection. When using this provider, Angular will
  3870. * instead use Angular APIs to schedule change detection. These APIs include:
  3871. *
  3872. * - `ChangeDetectorRef.markForCheck`
  3873. * - `ComponentRef.setInput`
  3874. * - updating a signal that is read in a template
  3875. * - when bound host or template listeners are triggered
  3876. * - attaching a view that was marked dirty by one of the above
  3877. * - removing a view
  3878. * - registering a render hook (templates are only refreshed if render hooks do one of the above)
  3879. *
  3880. * @usageNotes
  3881. * ```ts
  3882. * bootstrapApplication(MyApp, {providers: [
  3883. * provideZonelessChangeDetection(),
  3884. * ]});
  3885. * ```
  3886. *
  3887. * This API is experimental. Neither the shape, nor the underlying behavior is stable and can change
  3888. * in patch versions. There are known feature gaps and API ergonomic considerations. We will iterate
  3889. * on the exact API based on the feedback and our understanding of the problem and solution space.
  3890. *
  3891. * @developerPreview 20.0
  3892. * @see {@link /api/platform-browser/bootstrapApplication bootstrapApplication}
  3893. */
  3894. declare function provideZonelessChangeDetection(): EnvironmentProviders;
  3895. /**
  3896. * Internal implementation of the pending tasks service.
  3897. */
  3898. declare class PendingTasksInternal implements OnDestroy {
  3899. private taskId;
  3900. private pendingTasks;
  3901. private destroyed;
  3902. private pendingTask;
  3903. get hasPendingTasks(): boolean;
  3904. /**
  3905. * In case the service is about to be destroyed, return a self-completing observable.
  3906. * Otherwise, return the observable that emits the current state of pending tasks.
  3907. */
  3908. get hasPendingTasksObservable(): Observable<boolean>;
  3909. add(): number;
  3910. has(taskId: number): boolean;
  3911. remove(taskId: number): void;
  3912. ngOnDestroy(): void;
  3913. /** @nocollapse */
  3914. static ɵprov: unknown;
  3915. }
  3916. /**
  3917. * Service that keeps track of pending tasks contributing to the stableness of Angular
  3918. * application. While several existing Angular services (ex.: `HttpClient`) will internally manage
  3919. * tasks influencing stability, this API gives control over stability to library and application
  3920. * developers for specific cases not covered by Angular internals.
  3921. *
  3922. * The concept of stability comes into play in several important scenarios:
  3923. * - SSR process needs to wait for the application stability before serializing and sending rendered
  3924. * HTML;
  3925. * - tests might want to delay assertions until the application becomes stable;
  3926. *
  3927. * @usageNotes
  3928. * ```ts
  3929. * const pendingTasks = inject(PendingTasks);
  3930. * const taskCleanup = pendingTasks.add();
  3931. * // do work that should block application's stability and then:
  3932. * taskCleanup();
  3933. * ```
  3934. *
  3935. * @publicApi 20.0
  3936. */
  3937. declare class PendingTasks {
  3938. private readonly internalPendingTasks;
  3939. private readonly scheduler;
  3940. private readonly errorHandler;
  3941. /**
  3942. * Adds a new task that should block application's stability.
  3943. * @returns A cleanup function that removes a task when called.
  3944. */
  3945. add(): () => void;
  3946. /**
  3947. * Runs an asynchronous function and blocks the application's stability until the function completes.
  3948. *
  3949. * ```ts
  3950. * pendingTasks.run(async () => {
  3951. * const userData = await fetch('/api/user');
  3952. * this.userData.set(userData);
  3953. * });
  3954. * ```
  3955. *
  3956. * @param fn The asynchronous function to execute
  3957. * @developerPreview 19.0
  3958. */
  3959. run(fn: () => Promise<unknown>): void;
  3960. /** @nocollapse */
  3961. static ɵprov: unknown;
  3962. }
  3963. /**
  3964. * Used to disable exhaustive checks when verifying no expressions changed after they were checked.
  3965. *
  3966. * This means that `OnPush` components that are not marked for check will not be checked.
  3967. * This behavior is the current default behavior in Angular. When running change detection
  3968. * on a view tree, views marked for check are refreshed and the flag to check it is removed.
  3969. * When Angular checks views a second time to ensure nothing has changed, `OnPush` components
  3970. * will no longer be marked and not be checked.
  3971. *
  3972. * @developerPreview 20.0
  3973. */
  3974. declare function provideCheckNoChangesConfig(options: {
  3975. exhaustive: false;
  3976. }): EnvironmentProviders;
  3977. /**
  3978. * - `interval` will periodically run `checkNoChanges` on application views. This can be useful
  3979. * in zoneless applications to periodically ensure no changes have been made without notifying
  3980. * Angular that templates need to be refreshed.
  3981. * - The exhaustive option will treat all application views as if they were `ChangeDetectionStrategy.Default` when verifying
  3982. * no expressions have changed. All views attached to `ApplicationRef` and all the descendants of
  3983. * those views will be checked for changes (excluding those subtrees which are detached via `ChangeDetectorRef.detach()`).
  3984. * This is useful because the check that runs after regular change detection does not work for components using `ChangeDetectionStrategy.OnPush`.
  3985. * This check is will surface any existing errors hidden by `OnPush` components.
  3986. *
  3987. * @developerPreview 20.0
  3988. */
  3989. declare function provideCheckNoChangesConfig(options: {
  3990. interval?: number;
  3991. exhaustive: true;
  3992. }): EnvironmentProviders;
  3993. /**
  3994. * Returns whether Angular is in development mode.
  3995. *
  3996. * By default, this is true, unless `enableProdMode` is invoked prior to calling this method or the
  3997. * application is built using the Angular CLI with the `optimization` option.
  3998. * @see {@link /cli/build ng build}
  3999. *
  4000. * @publicApi
  4001. */
  4002. declare function isDevMode(): boolean;
  4003. /**
  4004. * Disable Angular's development mode, which turns off assertions and other
  4005. * checks within the framework.
  4006. *
  4007. * One important assertion this disables verifies that a change detection pass
  4008. * does not result in additional changes to any bindings (also known as
  4009. * unidirectional data flow).
  4010. *
  4011. * Using this method is discouraged as the Angular CLI will set production mode when using the
  4012. * `optimization` option.
  4013. * @see {@link /cli/build ng build}
  4014. *
  4015. * @publicApi
  4016. */
  4017. declare function enableProdMode(): void;
  4018. /**
  4019. * A DI token representing a string ID, used
  4020. * primarily for prefixing application attributes and CSS styles when
  4021. * {@link ViewEncapsulation#Emulated} is being used.
  4022. *
  4023. * The token is needed in cases when multiple applications are bootstrapped on a page
  4024. * (for example, using `bootstrapApplication` calls). In this case, ensure that those applications
  4025. * have different `APP_ID` value setup. For example:
  4026. *
  4027. * ```ts
  4028. * bootstrapApplication(ComponentA, {
  4029. * providers: [
  4030. * { provide: APP_ID, useValue: 'app-a' },
  4031. * // ... other providers ...
  4032. * ]
  4033. * });
  4034. *
  4035. * bootstrapApplication(ComponentB, {
  4036. * providers: [
  4037. * { provide: APP_ID, useValue: 'app-b' },
  4038. * // ... other providers ...
  4039. * ]
  4040. * });
  4041. * ```
  4042. *
  4043. * By default, when there is only one application bootstrapped, you don't need to provide the
  4044. * `APP_ID` token (the `ng` will be used as an app ID).
  4045. *
  4046. * @publicApi
  4047. */
  4048. declare const APP_ID: InjectionToken<string>;
  4049. /**
  4050. * A function that is executed when a platform is initialized.
  4051. *
  4052. * @deprecated from v19.0.0, use providePlatformInitializer instead
  4053. *
  4054. * @see {@link providePlatformInitializer}
  4055. *
  4056. * @publicApi
  4057. */
  4058. declare const PLATFORM_INITIALIZER: InjectionToken<readonly (() => void)[]>;
  4059. /**
  4060. * A token that indicates an opaque platform ID.
  4061. * @publicApi
  4062. */
  4063. declare const PLATFORM_ID: InjectionToken<Object>;
  4064. /**
  4065. * A DI token that indicates the root directory of
  4066. * the application
  4067. * @publicApi
  4068. * @deprecated
  4069. */
  4070. declare const PACKAGE_ROOT_URL: InjectionToken<string>;
  4071. /**
  4072. * A [DI token](api/core/InjectionToken) that indicates which animations
  4073. * module has been loaded.
  4074. * @publicApi
  4075. */
  4076. declare const ANIMATION_MODULE_TYPE: InjectionToken<"NoopAnimations" | "BrowserAnimations">;
  4077. /**
  4078. * Token used to configure the [Content Security Policy](https://web.dev/strict-csp/) nonce that
  4079. * Angular will apply when inserting inline styles. If not provided, Angular will look up its value
  4080. * from the `ngCspNonce` attribute of the application root node.
  4081. *
  4082. * @publicApi
  4083. */
  4084. declare const CSP_NONCE: InjectionToken<string | null>;
  4085. /**
  4086. * A configuration object for the image-related options. Contains:
  4087. * - breakpoints: An array of integer breakpoints used to generate
  4088. * srcsets for responsive images.
  4089. * - disableImageSizeWarning: A boolean value. Setting this to true will
  4090. * disable console warnings about oversized images.
  4091. * - disableImageLazyLoadWarning: A boolean value. Setting this to true will
  4092. * disable console warnings about LCP images configured with `loading="lazy"`.
  4093. * Learn more about the responsive image configuration in [the NgOptimizedImage
  4094. * guide](guide/image-optimization).
  4095. * Learn more about image warning options in [the related error page](errors/NG0913).
  4096. * @publicApi
  4097. */
  4098. type ImageConfig = {
  4099. breakpoints?: number[];
  4100. placeholderResolution?: number;
  4101. disableImageSizeWarning?: boolean;
  4102. disableImageLazyLoadWarning?: boolean;
  4103. };
  4104. declare const IMAGE_CONFIG_DEFAULTS: ImageConfig;
  4105. /**
  4106. * Injection token that configures the image optimized image functionality.
  4107. * See {@link ImageConfig} for additional information about parameters that
  4108. * can be used.
  4109. *
  4110. * @see {@link NgOptimizedImage}
  4111. * @see {@link ImageConfig}
  4112. * @publicApi
  4113. */
  4114. declare const IMAGE_CONFIG: InjectionToken<ImageConfig>;
  4115. /**
  4116. * A DI token that you can use to provide
  4117. * one or more initialization functions.
  4118. *
  4119. * The provided functions are injected at application startup and executed during
  4120. * app initialization. If any of these functions returns a Promise or an Observable, initialization
  4121. * does not complete until the Promise is resolved or the Observable is completed.
  4122. *
  4123. * You can, for example, create a factory function that loads language data
  4124. * or an external configuration, and provide that function to the `APP_INITIALIZER` token.
  4125. * The function is executed during the application bootstrap process,
  4126. * and the needed data is available on startup.
  4127. *
  4128. * Note that the provided initializer is run in the injection context.
  4129. *
  4130. * @deprecated from v19.0.0, use provideAppInitializer instead
  4131. *
  4132. * @see {@link ApplicationInitStatus}
  4133. * @see {@link provideAppInitializer}
  4134. *
  4135. * @usageNotes
  4136. *
  4137. * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token
  4138. * and a function returning a promise.
  4139. * ### Example with NgModule-based application
  4140. * ```ts
  4141. * function initializeApp(): Promise<any> {
  4142. * const http = inject(HttpClient);
  4143. * return firstValueFrom(
  4144. * http
  4145. * .get("https://someUrl.com/api/user")
  4146. * .pipe(tap(user => { ... }))
  4147. * );
  4148. * }
  4149. *
  4150. * @NgModule({
  4151. * imports: [BrowserModule],
  4152. * declarations: [AppComponent],
  4153. * bootstrap: [AppComponent],
  4154. * providers: [{
  4155. * provide: APP_INITIALIZER,
  4156. * useValue: initializeApp,
  4157. * multi: true,
  4158. * }]
  4159. * })
  4160. * export class AppModule {}
  4161. * ```
  4162. *
  4163. * ### Example with standalone application
  4164. * ```ts
  4165. * function initializeApp() {
  4166. * const http = inject(HttpClient);
  4167. * return firstValueFrom(
  4168. * http
  4169. * .get("https://someUrl.com/api/user")
  4170. * .pipe(tap(user => { ... }))
  4171. * );
  4172. * }
  4173. *
  4174. * bootstrapApplication(App, {
  4175. * providers: [
  4176. * provideHttpClient(),
  4177. * {
  4178. * provide: APP_INITIALIZER,
  4179. * useValue: initializeApp,
  4180. * multi: true,
  4181. * },
  4182. * ],
  4183. * });
  4184. * ```
  4185. *
  4186. *
  4187. * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function
  4188. * returning an observable, see an example below. Note: the `HttpClient` in this example is used for
  4189. * demo purposes to illustrate how the factory function can work with other providers available
  4190. * through DI.
  4191. *
  4192. * ### Example with NgModule-based application
  4193. * ```ts
  4194. * function initializeApp() {
  4195. * const http = inject(HttpClient);
  4196. * return firstValueFrom(
  4197. * http
  4198. * .get("https://someUrl.com/api/user")
  4199. * .pipe(tap(user => { ... }))
  4200. * );
  4201. * }
  4202. *
  4203. * @NgModule({
  4204. * imports: [BrowserModule, HttpClientModule],
  4205. * declarations: [AppComponent],
  4206. * bootstrap: [AppComponent],
  4207. * providers: [{
  4208. * provide: APP_INITIALIZER,
  4209. * useValue: initializeApp,
  4210. * multi: true,
  4211. * }]
  4212. * })
  4213. * export class AppModule {}
  4214. * ```
  4215. *
  4216. * ### Example with standalone application
  4217. * ```ts
  4218. * function initializeApp() {
  4219. * const http = inject(HttpClient);
  4220. * return firstValueFrom(
  4221. * http
  4222. * .get("https://someUrl.com/api/user")
  4223. * .pipe(tap(user => { ... }))
  4224. * );
  4225. * }
  4226. *
  4227. * bootstrapApplication(App, {
  4228. * providers: [
  4229. * provideHttpClient(),
  4230. * {
  4231. * provide: APP_INITIALIZER,
  4232. * useValue: initializeApp,
  4233. * multi: true,
  4234. * },
  4235. * ],
  4236. * });
  4237. * ```
  4238. *
  4239. * @publicApi
  4240. */
  4241. declare const APP_INITIALIZER: InjectionToken<readonly (() => Observable<unknown> | Promise<unknown> | void)[]>;
  4242. /**
  4243. * @description
  4244. * The provided function is injected at application startup and executed during
  4245. * app initialization. If the function returns a Promise or an Observable, initialization
  4246. * does not complete until the Promise is resolved or the Observable is completed.
  4247. *
  4248. * You can, for example, create a function that loads language data
  4249. * or an external configuration, and provide that function using `provideAppInitializer()`.
  4250. * The function is executed during the application bootstrap process,
  4251. * and the needed data is available on startup.
  4252. *
  4253. * Note that the provided initializer is run in the injection context.
  4254. *
  4255. * Previously, this was achieved using the `APP_INITIALIZER` token which is now deprecated.
  4256. *
  4257. * @see {@link APP_INITIALIZER}
  4258. *
  4259. * @usageNotes
  4260. * The following example illustrates how to configure an initialization function using
  4261. * `provideAppInitializer()`
  4262. * ```ts
  4263. * bootstrapApplication(App, {
  4264. * providers: [
  4265. * provideAppInitializer(() => {
  4266. * const http = inject(HttpClient);
  4267. * return firstValueFrom(
  4268. * http
  4269. * .get("https://someUrl.com/api/user")
  4270. * .pipe(tap(user => { ... }))
  4271. * );
  4272. * }),
  4273. * provideHttpClient(),
  4274. * ],
  4275. * });
  4276. * ```
  4277. *
  4278. * @publicApi
  4279. */
  4280. declare function provideAppInitializer(initializerFn: () => Observable<unknown> | Promise<unknown> | void): EnvironmentProviders;
  4281. /**
  4282. * A class that reflects the state of running {@link APP_INITIALIZER} functions.
  4283. *
  4284. * @publicApi
  4285. */
  4286. declare class ApplicationInitStatus {
  4287. private resolve;
  4288. private reject;
  4289. private initialized;
  4290. readonly done = false;
  4291. readonly donePromise: Promise<any>;
  4292. private readonly appInits;
  4293. private readonly injector;
  4294. constructor();
  4295. static ɵfac: __FactoryDeclaration<ApplicationInitStatus, never>;
  4296. static ɵprov: __InjectableDeclaration<ApplicationInitStatus>;
  4297. }
  4298. /**
  4299. * Testability API.
  4300. * `declare` keyword causes tsickle to generate externs, so these methods are
  4301. * not renamed by Closure Compiler.
  4302. * @publicApi
  4303. */
  4304. declare interface PublicTestability {
  4305. isStable(): boolean;
  4306. whenStable(callback: Function, timeout?: number, updateCallback?: Function): void;
  4307. findProviders(using: any, provider: string, exactMatch: boolean): any[];
  4308. }
  4309. /**
  4310. * Internal injection token that can used to access an instance of a Testability class.
  4311. *
  4312. * This token acts as a bridge between the core bootstrap code and the `Testability` class. This is
  4313. * needed to ensure that there are no direct references to the `Testability` class, so it can be
  4314. * tree-shaken away (if not referenced). For the environments/setups when the `Testability` class
  4315. * should be available, this token is used to add a provider that references the `Testability`
  4316. * class. Otherwise, only this token is retained in a bundle, but the `Testability` class is not.
  4317. */
  4318. declare const TESTABILITY: InjectionToken<Testability>;
  4319. /**
  4320. * Internal injection token to retrieve Testability getter class instance.
  4321. */
  4322. declare const TESTABILITY_GETTER: InjectionToken<GetTestability>;
  4323. /**
  4324. * The Testability service provides testing hooks that can be accessed from
  4325. * the browser.
  4326. *
  4327. * Angular applications bootstrapped using an NgModule (via `@NgModule.bootstrap` field) will also
  4328. * instantiate Testability by default (in both development and production modes).
  4329. *
  4330. * For applications bootstrapped using the `bootstrapApplication` function, Testability is not
  4331. * included by default. You can include it into your applications by getting the list of necessary
  4332. * providers using the `provideProtractorTestingSupport()` function and adding them into the
  4333. * `options.providers` array. Example:
  4334. *
  4335. * ```ts
  4336. * import {provideProtractorTestingSupport} from '@angular/platform-browser';
  4337. *
  4338. * await bootstrapApplication(RootComponent, providers: [provideProtractorTestingSupport()]);
  4339. * ```
  4340. *
  4341. * @publicApi
  4342. */
  4343. declare class Testability implements PublicTestability {
  4344. private _ngZone;
  4345. private registry;
  4346. private _isZoneStable;
  4347. private _callbacks;
  4348. private _taskTrackingZone;
  4349. private _destroyRef?;
  4350. constructor(_ngZone: NgZone, registry: TestabilityRegistry, testabilityGetter: GetTestability);
  4351. private _watchAngularEvents;
  4352. /**
  4353. * Whether an associated application is stable
  4354. */
  4355. isStable(): boolean;
  4356. private _runCallbacksIfReady;
  4357. private getPendingTasks;
  4358. private addCallback;
  4359. /**
  4360. * Wait for the application to be stable with a timeout. If the timeout is reached before that
  4361. * happens, the callback receives a list of the macro tasks that were pending, otherwise null.
  4362. *
  4363. * @param doneCb The callback to invoke when Angular is stable or the timeout expires
  4364. * whichever comes first.
  4365. * @param timeout Optional. The maximum time to wait for Angular to become stable. If not
  4366. * specified, whenStable() will wait forever.
  4367. * @param updateCb Optional. If specified, this callback will be invoked whenever the set of
  4368. * pending macrotasks changes. If this callback returns true doneCb will not be invoked
  4369. * and no further updates will be issued.
  4370. */
  4371. whenStable(doneCb: Function, timeout?: number, updateCb?: Function): void;
  4372. /**
  4373. * Find providers by name
  4374. * @param using The root element to search from
  4375. * @param provider The name of binding variable
  4376. * @param exactMatch Whether using exactMatch
  4377. */
  4378. findProviders(using: any, provider: string, exactMatch: boolean): any[];
  4379. static ɵfac: __FactoryDeclaration<Testability, never>;
  4380. static ɵprov: __InjectableDeclaration<Testability>;
  4381. }
  4382. /**
  4383. * A global registry of {@link Testability} instances for specific elements.
  4384. * @publicApi
  4385. */
  4386. declare class TestabilityRegistry {
  4387. /**
  4388. * Registers an application with a testability hook so that it can be tracked
  4389. * @param token token of application, root element
  4390. * @param testability Testability hook
  4391. */
  4392. registerApplication(token: any, testability: Testability): void;
  4393. /**
  4394. * Unregisters an application.
  4395. * @param token token of application, root element
  4396. */
  4397. unregisterApplication(token: any): void;
  4398. /**
  4399. * Unregisters all applications
  4400. */
  4401. unregisterAllApplications(): void;
  4402. /**
  4403. * Get a testability hook associated with the application
  4404. * @param elem root element
  4405. */
  4406. getTestability(elem: any): Testability | null;
  4407. /**
  4408. * Get all registered testabilities
  4409. */
  4410. getAllTestabilities(): Testability[];
  4411. /**
  4412. * Get all registered applications(root elements)
  4413. */
  4414. getAllRootElements(): any[];
  4415. /**
  4416. * Find testability of a node in the Tree
  4417. * @param elem node
  4418. * @param findInAncestors whether finding testability in ancestors if testability was not found in
  4419. * current node
  4420. */
  4421. findTestabilityInTree(elem: Node, findInAncestors?: boolean): Testability | null;
  4422. static ɵfac: __FactoryDeclaration<TestabilityRegistry, never>;
  4423. static ɵprov: __InjectableDeclaration<TestabilityRegistry>;
  4424. }
  4425. /**
  4426. * Adapter interface for retrieving the `Testability` service associated for a
  4427. * particular context.
  4428. *
  4429. * @publicApi
  4430. */
  4431. interface GetTestability {
  4432. addToWindow(registry: TestabilityRegistry): void;
  4433. findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null;
  4434. }
  4435. /**
  4436. * Set the {@link GetTestability} implementation used by the Angular testing framework.
  4437. * @publicApi
  4438. */
  4439. declare function setTestabilityGetter(getter: GetTestability): void;
  4440. /**
  4441. * This platform has to be included in any other platform
  4442. *
  4443. * @publicApi
  4444. */
  4445. declare const platformCore: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
  4446. /**
  4447. * Provide this token to set the locale of your application.
  4448. * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
  4449. * DecimalPipe and PercentPipe) and by ICU expressions.
  4450. *
  4451. * See the [i18n guide](guide/i18n/locale-id) for more information.
  4452. *
  4453. * @usageNotes
  4454. * ### Example
  4455. * In standalone apps:
  4456. * ```ts
  4457. * import { LOCALE_ID, ApplicationConfig } from '@angular/core';
  4458. * import { AppModule } from './app/app.module';
  4459. *
  4460. * const appConfig: ApplicationConfig = {
  4461. * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
  4462. * };
  4463. * ```
  4464. *
  4465. * In module based apps:
  4466. * ```ts
  4467. * import { LOCALE_ID } from '@angular/core';
  4468. * import { platformBrowser } from '@angular/platform-browser';
  4469. * import { AppModule } from './app/app.module';
  4470. *
  4471. * platformBrowser().bootstrapModule(AppModule, {
  4472. * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
  4473. * });
  4474. * ```
  4475. *
  4476. * @publicApi
  4477. */
  4478. declare const LOCALE_ID: InjectionToken<string>;
  4479. /**
  4480. * Provide this token to set the default currency code your application uses for
  4481. * CurrencyPipe when there is no currency code passed into it. This is only used by
  4482. * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.
  4483. *
  4484. * See the [i18n guide](guide/i18n/locale-id) for more information.
  4485. *
  4486. * <div class="docs-alert docs-alert-helpful">
  4487. *
  4488. * The default currency code is currently always `USD`.
  4489. *
  4490. * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in
  4491. * your application `NgModule`:
  4492. *
  4493. * ```ts
  4494. * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
  4495. * ```
  4496. *
  4497. * </div>
  4498. *
  4499. * @usageNotes
  4500. * ### Example
  4501. * In standalone apps:
  4502. * ```ts
  4503. * import { LOCALE_ID, ApplicationConfig } from '@angular/core';
  4504. *
  4505. * const appConfig: ApplicationConfig = {
  4506. * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]
  4507. * };
  4508. * ```
  4509. *
  4510. * In module based apps:
  4511. * ```ts
  4512. * import { platformBrowser } from '@angular/platform-browser';
  4513. * import { AppModule } from './app/app.module';
  4514. *
  4515. * platformBrowser().bootstrapModule(AppModule, {
  4516. * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]
  4517. * });
  4518. * ```
  4519. *
  4520. * @publicApi
  4521. */
  4522. declare const DEFAULT_CURRENCY_CODE: InjectionToken<string>;
  4523. /**
  4524. * Use this token at bootstrap to provide the content of your translation file (`xtb`,
  4525. * `xlf` or `xlf2`) when you want to translate your application in another language.
  4526. *
  4527. * See the [i18n guide](guide/i18n/merge) for more information.
  4528. *
  4529. * @usageNotes
  4530. * ### Example
  4531. * In standalone apps:
  4532. * ```ts
  4533. * import { LOCALE_ID, ApplicationConfig } from '@angular/core';
  4534. *
  4535. * const appConfig: ApplicationConfig = {
  4536. * providers: [{provide: TRANSLATIONS, useValue: translations }]
  4537. * };
  4538. * ```
  4539. *
  4540. * In module based apps:
  4541. * ```ts
  4542. * import { TRANSLATIONS } from '@angular/core';
  4543. * import { platformBrowser } from '@angular/platform-browser';
  4544. * import { AppModule } from './app/app.module';
  4545. *
  4546. * // content of your translation file
  4547. * const translations = '....';
  4548. *
  4549. * platformBrowser().bootstrapModule(AppModule, {
  4550. * providers: [{provide: TRANSLATIONS, useValue: translations }]
  4551. * });
  4552. * ```
  4553. *
  4554. * @publicApi
  4555. */
  4556. declare const TRANSLATIONS: InjectionToken<string>;
  4557. /**
  4558. * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
  4559. * `xlf` or `xlf2`.
  4560. *
  4561. * See the [i18n guide](guide/i18n/merge) for more information.
  4562. *
  4563. * @usageNotes
  4564. * ### Example
  4565. * In standalone apps:
  4566. * ```ts
  4567. * import { LOCALE_ID, ApplicationConfig } from '@angular/core';
  4568. *
  4569. * const appConfig: ApplicationConfig = {
  4570. * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
  4571. * };
  4572. * ```
  4573. *
  4574. * In module based apps: *
  4575. * ```ts
  4576. * import { TRANSLATIONS_FORMAT } from '@angular/core';
  4577. * import { platformBrowser } from '@angular/platform-browser';
  4578. * import { AppModule } from './app/app.module';
  4579. *
  4580. * platformBrowser().bootstrapModule(AppModule, {
  4581. * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
  4582. * });
  4583. * ```
  4584. *
  4585. * @publicApi
  4586. */
  4587. declare const TRANSLATIONS_FORMAT: InjectionToken<string>;
  4588. /**
  4589. * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
  4590. * that the compiler should use in case of missing translations:
  4591. * - Error: throw if you have missing translations.
  4592. * - Warning (default): show a warning in the console and/or shell.
  4593. * - Ignore: do nothing.
  4594. *
  4595. * See the [i18n guide](guide/i18n/merge#report-missing-translations) for more information.
  4596. *
  4597. * @usageNotes
  4598. * ### Example
  4599. * ```ts
  4600. * import { MissingTranslationStrategy } from '@angular/core';
  4601. * import { platformBrowser } from '@angular/platform-browser';
  4602. * import { AppModule } from './app/app.module';
  4603. *
  4604. * platformBrowser().bootstrapModule(AppModule, {
  4605. * missingTranslation: MissingTranslationStrategy.Error
  4606. * });
  4607. * ```
  4608. *
  4609. * @publicApi
  4610. */
  4611. declare enum MissingTranslationStrategy {
  4612. Error = 0,
  4613. Warning = 1,
  4614. Ignore = 2
  4615. }
  4616. /**
  4617. * Re-exported by `BrowserModule`, which is included automatically in the root
  4618. * `AppModule` when you create a new app with the CLI `new` command. Eagerly injects
  4619. * `ApplicationRef` to instantiate it.
  4620. *
  4621. * @publicApi
  4622. */
  4623. declare class ApplicationModule {
  4624. constructor(appRef: ApplicationRef);
  4625. static ɵfac: __FactoryDeclaration<ApplicationModule, never>;
  4626. static ɵmod: __NgModuleDeclaration<ApplicationModule, never, never, never>;
  4627. static ɵinj: __InjectorDeclaration<ApplicationModule>;
  4628. }
  4629. /**
  4630. * Provides a hook for centralized exception handling.
  4631. *
  4632. * The default implementation of `ErrorHandler` prints error messages to the `console`. To
  4633. * intercept error handling, write a custom exception handler that replaces this default as
  4634. * appropriate for your app.
  4635. *
  4636. * @usageNotes
  4637. * ### Example
  4638. *
  4639. * ```ts
  4640. * class MyErrorHandler implements ErrorHandler {
  4641. * handleError(error) {
  4642. * // do something with the exception
  4643. * }
  4644. * }
  4645. *
  4646. * // Provide in standalone apps
  4647. * bootstrapApplication(AppComponent, {
  4648. * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
  4649. * })
  4650. *
  4651. * // Provide in module-based apps
  4652. * @NgModule({
  4653. * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
  4654. * })
  4655. * class MyModule {}
  4656. * ```
  4657. *
  4658. * @publicApi
  4659. */
  4660. declare class ErrorHandler {
  4661. handleError(error: any): void;
  4662. }
  4663. /**
  4664. * `InjectionToken` used to configure how to call the `ErrorHandler`.
  4665. */
  4666. declare const INTERNAL_APPLICATION_ERROR_HANDLER: InjectionToken<(e: any) => void>;
  4667. /**
  4668. * Provides an environment initializer which forwards unhandled errors to the ErrorHandler.
  4669. *
  4670. * The listeners added are for the window's 'unhandledrejection' and 'error' events.
  4671. *
  4672. * @publicApi
  4673. */
  4674. declare function provideBrowserGlobalErrorListeners(): EnvironmentProviders;
  4675. /**
  4676. * Internal create application API that implements the core application creation logic and optional
  4677. * bootstrap logic.
  4678. *
  4679. * Platforms (such as `platform-browser`) may require different set of application and platform
  4680. * providers for an application to function correctly. As a result, platforms may use this function
  4681. * internally and supply the necessary providers during the bootstrap, while exposing
  4682. * platform-specific APIs as a part of their public API.
  4683. *
  4684. * @returns A promise that returns an `ApplicationRef` instance once resolved.
  4685. */
  4686. declare function internalCreateApplication(config: {
  4687. rootComponent?: Type$1<unknown>;
  4688. appProviders?: Array<Provider | EnvironmentProviders>;
  4689. platformProviders?: Provider[];
  4690. }): Promise<ApplicationRef>;
  4691. declare class Console {
  4692. log(message: string): void;
  4693. warn(message: string): void;
  4694. static ɵfac: __FactoryDeclaration<Console, never>;
  4695. static ɵprov: __InjectableDeclaration<Console>;
  4696. }
  4697. /**
  4698. * **INTERNAL**, avoid referencing it in application code.
  4699. * *
  4700. * Injector token that allows to provide `DeferBlockDependencyInterceptor` class
  4701. * implementation.
  4702. *
  4703. * This token is only injected in devMode
  4704. */
  4705. declare const DEFER_BLOCK_DEPENDENCY_INTERCEPTOR: InjectionToken<DeferBlockDependencyInterceptor>;
  4706. /**
  4707. * **INTERNAL**, token used for configuring defer block behavior.
  4708. */
  4709. declare const DEFER_BLOCK_CONFIG: InjectionToken<DeferBlockConfig>;
  4710. /** Rendering Helpers */
  4711. /**
  4712. * Transitions a defer block to the new state. Updates the necessary
  4713. * data structures and renders corresponding block.
  4714. *
  4715. * @param newState New state that should be applied to the defer block.
  4716. * @param tNode TNode that represents a defer block.
  4717. * @param lContainer Represents an instance of a defer block.
  4718. * @param skipTimerScheduling Indicates that `@loading` and `@placeholder` block
  4719. * should be rendered immediately, even if they have `after` or `minimum` config
  4720. * options setup. This flag to needed for testing APIs to transition defer block
  4721. * between states via `DeferFixture.render` method.
  4722. */
  4723. declare function renderDeferBlockState(newState: DeferBlockState, tNode: TNode, lContainer: LContainer, skipTimerScheduling?: boolean): void;
  4724. /**
  4725. * Enables timer-related scheduling if `after` or `minimum` parameters are setup
  4726. * on the `@loading` or `@placeholder` blocks.
  4727. */
  4728. declare function ɵɵdeferEnableTimerScheduling(tView: TView, tDetails: TDeferBlockDetails, placeholderConfigIndex?: number | null, loadingConfigIndex?: number | null): void;
  4729. /**
  4730. * Trigger loading of defer block dependencies if the process hasn't started yet.
  4731. *
  4732. * @param tDetails Static information about this defer block.
  4733. * @param lView LView of a host view.
  4734. */
  4735. declare function triggerResourceLoading(tDetails: TDeferBlockDetails, lView: LView, tNode: TNode): Promise<unknown>;
  4736. /**
  4737. * Tell ivy what the `document` is for this platform.
  4738. *
  4739. * It is only necessary to call this if the current platform is not a browser.
  4740. *
  4741. * @param document The object representing the global `document` in this environment.
  4742. */
  4743. declare function setDocument(document: Document | undefined): void;
  4744. /**
  4745. * Access the object that represents the `document` for this platform.
  4746. *
  4747. * Ivy calls this whenever it needs to access the `document` object.
  4748. * For example to create the renderer or to do sanitization.
  4749. */
  4750. declare function getDocument(): Document;
  4751. /**
  4752. * URL for the XSS security documentation.
  4753. */
  4754. declare const XSS_SECURITY_URL = "https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss";
  4755. /**
  4756. * The list of error codes used in runtime code of the `core` package.
  4757. * Reserved error code range: 100-999.
  4758. *
  4759. * Note: the minus sign denotes the fact that a particular code has a detailed guide on
  4760. * angular.io. This extra annotation is needed to avoid introducing a separate set to store
  4761. * error codes which have guides, which might leak into runtime code.
  4762. *
  4763. * Full list of available error guides can be found at https://angular.dev/errors.
  4764. *
  4765. * Error code ranges per package:
  4766. * - core (this package): 100-999
  4767. * - forms: 1000-1999
  4768. * - common: 2000-2999
  4769. * - animations: 3000-3999
  4770. * - router: 4000-4999
  4771. * - platform-browser: 5000-5500
  4772. */
  4773. declare const enum RuntimeErrorCode {
  4774. EXPRESSION_CHANGED_AFTER_CHECKED = -100,
  4775. RECURSIVE_APPLICATION_REF_TICK = 101,
  4776. INFINITE_CHANGE_DETECTION = 103,
  4777. CYCLIC_DI_DEPENDENCY = -200,
  4778. PROVIDER_NOT_FOUND = -201,
  4779. INVALID_FACTORY_DEPENDENCY = 202,
  4780. MISSING_INJECTION_CONTEXT = -203,
  4781. INVALID_INJECTION_TOKEN = 204,
  4782. INJECTOR_ALREADY_DESTROYED = 205,
  4783. PROVIDER_IN_WRONG_CONTEXT = 207,
  4784. MISSING_INJECTION_TOKEN = 208,
  4785. INVALID_MULTI_PROVIDER = -209,
  4786. MISSING_DOCUMENT = 210,
  4787. MULTIPLE_COMPONENTS_MATCH = -300,
  4788. EXPORT_NOT_FOUND = -301,
  4789. PIPE_NOT_FOUND = -302,
  4790. UNKNOWN_BINDING = 303,
  4791. UNKNOWN_ELEMENT = 304,
  4792. TEMPLATE_STRUCTURE_ERROR = 305,
  4793. INVALID_EVENT_BINDING = 306,
  4794. HOST_DIRECTIVE_UNRESOLVABLE = 307,
  4795. HOST_DIRECTIVE_NOT_STANDALONE = 308,
  4796. DUPLICATE_DIRECTIVE = 309,
  4797. HOST_DIRECTIVE_COMPONENT = 310,
  4798. HOST_DIRECTIVE_UNDEFINED_BINDING = 311,
  4799. HOST_DIRECTIVE_CONFLICTING_ALIAS = 312,
  4800. MULTIPLE_MATCHING_PIPES = 313,
  4801. UNINITIALIZED_LET_ACCESS = 314,
  4802. NO_BINDING_TARGET = 315,
  4803. INVALID_BINDING_TARGET = 316,
  4804. INVALID_SET_INPUT_CALL = 317,
  4805. MULTIPLE_PLATFORMS = 400,
  4806. PLATFORM_NOT_FOUND = 401,
  4807. MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP = 402,
  4808. BOOTSTRAP_COMPONENTS_NOT_FOUND = -403,
  4809. PLATFORM_ALREADY_DESTROYED = 404,
  4810. ASYNC_INITIALIZERS_STILL_RUNNING = 405,
  4811. APPLICATION_REF_ALREADY_DESTROYED = 406,
  4812. RENDERER_NOT_FOUND = 407,
  4813. PROVIDED_BOTH_ZONE_AND_ZONELESS = 408,
  4814. HYDRATION_NODE_MISMATCH = -500,
  4815. HYDRATION_MISSING_SIBLINGS = -501,
  4816. HYDRATION_MISSING_NODE = -502,
  4817. UNSUPPORTED_PROJECTION_DOM_NODES = -503,
  4818. INVALID_SKIP_HYDRATION_HOST = -504,
  4819. MISSING_HYDRATION_ANNOTATIONS = -505,
  4820. HYDRATION_STABLE_TIMEDOUT = -506,
  4821. MISSING_SSR_CONTENT_INTEGRITY_MARKER = -507,
  4822. MISCONFIGURED_INCREMENTAL_HYDRATION = 508,
  4823. SIGNAL_WRITE_FROM_ILLEGAL_CONTEXT = 600,
  4824. REQUIRE_SYNC_WITHOUT_SYNC_EMIT = 601,
  4825. ASSERTION_NOT_INSIDE_REACTIVE_CONTEXT = -602,
  4826. INVALID_I18N_STRUCTURE = 700,
  4827. MISSING_LOCALE_DATA = 701,
  4828. DEFER_LOADING_FAILED = -750,
  4829. DEFER_IN_HMR_MODE = -751,
  4830. IMPORT_PROVIDERS_FROM_STANDALONE = 800,
  4831. INVALID_DIFFER_INPUT = 900,
  4832. NO_SUPPORTING_DIFFER_FACTORY = 901,
  4833. VIEW_ALREADY_ATTACHED = 902,
  4834. INVALID_INHERITANCE = 903,
  4835. UNSAFE_VALUE_IN_RESOURCE_URL = 904,
  4836. UNSAFE_VALUE_IN_SCRIPT = 905,
  4837. MISSING_GENERATED_DEF = 906,
  4838. TYPE_IS_NOT_STANDALONE = 907,
  4839. MISSING_ZONEJS = 908,
  4840. UNEXPECTED_ZONE_STATE = 909,
  4841. UNSAFE_IFRAME_ATTRS = -910,
  4842. VIEW_ALREADY_DESTROYED = 911,
  4843. COMPONENT_ID_COLLISION = -912,
  4844. IMAGE_PERFORMANCE_WARNING = -913,
  4845. UNEXPECTED_ZONEJS_PRESENT_IN_ZONELESS_MODE = 914,
  4846. MISSING_NG_MODULE_DEFINITION = 915,
  4847. MISSING_DIRECTIVE_DEFINITION = 916,
  4848. NO_COMPONENT_FACTORY_FOUND = 917,
  4849. REQUIRED_INPUT_NO_VALUE = -950,
  4850. REQUIRED_QUERY_NO_VALUE = -951,
  4851. REQUIRED_MODEL_NO_VALUE = 952,
  4852. OUTPUT_REF_DESTROYED = 953,
  4853. LOOP_TRACK_DUPLICATE_KEYS = -955,
  4854. LOOP_TRACK_RECREATE = -956,
  4855. RUNTIME_DEPS_INVALID_IMPORTED_TYPE = 980,
  4856. RUNTIME_DEPS_ORPHAN_COMPONENT = 981,
  4857. MUST_PROVIDE_STREAM_OPTION = 990,
  4858. RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE = 991
  4859. }
  4860. /**
  4861. * Class that represents a runtime error.
  4862. * Formats and outputs the error message in a consistent way.
  4863. *
  4864. * Example:
  4865. * ```ts
  4866. * throw new RuntimeError(
  4867. * RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED,
  4868. * ngDevMode && 'Injector has already been destroyed.');
  4869. * ```
  4870. *
  4871. * Note: the `message` argument contains a descriptive error message as a string in development
  4872. * mode (when the `ngDevMode` is defined). In production mode (after tree-shaking pass), the
  4873. * `message` argument becomes `false`, thus we account for it in the typings and the runtime
  4874. * logic.
  4875. */
  4876. declare class RuntimeError<T extends number = RuntimeErrorCode> extends Error {
  4877. code: T;
  4878. constructor(code: T, message: null | false | string);
  4879. }
  4880. /**
  4881. * Called to format a runtime error.
  4882. * See additional info on the `message` argument type in the `RuntimeError` class description.
  4883. */
  4884. declare function formatRuntimeError<T extends number = RuntimeErrorCode>(code: T, message: null | false | string): string;
  4885. /**
  4886. * A type-safe key to use with `TransferState`.
  4887. *
  4888. * Example:
  4889. *
  4890. * ```ts
  4891. * const COUNTER_KEY = makeStateKey<number>('counter');
  4892. * let value = 10;
  4893. *
  4894. * transferState.set(COUNTER_KEY, value);
  4895. * ```
  4896. *
  4897. * @publicApi
  4898. */
  4899. type StateKey<T> = string & {
  4900. __not_a_string: never;
  4901. __value_type?: T;
  4902. };
  4903. /**
  4904. * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
  4905. *
  4906. * Example:
  4907. *
  4908. * ```ts
  4909. * const COUNTER_KEY = makeStateKey<number>('counter');
  4910. * let value = 10;
  4911. *
  4912. * transferState.set(COUNTER_KEY, value);
  4913. * ```
  4914. *
  4915. * @publicApi
  4916. */
  4917. declare function makeStateKey<T = void>(key: string): StateKey<T>;
  4918. /**
  4919. * A key value store that is transferred from the application on the server side to the application
  4920. * on the client side.
  4921. *
  4922. * The `TransferState` is available as an injectable token.
  4923. * On the client, just inject this token using DI and use it, it will be lazily initialized.
  4924. * On the server it's already included if `renderApplication` function is used. Otherwise, import
  4925. * the `ServerTransferStateModule` module to make the `TransferState` available.
  4926. *
  4927. * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
  4928. * boolean, number, string, null and non-class objects will be serialized and deserialized in a
  4929. * non-lossy manner.
  4930. *
  4931. * @publicApi
  4932. */
  4933. declare class TransferState {
  4934. /** @nocollapse */
  4935. static ɵprov: unknown;
  4936. private onSerializeCallbacks;
  4937. /**
  4938. * Get the value corresponding to a key. Return `defaultValue` if key is not found.
  4939. */
  4940. get<T>(key: StateKey<T>, defaultValue: T): T;
  4941. /**
  4942. * Set the value corresponding to a key.
  4943. */
  4944. set<T>(key: StateKey<T>, value: T): void;
  4945. /**
  4946. * Remove a key from the store.
  4947. */
  4948. remove<T>(key: StateKey<T>): void;
  4949. /**
  4950. * Test whether a key exists in the store.
  4951. */
  4952. hasKey<T>(key: StateKey<T>): boolean;
  4953. /**
  4954. * Indicates whether the state is empty.
  4955. */
  4956. get isEmpty(): boolean;
  4957. /**
  4958. * Register a callback to provide the value for a key when `toJson` is called.
  4959. */
  4960. onSerialize<T>(key: StateKey<T>, callback: () => T): void;
  4961. /**
  4962. * Serialize the current state of the store to JSON.
  4963. */
  4964. toJson(): string;
  4965. }
  4966. /**
  4967. * Marker used in a comment node to ensure hydration content integrity
  4968. */
  4969. declare const SSR_CONTENT_INTEGRITY_MARKER = "nghm";
  4970. /**
  4971. * Internal type that represents a claimed node.
  4972. * Only used in dev mode.
  4973. */
  4974. declare enum HydrationStatus {
  4975. Hydrated = "hydrated",
  4976. Skipped = "skipped",
  4977. Mismatched = "mismatched"
  4978. }
  4979. type HydrationInfo = {
  4980. status: HydrationStatus.Hydrated | HydrationStatus.Skipped;
  4981. } | {
  4982. status: HydrationStatus.Mismatched;
  4983. actualNodeDetails: string | null;
  4984. expectedNodeDetails: string | null;
  4985. };
  4986. declare const HYDRATION_INFO_KEY = "__ngDebugHydrationInfo__";
  4987. type HydratedNode = {
  4988. [HYDRATION_INFO_KEY]?: HydrationInfo;
  4989. } & Element;
  4990. declare function readHydrationInfo(node: RNode): HydrationInfo | null;
  4991. /**
  4992. * Annotates all components bootstrapped in a given ApplicationRef
  4993. * with info needed for hydration.
  4994. *
  4995. * @param appRef An instance of an ApplicationRef.
  4996. * @param doc A reference to the current Document instance.
  4997. * @return event types that need to be replayed
  4998. */
  4999. declare function annotateForHydration(appRef: ApplicationRef, doc: Document): {
  5000. regular: Set<string>;
  5001. capture: Set<string>;
  5002. };
  5003. /**
  5004. * Defines a name of an attribute that is added to the <body> tag
  5005. * in the `index.html` file in case a given route was configured
  5006. * with `RenderMode.Client`. 'cm' is an abbreviation for "Client Mode".
  5007. */
  5008. declare const CLIENT_RENDER_MODE_FLAG = "ngcm";
  5009. /**
  5010. * Returns a set of providers required to setup hydration support
  5011. * for an application that is server side rendered. This function is
  5012. * included into the `provideClientHydration` public API function from
  5013. * the `platform-browser` package.
  5014. *
  5015. * The function sets up an internal flag that would be recognized during
  5016. * the server side rendering time as well, so there is no need to
  5017. * configure or change anything in NgUniversal to enable the feature.
  5018. */
  5019. declare function withDomHydration(): EnvironmentProviders;
  5020. /**
  5021. * Returns a set of providers required to setup support for i18n hydration.
  5022. * Requires hydration to be enabled separately.
  5023. */
  5024. declare function withI18nSupport(): Provider[];
  5025. /**
  5026. * Returns a set of providers required to setup support for incremental hydration.
  5027. * Requires hydration to be enabled separately.
  5028. * Enabling incremental hydration also enables event replay for the entire app.
  5029. */
  5030. declare function withIncrementalHydration(): Provider[];
  5031. /**
  5032. * Returns a set of providers required to setup support for event replay.
  5033. * Requires hydration to be enabled separately.
  5034. */
  5035. declare function withEventReplay(): Provider[];
  5036. /**
  5037. * Internal token that specifies whether DOM reuse logic
  5038. * during hydration is enabled.
  5039. */
  5040. declare const IS_HYDRATION_DOM_REUSE_ENABLED: InjectionToken<boolean>;
  5041. /**
  5042. * Internal token that indicates whether incremental hydration support
  5043. * is enabled.
  5044. */
  5045. declare const IS_INCREMENTAL_HYDRATION_ENABLED: InjectionToken<boolean>;
  5046. /**
  5047. * A map of DOM elements with `jsaction` attributes grouped by action names.
  5048. */
  5049. declare const JSACTION_BLOCK_ELEMENT_MAP: InjectionToken<Map<string, Set<Element>>>;
  5050. /**
  5051. * Register locale data to be used internally by Angular. See the
  5052. * ["I18n guide"](guide/i18n/format-data-locale) to know how to import additional locale
  5053. * data.
  5054. *
  5055. * The signature `registerLocaleData(data: any, extraData?: any)` is deprecated since v5.1
  5056. */
  5057. declare function registerLocaleData(data: any, localeId?: string | any, extraData?: any): void;
  5058. /**
  5059. * Finds the locale data for a given locale.
  5060. *
  5061. * @param locale The locale code.
  5062. * @returns The locale data.
  5063. * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
  5064. */
  5065. declare function findLocaleData(locale: string): any;
  5066. /**
  5067. * Retrieves the default currency code for the given locale.
  5068. *
  5069. * The default is defined as the first currency which is still in use.
  5070. *
  5071. * @param locale The code of the locale whose currency code we want.
  5072. * @returns The code of the default currency for the given locale.
  5073. *
  5074. */
  5075. declare function getLocaleCurrencyCode(locale: string): string | null;
  5076. /**
  5077. * Retrieves the plural function used by ICU expressions to determine the plural case to use
  5078. * for a given locale.
  5079. * @param locale A locale code for the locale format rules to use.
  5080. * @returns The plural function for the locale.
  5081. * @see {@link NgPlural}
  5082. * @see [Internationalization (i18n) Guide](guide/i18n)
  5083. */
  5084. declare function getLocalePluralCase(locale: string): (value: number) => number;
  5085. /**
  5086. * Helper function to remove all the locale data from `LOCALE_DATA`.
  5087. */
  5088. declare function unregisterAllLocaleData(): void;
  5089. /**
  5090. * Index of each type of locale data from the locale data array
  5091. */
  5092. declare enum LocaleDataIndex {
  5093. LocaleId = 0,
  5094. DayPeriodsFormat = 1,
  5095. DayPeriodsStandalone = 2,
  5096. DaysFormat = 3,
  5097. DaysStandalone = 4,
  5098. MonthsFormat = 5,
  5099. MonthsStandalone = 6,
  5100. Eras = 7,
  5101. FirstDayOfWeek = 8,
  5102. WeekendRange = 9,
  5103. DateFormat = 10,
  5104. TimeFormat = 11,
  5105. DateTimeFormat = 12,
  5106. NumberSymbols = 13,
  5107. NumberFormats = 14,
  5108. CurrencyCode = 15,
  5109. CurrencySymbol = 16,
  5110. CurrencyName = 17,
  5111. Currencies = 18,
  5112. Directionality = 19,
  5113. PluralCase = 20,
  5114. ExtraData = 21
  5115. }
  5116. /**
  5117. * Index of each type of locale data from the extra locale data array
  5118. */
  5119. declare const enum ExtraLocaleDataIndex {
  5120. ExtraDayPeriodFormats = 0,
  5121. ExtraDayPeriodStandalone = 1,
  5122. ExtraDayPeriodsRules = 2
  5123. }
  5124. /**
  5125. * Index of each value in currency data (used to describe CURRENCIES_EN in currencies.ts)
  5126. */
  5127. declare const enum CurrencyIndex {
  5128. Symbol = 0,
  5129. SymbolNarrow = 1,
  5130. NbOfDigits = 2
  5131. }
  5132. /**
  5133. * The locale id that the application is using by default (for translations and ICU expressions).
  5134. */
  5135. declare const DEFAULT_LOCALE_ID = "en-US";
  5136. /**
  5137. * Used to resolve resource URLs on `@Component` when used with JIT compilation.
  5138. *
  5139. * Example:
  5140. * ```ts
  5141. * @Component({
  5142. * selector: 'my-comp',
  5143. * templateUrl: 'my-comp.html', // This requires asynchronous resolution
  5144. * })
  5145. * class MyComponent{
  5146. * }
  5147. *
  5148. * // Calling `renderComponent` will fail because `renderComponent` is a synchronous process
  5149. * // and `MyComponent`'s `@Component.templateUrl` needs to be resolved asynchronously.
  5150. *
  5151. * // Calling `resolveComponentResources()` will resolve `@Component.templateUrl` into
  5152. * // `@Component.template`, which allows `renderComponent` to proceed in a synchronous manner.
  5153. *
  5154. * // Use browser's `fetch()` function as the default resource resolution strategy.
  5155. * resolveComponentResources(fetch).then(() => {
  5156. * // After resolution all URLs have been converted into `template` strings.
  5157. * renderComponent(MyComponent);
  5158. * });
  5159. *
  5160. * ```
  5161. *
  5162. * NOTE: In AOT the resolution happens during compilation, and so there should be no need
  5163. * to call this method outside JIT mode.
  5164. *
  5165. * @param resourceResolver a function which is responsible for returning a `Promise` to the
  5166. * contents of the resolved URL. Browser's `fetch()` method is a good default implementation.
  5167. */
  5168. declare function resolveComponentResources(resourceResolver: (url: string) => Promise<string | {
  5169. text(): Promise<string>;
  5170. }>): Promise<void>;
  5171. declare function isComponentDefPendingResolution(type: Type$1<any>): boolean;
  5172. declare function clearResolutionOfComponentResourcesQueue(): Map<Type$1<any>, Component>;
  5173. declare function restoreComponentResolutionQueue(queue: Map<Type$1<any>, Component>): void;
  5174. /**
  5175. * InjectionToken to control root component bootstrap behavior.
  5176. *
  5177. * This token is primarily used in Angular's server-side rendering (SSR) scenarios,
  5178. * particularly by the `@angular/ssr` package, to manage whether the root component
  5179. * should be bootstrapped during the application initialization process.
  5180. *
  5181. * ## Purpose:
  5182. * During SSR route extraction, setting this token to `false` prevents Angular from
  5183. * bootstrapping the root component. This avoids unnecessary component rendering,
  5184. * enabling route extraction without requiring additional APIs or triggering
  5185. * component logic.
  5186. *
  5187. * ## Behavior:
  5188. * - **`false`**: Prevents the root component from being bootstrapped.
  5189. * - **`true`** (default): Proceeds with the normal root component bootstrap process.
  5190. *
  5191. * This mechanism ensures SSR can efficiently separate route extraction logic
  5192. * from component rendering.
  5193. */
  5194. declare const ENABLE_ROOT_COMPONENT_BOOTSTRAP: InjectionToken<boolean>;
  5195. interface PlatformReflectionCapabilities {
  5196. factory(type: Type$1<any>): Function;
  5197. hasLifecycleHook(type: any, lcProperty: string): boolean;
  5198. /**
  5199. * Return a list of annotations/types for constructor parameters
  5200. */
  5201. parameters(type: Type$1<any>): any[][];
  5202. /**
  5203. * Return a list of annotations declared on the class
  5204. */
  5205. annotations(type: Type$1<any>): any[];
  5206. /**
  5207. * Return a object literal which describes the annotations on Class fields/properties.
  5208. */
  5209. propMetadata(typeOrFunc: Type$1<any>): {
  5210. [key: string]: any[];
  5211. };
  5212. }
  5213. declare class ReflectionCapabilities implements PlatformReflectionCapabilities {
  5214. private _reflect;
  5215. constructor(reflect?: any);
  5216. factory<T>(t: Type$1<T>): (args: any[]) => T;
  5217. private _ownParameters;
  5218. parameters(type: Type$1<any>): any[][];
  5219. private _ownAnnotations;
  5220. annotations(typeOrFunc: Type$1<any>): any[];
  5221. private _ownPropMetadata;
  5222. propMetadata(typeOrFunc: any): {
  5223. [key: string]: any[];
  5224. };
  5225. ownPropMetadata(typeOrFunc: any): {
  5226. [key: string]: any[];
  5227. };
  5228. hasLifecycleHook(type: any, lcProperty: string): boolean;
  5229. }
  5230. /**
  5231. * An object that defines an injection context for the injector profiler.
  5232. */
  5233. interface InjectorProfilerContext {
  5234. /**
  5235. * The Injector that service is being injected into.
  5236. * - Example: if ModuleA --provides--> ServiceA --injects--> ServiceB
  5237. * then inject(ServiceB) in ServiceA has ModuleA as an injector context
  5238. */
  5239. injector: Injector;
  5240. /**
  5241. * The class where the constructor that is calling `inject` is located
  5242. * - Example: if ModuleA --provides--> ServiceA --injects--> ServiceB
  5243. * then inject(ServiceB) in ServiceA has ServiceA as a construction context
  5244. */
  5245. token: Type$1<unknown> | null;
  5246. }
  5247. /**
  5248. * An object that contains information about a provider that has been configured
  5249. *
  5250. * TODO: rename to indicate that it is a debug structure eg. ProviderDebugInfo.
  5251. */
  5252. interface ProviderRecord {
  5253. /**
  5254. * DI token that this provider is configuring
  5255. */
  5256. token: Type$1<unknown> | InjectionToken<unknown>;
  5257. /**
  5258. * Determines if provider is configured as view provider.
  5259. */
  5260. isViewProvider: boolean;
  5261. /**
  5262. * The raw provider associated with this ProviderRecord.
  5263. */
  5264. provider: SingleProvider;
  5265. /**
  5266. * The path of DI containers that were followed to import this provider
  5267. */
  5268. importPath?: Type$1<unknown>[];
  5269. }
  5270. /**
  5271. * An object that contains information a service that has been injected within an
  5272. * InjectorProfilerContext
  5273. */
  5274. interface InjectedService {
  5275. /**
  5276. * DI token of the Service that is injected
  5277. */
  5278. token?: Type$1<unknown> | InjectionToken<unknown>;
  5279. /**
  5280. * Value of the injected service
  5281. */
  5282. value: unknown;
  5283. /**
  5284. * Flags that this service was injected with
  5285. */
  5286. flags?: InternalInjectFlags | InjectOptions;
  5287. /**
  5288. * Injector that this service was provided in.
  5289. */
  5290. providedIn?: Injector;
  5291. /**
  5292. * In NodeInjectors, the LView and TNode that serviced this injection.
  5293. */
  5294. injectedIn?: {
  5295. lView: LView;
  5296. tNode: TNode;
  5297. };
  5298. }
  5299. declare function setInjectorProfilerContext(context: InjectorProfilerContext): InjectorProfilerContext;
  5300. declare const enum BypassType {
  5301. Url = "URL",
  5302. Html = "HTML",
  5303. ResourceUrl = "ResourceURL",
  5304. Script = "Script",
  5305. Style = "Style"
  5306. }
  5307. /**
  5308. * Marker interface for a value that's safe to use in a particular context.
  5309. *
  5310. * @publicApi
  5311. */
  5312. interface SafeValue {
  5313. }
  5314. /**
  5315. * Marker interface for a value that's safe to use as HTML.
  5316. *
  5317. * @publicApi
  5318. */
  5319. interface SafeHtml extends SafeValue {
  5320. }
  5321. /**
  5322. * Marker interface for a value that's safe to use as style (CSS).
  5323. *
  5324. * @publicApi
  5325. */
  5326. interface SafeStyle extends SafeValue {
  5327. }
  5328. /**
  5329. * Marker interface for a value that's safe to use as JavaScript.
  5330. *
  5331. * @publicApi
  5332. */
  5333. interface SafeScript extends SafeValue {
  5334. }
  5335. /**
  5336. * Marker interface for a value that's safe to use as a URL linking to a document.
  5337. *
  5338. * @publicApi
  5339. */
  5340. interface SafeUrl extends SafeValue {
  5341. }
  5342. /**
  5343. * Marker interface for a value that's safe to use as a URL to load executable code from.
  5344. *
  5345. * @publicApi
  5346. */
  5347. interface SafeResourceUrl extends SafeValue {
  5348. }
  5349. declare function unwrapSafeValue(value: SafeValue): string;
  5350. declare function unwrapSafeValue<T>(value: T): T;
  5351. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Html): value is SafeHtml;
  5352. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.ResourceUrl): value is SafeResourceUrl;
  5353. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Script): value is SafeScript;
  5354. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Style): value is SafeStyle;
  5355. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType.Url): value is SafeUrl;
  5356. declare function allowSanitizationBypassAndThrow(value: any, type: BypassType): boolean;
  5357. declare function getSanitizationBypassType(value: any): BypassType | null;
  5358. /**
  5359. * Mark `html` string as trusted.
  5360. *
  5361. * This function wraps the trusted string in `String` and brands it in a way which makes it
  5362. * recognizable to {@link htmlSanitizer} to be trusted implicitly.
  5363. *
  5364. * @param trustedHtml `html` string which needs to be implicitly trusted.
  5365. * @returns a `html` which has been branded to be implicitly trusted.
  5366. */
  5367. declare function bypassSanitizationTrustHtml(trustedHtml: string): SafeHtml;
  5368. /**
  5369. * Mark `style` string as trusted.
  5370. *
  5371. * This function wraps the trusted string in `String` and brands it in a way which makes it
  5372. * recognizable to {@link styleSanitizer} to be trusted implicitly.
  5373. *
  5374. * @param trustedStyle `style` string which needs to be implicitly trusted.
  5375. * @returns a `style` hich has been branded to be implicitly trusted.
  5376. */
  5377. declare function bypassSanitizationTrustStyle(trustedStyle: string): SafeStyle;
  5378. /**
  5379. * Mark `script` string as trusted.
  5380. *
  5381. * This function wraps the trusted string in `String` and brands it in a way which makes it
  5382. * recognizable to {@link scriptSanitizer} to be trusted implicitly.
  5383. *
  5384. * @param trustedScript `script` string which needs to be implicitly trusted.
  5385. * @returns a `script` which has been branded to be implicitly trusted.
  5386. */
  5387. declare function bypassSanitizationTrustScript(trustedScript: string): SafeScript;
  5388. /**
  5389. * Mark `url` string as trusted.
  5390. *
  5391. * This function wraps the trusted string in `String` and brands it in a way which makes it
  5392. * recognizable to {@link urlSanitizer} to be trusted implicitly.
  5393. *
  5394. * @param trustedUrl `url` string which needs to be implicitly trusted.
  5395. * @returns a `url` which has been branded to be implicitly trusted.
  5396. */
  5397. declare function bypassSanitizationTrustUrl(trustedUrl: string): SafeUrl;
  5398. /**
  5399. * Mark `url` string as trusted.
  5400. *
  5401. * This function wraps the trusted string in `String` and brands it in a way which makes it
  5402. * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.
  5403. *
  5404. * @param trustedResourceUrl `url` string which needs to be implicitly trusted.
  5405. * @returns a `url` which has been branded to be implicitly trusted.
  5406. */
  5407. declare function bypassSanitizationTrustResourceUrl(trustedResourceUrl: string): SafeResourceUrl;
  5408. /**
  5409. * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to
  5410. * the DOM in a browser environment.
  5411. */
  5412. declare function _sanitizeHtml(defaultDoc: any, unsafeHtmlInput: string): TrustedHTML | string;
  5413. declare function _sanitizeUrl(url: string): string;
  5414. /**
  5415. * Transforms a value (typically a string) to a boolean.
  5416. * Intended to be used as a transform function of an input.
  5417. *
  5418. * @usageNotes
  5419. * ```ts
  5420. * status = input({ transform: booleanAttribute });
  5421. * ```
  5422. * @param value Value to be transformed.
  5423. *
  5424. * @publicApi
  5425. */
  5426. declare function booleanAttribute(value: unknown): boolean;
  5427. /**
  5428. * Transforms a value (typically a string) to a number.
  5429. * Intended to be used as a transform function of an input.
  5430. * @param value Value to be transformed.
  5431. * @param fallbackValue Value to use if the provided value can't be parsed as a number.
  5432. *
  5433. * @usageNotes
  5434. * ```ts
  5435. * status = input({ transform: numberAttribute });
  5436. * ```
  5437. *
  5438. * @publicApi
  5439. */
  5440. declare function numberAttribute(value: unknown, fallbackValue?: number): number;
  5441. declare const _global: any;
  5442. /**
  5443. * Determine if the argument is shaped like a Promise
  5444. */
  5445. declare function isPromise<T = any>(obj: any): obj is Promise<T>;
  5446. /**
  5447. * Determine if the argument is a Subscribable
  5448. */
  5449. declare function isSubscribable<T>(obj: any | Subscribable<T>): obj is Subscribable<T>;
  5450. /**
  5451. * A guarded `performance.mark` for feature marking.
  5452. *
  5453. * This method exists because while all supported browser and node.js version supported by Angular
  5454. * support performance.mark API. This is not the case for other environments such as JSDOM and
  5455. * Cloudflare workers.
  5456. */
  5457. declare function performanceMarkFeature(feature: string): void;
  5458. declare function stringify(token: any): string;
  5459. /**
  5460. * Ellipses the string in the middle when longer than the max length
  5461. *
  5462. * @param string
  5463. * @param maxLength of the output string
  5464. * @returns ellipsed string with ... in the middle
  5465. */
  5466. declare function truncateMiddle(str: string, maxLength?: number): string;
  5467. declare const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR: {};
  5468. declare const PERFORMANCE_MARK_PREFIX = "\uD83C\uDD70\uFE0F";
  5469. /**
  5470. * Function that will start measuring against the performance API
  5471. * Should be used in pair with stopMeasuring
  5472. */
  5473. declare function startMeasuring<T>(label: string): void;
  5474. /**
  5475. * Function that will stop measuring against the performance API
  5476. * Should be used in pair with startMeasuring
  5477. */
  5478. declare function stopMeasuring(label: string): void;
  5479. /**
  5480. * This enables an internal performance profiler
  5481. *
  5482. * It should not be imported in application code
  5483. */
  5484. declare function enableProfiling(): void;
  5485. declare function disableProfiling(): void;
  5486. /**
  5487. * Constructs a `Resource` that projects a reactive request to an asynchronous operation defined by
  5488. * a loader function, which exposes the result of the loading operation via signals.
  5489. *
  5490. * Note that `resource` is intended for _read_ operations, not operations which perform mutations.
  5491. * `resource` will cancel in-progress loads via the `AbortSignal` when destroyed or when a new
  5492. * request object becomes available, which could prematurely abort mutations.
  5493. *
  5494. * @experimental 19.0
  5495. */
  5496. declare function resource<T, R>(options: ResourceOptions<T, R> & {
  5497. defaultValue: NoInfer<T>;
  5498. }): ResourceRef<T>;
  5499. /**
  5500. * Constructs a `Resource` that projects a reactive request to an asynchronous operation defined by
  5501. * a loader function, which exposes the result of the loading operation via signals.
  5502. *
  5503. * Note that `resource` is intended for _read_ operations, not operations which perform mutations.
  5504. * `resource` will cancel in-progress loads via the `AbortSignal` when destroyed or when a new
  5505. * request object becomes available, which could prematurely abort mutations.
  5506. *
  5507. * @experimental 19.0
  5508. */
  5509. declare function resource<T, R>(options: ResourceOptions<T, R>): ResourceRef<T | undefined>;
  5510. type WrappedRequest = {
  5511. request: unknown;
  5512. reload: number;
  5513. };
  5514. /**
  5515. * Base class which implements `.value` as a `WritableSignal` by delegating `.set` and `.update`.
  5516. */
  5517. declare abstract class BaseWritableResource<T> implements WritableResource<T> {
  5518. readonly value: WritableSignal<T>;
  5519. abstract readonly status: Signal<ResourceStatus>;
  5520. abstract readonly error: Signal<Error | undefined>;
  5521. abstract reload(): boolean;
  5522. constructor(value: Signal<T>);
  5523. abstract set(value: T): void;
  5524. private readonly isError;
  5525. update(updateFn: (value: T) => T): void;
  5526. readonly isLoading: Signal<boolean>;
  5527. hasValue(): this is ResourceRef<Exclude<T, undefined>>;
  5528. asReadonly(): Resource<T>;
  5529. }
  5530. /**
  5531. * Implementation for `resource()` which uses a `linkedSignal` to manage the resource's state.
  5532. */
  5533. declare class ResourceImpl<T, R> extends BaseWritableResource<T> implements ResourceRef<T> {
  5534. private readonly loaderFn;
  5535. private readonly equal;
  5536. private readonly pendingTasks;
  5537. /**
  5538. * The current state of the resource. Status, value, and error are derived from this.
  5539. */
  5540. private readonly state;
  5541. /**
  5542. * Combines the current request with a reload counter which allows the resource to be reloaded on
  5543. * imperative command.
  5544. */
  5545. protected readonly extRequest: WritableSignal<WrappedRequest>;
  5546. private readonly effectRef;
  5547. private pendingController;
  5548. private resolvePendingTask;
  5549. private destroyed;
  5550. private unregisterOnDestroy;
  5551. constructor(request: () => R, loaderFn: ResourceStreamingLoader<T, R>, defaultValue: T, equal: ValueEqualityFn$1<T> | undefined, injector: Injector, throwErrorsFromValue?: boolean);
  5552. readonly status: Signal<ResourceStatus>;
  5553. readonly error: Signal<Error | undefined>;
  5554. /**
  5555. * Called either directly via `WritableResource.set` or via `.value.set()`.
  5556. */
  5557. set(value: T): void;
  5558. reload(): boolean;
  5559. destroy(): void;
  5560. private loadEffect;
  5561. private abortInProgressLoad;
  5562. }
  5563. declare function encapsulateResourceError(error: unknown): Error;
  5564. /*!
  5565. * @license
  5566. * Copyright Google LLC All Rights Reserved.
  5567. *
  5568. * Use of this source code is governed by an MIT-style license that can be
  5569. * found in the LICENSE file at https://angular.dev/license
  5570. */
  5571. /**
  5572. * Gets the class name of the closest component to a node.
  5573. * Warning! this function will return minified names if the name of the component is minified. The
  5574. * consumer of the function is responsible for resolving the minified name to its original name.
  5575. * @param node Node from which to start the search.
  5576. */
  5577. declare function getClosestComponentName(node: Node): string | null;
  5578. /**
  5579. * The following getter methods retrieve the definition from the type. Currently the retrieval
  5580. * honors inheritance, but in the future we may change the rule to require that definitions are
  5581. * explicit. This would require some sort of migration strategy.
  5582. */
  5583. declare function getComponentDef<T>(type: any): ComponentDef<T> | null;
  5584. /**
  5585. * Checks whether a given Component, Directive or Pipe is marked as standalone.
  5586. * This will return false if passed anything other than a Component, Directive, or Pipe class
  5587. * See [this guide](guide/components/importing) for additional information:
  5588. *
  5589. * @param type A reference to a Component, Directive or Pipe.
  5590. * @publicApi
  5591. */
  5592. declare function isStandalone(type: Type$1<unknown>): boolean;
  5593. /**
  5594. * TODO(incremental-hydration): Remove this file entirely once PromiseWithResolvers lands in stable
  5595. * node / TS.
  5596. */
  5597. interface PromiseWithResolvers<T> {
  5598. promise: Promise<T>;
  5599. resolve: (value: T | PromiseLike<T>) => void;
  5600. reject: (reason?: any) => void;
  5601. }
  5602. /**
  5603. * An internal injection token to reference `DehydratedBlockRegistry` implementation
  5604. * in a tree-shakable way.
  5605. */
  5606. declare const DEHYDRATED_BLOCK_REGISTRY: InjectionToken<DehydratedBlockRegistry>;
  5607. /**
  5608. * The DehydratedBlockRegistry is used for incremental hydration purposes. It keeps
  5609. * track of the Defer Blocks that need hydration so we can effectively
  5610. * navigate up to the top dehydrated defer block and fire appropriate cleanup
  5611. * functions post hydration.
  5612. */
  5613. declare class DehydratedBlockRegistry {
  5614. private registry;
  5615. private cleanupFns;
  5616. private jsActionMap;
  5617. private contract;
  5618. add(blockId: string, info: DehydratedDeferBlock): void;
  5619. get(blockId: string): DehydratedDeferBlock | null;
  5620. has(blockId: string): boolean;
  5621. cleanup(hydratedBlocks: string[]): void;
  5622. get size(): number;
  5623. addCleanupFn(blockId: string, fn: Function): void;
  5624. invokeTriggerCleanupFns(blockId: string): void;
  5625. hydrating: Map<string, PromiseWithResolvers<void>>;
  5626. private awaitingCallbacks;
  5627. awaitParentBlock(topmostParentBlock: string, callback: Function): void;
  5628. /** @nocollapse */
  5629. static ɵprov: unknown;
  5630. }
  5631. /**
  5632. * Helper service to schedule `setTimeout`s for batches of defer blocks,
  5633. * to avoid calling `setTimeout` for each defer block (e.g. if defer blocks
  5634. * are created inside a for loop).
  5635. */
  5636. declare class TimerScheduler {
  5637. executingCallbacks: boolean;
  5638. timeoutId: number | null;
  5639. invokeTimerAt: number | null;
  5640. current: Array<number | VoidFunction>;
  5641. deferred: Array<number | VoidFunction>;
  5642. add(delay: number, callback: VoidFunction, ngZone: NgZone): void;
  5643. remove(callback: VoidFunction): void;
  5644. private addToQueue;
  5645. private removeFromQueue;
  5646. private scheduleTimer;
  5647. private clearTimeout;
  5648. ngOnDestroy(): void;
  5649. /** @nocollapse */
  5650. static ɵprov: unknown;
  5651. }
  5652. declare function compileNgModuleFactory<M>(injector: Injector, options: CompilerOptions, moduleType: Type$1<M>): Promise<NgModuleFactory$1<M>>;
  5653. /**
  5654. * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.
  5655. */
  5656. declare function createInjector(defType: any, parent?: Injector | null, additionalProviders?: Array<Provider | StaticProvider> | null, name?: string): Injector;
  5657. /**
  5658. * Adds the given NgModule type to Angular's NgModule registry.
  5659. *
  5660. * This is generated as a side-effect of NgModule compilation. Note that the `id` is passed in
  5661. * explicitly and not read from the NgModule definition. This is for two reasons: it avoids a
  5662. * megamorphic read, and in JIT there's a chicken-and-egg problem where the NgModule may not be
  5663. * fully resolved when it's registered.
  5664. *
  5665. * @codeGenApi
  5666. */
  5667. declare function registerNgModuleType(ngModuleType: NgModuleType, id: string): void;
  5668. /**
  5669. * Control whether the NgModule registration system enforces that each NgModule type registered has
  5670. * a unique id.
  5671. *
  5672. * This is useful for testing as the NgModule registry cannot be properly reset between tests with
  5673. * Angular's current API.
  5674. */
  5675. declare function setAllowDuplicateNgModuleIdsForTest(allowDuplicates: boolean): void;
  5676. /**
  5677. * The internal view context which is specific to a given DOM element, directive or
  5678. * component instance. Each value in here (besides the LView and element node details)
  5679. * can be present, null or undefined. If undefined then it implies the value has not been
  5680. * looked up yet, otherwise, if null, then a lookup was executed and nothing was found.
  5681. *
  5682. * Each value will get filled when the respective value is examined within the getContext
  5683. * function. The component, element and each directive instance will share the same instance
  5684. * of the context.
  5685. */
  5686. declare class LContext {
  5687. /**
  5688. * ID of the component's parent view data.
  5689. */
  5690. private lViewId;
  5691. /**
  5692. * The index instance of the node.
  5693. */
  5694. nodeIndex: number;
  5695. /**
  5696. * The instance of the DOM node that is attached to the lNode.
  5697. */
  5698. native: RNode;
  5699. /**
  5700. * The instance of the Component node.
  5701. */
  5702. component: {} | null | undefined;
  5703. /**
  5704. * The list of active directives that exist on this element.
  5705. */
  5706. directives: any[] | null | undefined;
  5707. /**
  5708. * The map of local references (local reference name => element or directive instance) that
  5709. * exist on this element.
  5710. */
  5711. localRefs: {
  5712. [key: string]: any;
  5713. } | null | undefined;
  5714. /** Component's parent view data. */
  5715. get lView(): LView | null;
  5716. constructor(
  5717. /**
  5718. * ID of the component's parent view data.
  5719. */
  5720. lViewId: number,
  5721. /**
  5722. * The index instance of the node.
  5723. */
  5724. nodeIndex: number,
  5725. /**
  5726. * The instance of the DOM node that is attached to the lNode.
  5727. */
  5728. native: RNode);
  5729. }
  5730. /**
  5731. * Returns the matching `LContext` data for a given DOM node, directive or component instance.
  5732. *
  5733. * This function will examine the provided DOM element, component, or directive instance\'s
  5734. * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched
  5735. * value will be that of the newly created `LContext`.
  5736. *
  5737. * If the monkey-patched value is the `LView` instance then the context value for that
  5738. * target will be created and the monkey-patch reference will be updated. Therefore when this
  5739. * function is called it may mutate the provided element\'s, component\'s or any of the associated
  5740. * directive\'s monkey-patch values.
  5741. *
  5742. * If the monkey-patch value is not detected then the code will walk up the DOM until an element
  5743. * is found which contains a monkey-patch reference. When that occurs then the provided element
  5744. * will be updated with a new context (which is then returned). If the monkey-patch value is not
  5745. * detected for a component/directive instance then it will throw an error (all components and
  5746. * directives should be automatically monkey-patched by ivy).
  5747. *
  5748. * @param target Component, Directive or DOM Node.
  5749. */
  5750. declare function getLContext(target: any): LContext | null;
  5751. declare const NG_COMP_DEF: string;
  5752. declare const NG_DIR_DEF: string;
  5753. declare const NG_PIPE_DEF: string;
  5754. declare const NG_MOD_DEF: string;
  5755. /**
  5756. * If a directive is diPublic, bloomAdd sets a property on the type with this constant as
  5757. * the key and the directive's unique ID as the value. This allows us to map directives to their
  5758. * bloom filter bit for DI.
  5759. */
  5760. declare const NG_ELEMENT_ID: string;
  5761. /**
  5762. * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
  5763. * definition.
  5764. *
  5765. * This exists primarily to support ngcc migration of an existing View Engine pattern, where an
  5766. * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
  5767. * generates a skeleton definition on the child class, and applies this feature.
  5768. *
  5769. * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
  5770. * including things like the component template function.
  5771. *
  5772. * @param definition The definition of a child class which inherits from a parent class with its
  5773. * own definition.
  5774. *
  5775. * @codeGenApi
  5776. */
  5777. declare function ɵɵCopyDefinitionFeature(definition: DirectiveDef<any> | ComponentDef<any>): void;
  5778. /**
  5779. * This feature adds the host directives behavior to a directive definition by patching a
  5780. * function onto it. The expectation is that the runtime will invoke the function during
  5781. * directive matching.
  5782. *
  5783. * For example:
  5784. * ```ts
  5785. * class ComponentWithHostDirective {
  5786. * static ɵcmp = defineComponent({
  5787. * type: ComponentWithHostDirective,
  5788. * features: [ɵɵHostDirectivesFeature([
  5789. * SimpleHostDirective,
  5790. * {directive: AdvancedHostDirective, inputs: ['foo: alias'], outputs: ['bar']},
  5791. * ])]
  5792. * });
  5793. * }
  5794. * ```
  5795. *
  5796. * @codeGenApi
  5797. */
  5798. declare function ɵɵHostDirectivesFeature(rawHostDirectives: HostDirectiveConfig[] | (() => HostDirectiveConfig[])): DirectiveDefFeature;
  5799. /**
  5800. * Merges the definition from a super class to a sub class.
  5801. * @param definition The definition that is a SubClass of another directive of component
  5802. *
  5803. * @codeGenApi
  5804. */
  5805. declare function ɵɵInheritDefinitionFeature(definition: DirectiveDef<any> | ComponentDef<any>): void;
  5806. /**
  5807. * The NgOnChangesFeature decorates a component with support for the ngOnChanges
  5808. * lifecycle hook, so it should be included in any component that implements
  5809. * that hook.
  5810. *
  5811. * If the component or directive uses inheritance, the NgOnChangesFeature MUST
  5812. * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise
  5813. * inherited properties will not be propagated to the ngOnChanges lifecycle
  5814. * hook.
  5815. *
  5816. * Example usage:
  5817. *
  5818. * ```ts
  5819. * static ɵcmp = defineComponent({
  5820. * ...
  5821. * inputs: {name: 'publicName'},
  5822. * features: [NgOnChangesFeature]
  5823. * });
  5824. * ```
  5825. *
  5826. * @codeGenApi
  5827. */
  5828. declare const ɵɵNgOnChangesFeature: () => DirectiveDefFeature;
  5829. /**
  5830. * This feature resolves the providers of a directive (or component),
  5831. * and publish them into the DI system, making it visible to others for injection.
  5832. *
  5833. * For example:
  5834. * ```ts
  5835. * class ComponentWithProviders {
  5836. * constructor(private greeter: GreeterDE) {}
  5837. *
  5838. * static ɵcmp = defineComponent({
  5839. * type: ComponentWithProviders,
  5840. * selectors: [['component-with-providers']],
  5841. * factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)),
  5842. * decls: 1,
  5843. * vars: 1,
  5844. * template: function(fs: RenderFlags, ctx: ComponentWithProviders) {
  5845. * if (fs & RenderFlags.Create) {
  5846. * ɵɵtext(0);
  5847. * }
  5848. * if (fs & RenderFlags.Update) {
  5849. * ɵɵtextInterpolate(ctx.greeter.greet());
  5850. * }
  5851. * },
  5852. * features: [ɵɵProvidersFeature([GreeterDE])]
  5853. * });
  5854. * }
  5855. * ```
  5856. *
  5857. * @param definition
  5858. *
  5859. * @codeGenApi
  5860. */
  5861. declare function ɵɵProvidersFeature<T>(providers: Provider[], viewProviders?: Provider[]): (definition: DirectiveDef<T>) => void;
  5862. /**
  5863. * A feature that adds support for external runtime styles for a component.
  5864. * An external runtime style is a URL to a CSS stylesheet that contains the styles
  5865. * for a given component. For browsers, this URL will be used in an appended `link` element
  5866. * when the component is rendered. This feature is typically used for Hot Module Replacement
  5867. * (HMR) of component stylesheets by leveraging preexisting global stylesheet HMR available
  5868. * in most development servers.
  5869. *
  5870. * @codeGenApi
  5871. */
  5872. declare function ɵɵExternalStylesFeature(styleUrls: string[]): ComponentDefFeature;
  5873. /**
  5874. * Generated next to NgModules to monkey-patch directive and pipe references onto a component's
  5875. * definition, when generating a direct reference in the component file would otherwise create an
  5876. * import cycle.
  5877. *
  5878. * See [this explanation](https://hackmd.io/Odw80D0pR6yfsOjg_7XCJg?view) for more details.
  5879. *
  5880. * @codeGenApi
  5881. */
  5882. declare function ɵɵsetComponentScope(type: ComponentType<any>, directives: Type$1<any>[] | (() => Type$1<any>[]), pipes: Type$1<any>[] | (() => Type$1<any>[])): void;
  5883. /**
  5884. * Adds the module metadata that is necessary to compute the module's transitive scope to an
  5885. * existing module definition.
  5886. *
  5887. * Scope metadata of modules is not used in production builds, so calls to this function can be
  5888. * marked pure to tree-shake it from the bundle, allowing for all referenced declarations
  5889. * to become eligible for tree-shaking as well.
  5890. *
  5891. * @codeGenApi
  5892. */
  5893. declare function ɵɵsetNgModuleScope(type: any, scope: NgModuleScopeInfoFromDecorator): unknown;
  5894. /**
  5895. * Retrieves the component instance associated with a given DOM element.
  5896. *
  5897. * @usageNotes
  5898. * Given the following DOM structure:
  5899. *
  5900. * ```html
  5901. * <app-root>
  5902. * <div>
  5903. * <child-comp></child-comp>
  5904. * </div>
  5905. * </app-root>
  5906. * ```
  5907. *
  5908. * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
  5909. * associated with this DOM element.
  5910. *
  5911. * Calling the function on `<app-root>` will return the `MyApp` instance.
  5912. *
  5913. *
  5914. * @param element DOM element from which the component should be retrieved.
  5915. * @returns Component instance associated with the element or `null` if there
  5916. * is no component associated with it.
  5917. *
  5918. * @publicApi
  5919. */
  5920. declare function getComponent<T>(element: Element): T | null;
  5921. /**
  5922. * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
  5923. * view that the element is part of. Otherwise retrieves the instance of the component whose view
  5924. * owns the element (in this case, the result is the same as calling `getOwningComponent`).
  5925. *
  5926. * @param element Element for which to get the surrounding component instance.
  5927. * @returns Instance of the component that is around the element or null if the element isn't
  5928. * inside any component.
  5929. *
  5930. * @publicApi
  5931. */
  5932. declare function getContext<T extends {}>(element: Element): T | null;
  5933. /**
  5934. * Retrieves the component instance whose view contains the DOM element.
  5935. *
  5936. * For example, if `<child-comp>` is used in the template of `<app-comp>`
  5937. * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
  5938. * would return `<app-comp>`.
  5939. *
  5940. * @param elementOrDir DOM element, component or directive instance
  5941. * for which to retrieve the root components.
  5942. * @returns Component instance whose view owns the DOM element or null if the element is not
  5943. * part of a component view.
  5944. *
  5945. * @publicApi
  5946. */
  5947. declare function getOwningComponent<T>(elementOrDir: Element | {}): T | null;
  5948. /**
  5949. * Retrieves all root components associated with a DOM element, directive or component instance.
  5950. * Root components are those which have been bootstrapped by Angular.
  5951. *
  5952. * @param elementOrDir DOM element, component or directive instance
  5953. * for which to retrieve the root components.
  5954. * @returns Root components associated with the target object.
  5955. *
  5956. * @publicApi
  5957. */
  5958. declare function getRootComponents(elementOrDir: Element | {}): {}[];
  5959. /**
  5960. * Retrieves an `Injector` associated with an element, component or directive instance.
  5961. *
  5962. * @param elementOrDir DOM element, component or directive instance for which to
  5963. * retrieve the injector.
  5964. * @returns Injector associated with the element, component or directive instance.
  5965. *
  5966. * @publicApi
  5967. */
  5968. declare function getInjector(elementOrDir: Element | {}): Injector;
  5969. /**
  5970. * Retrieves directive instances associated with a given DOM node. Does not include
  5971. * component instances.
  5972. *
  5973. * @usageNotes
  5974. * Given the following DOM structure:
  5975. *
  5976. * ```html
  5977. * <app-root>
  5978. * <button my-button></button>
  5979. * <my-comp></my-comp>
  5980. * </app-root>
  5981. * ```
  5982. *
  5983. * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
  5984. * directive that is associated with the DOM node.
  5985. *
  5986. * Calling `getDirectives` on `<my-comp>` will return an empty array.
  5987. *
  5988. * @param node DOM node for which to get the directives.
  5989. * @returns Array of directives associated with the node.
  5990. *
  5991. * @publicApi
  5992. */
  5993. declare function getDirectives(node: Node): {}[];
  5994. /** The framework used to author a particular application or component. */
  5995. declare enum Framework {
  5996. Angular = "angular",
  5997. ACX = "acx",
  5998. Wiz = "wiz"
  5999. }
  6000. /** Metadata common to directives from all frameworks. */
  6001. interface BaseDirectiveDebugMetadata {
  6002. name?: string;
  6003. framework?: Framework;
  6004. }
  6005. /**
  6006. * Partial metadata for a given Angular directive instance.
  6007. *
  6008. * @publicApi
  6009. */
  6010. interface AngularDirectiveDebugMetadata extends BaseDirectiveDebugMetadata {
  6011. framework?: Framework.Angular;
  6012. inputs: Record<string, string>;
  6013. outputs: Record<string, string>;
  6014. }
  6015. /**
  6016. * Partial metadata for a given Angular component instance.
  6017. *
  6018. * @publicApi
  6019. */
  6020. interface AngularComponentDebugMetadata extends AngularDirectiveDebugMetadata {
  6021. encapsulation: ViewEncapsulation$1;
  6022. changeDetection: ChangeDetectionStrategy$1;
  6023. }
  6024. /** ACX change detection strategies. */
  6025. declare enum AcxChangeDetectionStrategy {
  6026. Default = 0,
  6027. OnPush = 1
  6028. }
  6029. /** ACX view encapsulation modes. */
  6030. declare enum AcxViewEncapsulation {
  6031. Emulated = 0,
  6032. None = 1
  6033. }
  6034. /** Partial metadata for a given ACX directive instance. */
  6035. interface AcxDirectiveDebugMetadata extends BaseDirectiveDebugMetadata {
  6036. framework: Framework.ACX;
  6037. inputs: Record<string, string>;
  6038. outputs: Record<string, string>;
  6039. }
  6040. /** Partial metadata for a given ACX component instance. */
  6041. interface AcxComponentDebugMetadata extends AcxDirectiveDebugMetadata {
  6042. changeDetection: AcxChangeDetectionStrategy;
  6043. encapsulation: AcxViewEncapsulation;
  6044. }
  6045. /** Partial metadata for a given Wiz component instance. */
  6046. interface WizComponentDebugMetadata extends BaseDirectiveDebugMetadata {
  6047. framework: Framework.Wiz;
  6048. props: Record<string, string>;
  6049. }
  6050. /** All potential debug metadata types across all frameworks. */
  6051. type DirectiveDebugMetadata = AngularDirectiveDebugMetadata | AcxDirectiveDebugMetadata | AngularComponentDebugMetadata | AcxComponentDebugMetadata | WizComponentDebugMetadata;
  6052. /**
  6053. * Returns the debug (partial) metadata for a particular directive or component instance.
  6054. * The function accepts an instance of a directive or component and returns the corresponding
  6055. * metadata.
  6056. *
  6057. * @param directiveOrComponentInstance Instance of a directive or component
  6058. * @returns metadata of the passed directive or component
  6059. *
  6060. * @publicApi
  6061. */
  6062. declare function getDirectiveMetadata(directiveOrComponentInstance: any): AngularComponentDebugMetadata | AngularDirectiveDebugMetadata | null;
  6063. /**
  6064. * Retrieves the host element of a component or directive instance.
  6065. * The host element is the DOM element that matched the selector of the directive.
  6066. *
  6067. * @param componentOrDirective Component or directive instance for which the host
  6068. * element should be retrieved.
  6069. * @returns Host element of the target.
  6070. *
  6071. * @publicApi
  6072. */
  6073. declare function getHostElement(componentOrDirective: {}): Element;
  6074. /**
  6075. * Event listener configuration returned from `getListeners`.
  6076. * @publicApi
  6077. */
  6078. interface Listener {
  6079. /** Name of the event listener. */
  6080. name: string;
  6081. /** Element that the listener is bound to. */
  6082. element: Element;
  6083. /** Callback that is invoked when the event is triggered. */
  6084. callback: (value: any) => any;
  6085. /** Whether the listener is using event capturing. */
  6086. useCapture: boolean;
  6087. /**
  6088. * Type of the listener (e.g. a native DOM event or a custom @Output).
  6089. */
  6090. type: 'dom' | 'output';
  6091. }
  6092. /**
  6093. * Retrieves a list of event listeners associated with a DOM element. The list does include host
  6094. * listeners, but it does not include event listeners defined outside of the Angular context
  6095. * (e.g. through `addEventListener`).
  6096. *
  6097. * @usageNotes
  6098. * Given the following DOM structure:
  6099. *
  6100. * ```html
  6101. * <app-root>
  6102. * <div (click)="doSomething()"></div>
  6103. * </app-root>
  6104. * ```
  6105. *
  6106. * Calling `getListeners` on `<div>` will return an object that looks as follows:
  6107. *
  6108. * ```ts
  6109. * {
  6110. * name: 'click',
  6111. * element: <div>,
  6112. * callback: () => doSomething(),
  6113. * useCapture: false
  6114. * }
  6115. * ```
  6116. *
  6117. * @param element Element for which the DOM listeners should be retrieved.
  6118. * @returns Array of event listeners on the DOM element.
  6119. *
  6120. * @publicApi
  6121. */
  6122. declare function getListeners(element: Element): Listener[];
  6123. /**
  6124. * @codeGenApi
  6125. */
  6126. declare function ɵɵgetInheritedFactory<T>(type: Type$1<any>): (type: Type$1<T>) => T;
  6127. /**
  6128. * Sets the locale id that will be used for translations and ICU expressions.
  6129. * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine
  6130. * but is now defined as a global value.
  6131. *
  6132. * @param localeId
  6133. */
  6134. declare function setLocaleId(localeId: string): void;
  6135. /**
  6136. * Creates runtime data structures for defer blocks.
  6137. *
  6138. * @param index Index of the `defer` instruction.
  6139. * @param primaryTmplIndex Index of the template with the primary block content.
  6140. * @param dependencyResolverFn Function that contains dependencies for this defer block.
  6141. * @param loadingTmplIndex Index of the template with the loading block content.
  6142. * @param placeholderTmplIndex Index of the template with the placeholder block content.
  6143. * @param errorTmplIndex Index of the template with the error block content.
  6144. * @param loadingConfigIndex Index in the constants array of the configuration of the loading.
  6145. * block.
  6146. * @param placeholderConfigIndex Index in the constants array of the configuration of the
  6147. * placeholder block.
  6148. * @param enableTimerScheduling Function that enables timer-related scheduling if `after`
  6149. * or `minimum` parameters are setup on the `@loading` or `@placeholder` blocks.
  6150. * @param flags A set of flags to define a particular behavior (e.g. to indicate that
  6151. * hydrate triggers are present and regular triggers should be deactivated
  6152. * in certain scenarios).
  6153. *
  6154. * @codeGenApi
  6155. */
  6156. 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;
  6157. /**
  6158. * Loads defer block dependencies when a trigger value becomes truthy.
  6159. * @codeGenApi
  6160. */
  6161. declare function ɵɵdeferWhen(rawValue: unknown): void;
  6162. /**
  6163. * Prefetches the deferred content when a value becomes truthy.
  6164. * @codeGenApi
  6165. */
  6166. declare function ɵɵdeferPrefetchWhen(rawValue: unknown): void;
  6167. /**
  6168. * Hydrates the deferred content when a value becomes truthy.
  6169. * @codeGenApi
  6170. */
  6171. declare function ɵɵdeferHydrateWhen(rawValue: unknown): void;
  6172. /**
  6173. * Specifies that hydration never occurs.
  6174. * @codeGenApi
  6175. */
  6176. declare function ɵɵdeferHydrateNever(): void;
  6177. /**
  6178. * Sets up logic to handle the `on idle` deferred trigger.
  6179. * @codeGenApi
  6180. */
  6181. declare function ɵɵdeferOnIdle(): void;
  6182. /**
  6183. * Sets up logic to handle the `prefetch on idle` deferred trigger.
  6184. * @codeGenApi
  6185. */
  6186. declare function ɵɵdeferPrefetchOnIdle(): void;
  6187. /**
  6188. * Sets up logic to handle the `on idle` deferred trigger.
  6189. * @codeGenApi
  6190. */
  6191. declare function ɵɵdeferHydrateOnIdle(): void;
  6192. /**
  6193. * Sets up logic to handle the `on immediate` deferred trigger.
  6194. * @codeGenApi
  6195. */
  6196. declare function ɵɵdeferOnImmediate(): void;
  6197. /**
  6198. * Sets up logic to handle the `prefetch on immediate` deferred trigger.
  6199. * @codeGenApi
  6200. */
  6201. declare function ɵɵdeferPrefetchOnImmediate(): void;
  6202. /**
  6203. * Sets up logic to handle the `on immediate` hydrate trigger.
  6204. * @codeGenApi
  6205. */
  6206. declare function ɵɵdeferHydrateOnImmediate(): void;
  6207. /**
  6208. * Creates runtime data structures for the `on timer` deferred trigger.
  6209. * @param delay Amount of time to wait before loading the content.
  6210. * @codeGenApi
  6211. */
  6212. declare function ɵɵdeferOnTimer(delay: number): void;
  6213. /**
  6214. * Creates runtime data structures for the `prefetch on timer` deferred trigger.
  6215. * @param delay Amount of time to wait before prefetching the content.
  6216. * @codeGenApi
  6217. */
  6218. declare function ɵɵdeferPrefetchOnTimer(delay: number): void;
  6219. /**
  6220. * Creates runtime data structures for the `on timer` hydrate trigger.
  6221. * @param delay Amount of time to wait before loading the content.
  6222. * @codeGenApi
  6223. */
  6224. declare function ɵɵdeferHydrateOnTimer(delay: number): void;
  6225. /**
  6226. * Creates runtime data structures for the `on hover` deferred trigger.
  6227. * @param triggerIndex Index at which to find the trigger element.
  6228. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  6229. * @codeGenApi
  6230. */
  6231. declare function ɵɵdeferOnHover(triggerIndex: number, walkUpTimes?: number): void;
  6232. /**
  6233. * Creates runtime data structures for the `prefetch on hover` deferred trigger.
  6234. * @param triggerIndex Index at which to find the trigger element.
  6235. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  6236. * @codeGenApi
  6237. */
  6238. declare function ɵɵdeferPrefetchOnHover(triggerIndex: number, walkUpTimes?: number): void;
  6239. /**
  6240. * Creates runtime data structures for the `on hover` hydrate trigger.
  6241. * @codeGenApi
  6242. */
  6243. declare function ɵɵdeferHydrateOnHover(): void;
  6244. /**
  6245. * Creates runtime data structures for the `on interaction` deferred trigger.
  6246. * @param triggerIndex Index at which to find the trigger element.
  6247. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  6248. * @codeGenApi
  6249. */
  6250. declare function ɵɵdeferOnInteraction(triggerIndex: number, walkUpTimes?: number): void;
  6251. /**
  6252. * Creates runtime data structures for the `prefetch on interaction` deferred trigger.
  6253. * @param triggerIndex Index at which to find the trigger element.
  6254. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  6255. * @codeGenApi
  6256. */
  6257. declare function ɵɵdeferPrefetchOnInteraction(triggerIndex: number, walkUpTimes?: number): void;
  6258. /**
  6259. * Creates runtime data structures for the `on interaction` hydrate trigger.
  6260. * @codeGenApi
  6261. */
  6262. declare function ɵɵdeferHydrateOnInteraction(): void;
  6263. /**
  6264. * Creates runtime data structures for the `on viewport` deferred trigger.
  6265. * @param triggerIndex Index at which to find the trigger element.
  6266. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  6267. * @codeGenApi
  6268. */
  6269. declare function ɵɵdeferOnViewport(triggerIndex: number, walkUpTimes?: number): void;
  6270. /**
  6271. * Creates runtime data structures for the `prefetch on viewport` deferred trigger.
  6272. * @param triggerIndex Index at which to find the trigger element.
  6273. * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
  6274. * @codeGenApi
  6275. */
  6276. declare function ɵɵdeferPrefetchOnViewport(triggerIndex: number, walkUpTimes?: number): void;
  6277. /**
  6278. * Creates runtime data structures for the `on viewport` hydrate trigger.
  6279. * @codeGenApi
  6280. */
  6281. declare function ɵɵdeferHydrateOnViewport(): void;
  6282. /**
  6283. * Advances to an element for later binding instructions.
  6284. *
  6285. * Used in conjunction with instructions like {@link property} to act on elements with specified
  6286. * indices, for example those created with {@link element} or {@link elementStart}.
  6287. *
  6288. * ```ts
  6289. * (rf: RenderFlags, ctx: any) => {
  6290. * if (rf & 1) {
  6291. * text(0, 'Hello');
  6292. * text(1, 'Goodbye')
  6293. * element(2, 'div');
  6294. * }
  6295. * if (rf & 2) {
  6296. * advance(2); // Advance twice to the <div>.
  6297. * property('title', 'test');
  6298. * }
  6299. * }
  6300. * ```
  6301. * @param delta Number of elements to advance forwards by.
  6302. *
  6303. * @codeGenApi
  6304. */
  6305. declare function ɵɵadvance(delta?: number): void;
  6306. /**
  6307. * Updates the value of or removes a bound attribute on an Element.
  6308. *
  6309. * Used in the case of `[attr.title]="value"`
  6310. *
  6311. * @param name name The name of the attribute.
  6312. * @param value value The attribute is removed when value is `null` or `undefined`.
  6313. * Otherwise the attribute value is set to the stringified value.
  6314. * @param sanitizer An optional function used to sanitize the value.
  6315. * @param namespace Optional namespace to use when setting the attribute.
  6316. *
  6317. * @codeGenApi
  6318. */
  6319. declare function ɵɵattribute(name: string, value: any, sanitizer?: SanitizerFn | null, namespace?: string): typeof ɵɵattribute;
  6320. /*!
  6321. * @license
  6322. * Copyright Google LLC All Rights Reserved.
  6323. *
  6324. * Use of this source code is governed by an MIT-style license that can be
  6325. * found in the LICENSE file at https://angular.dev/license
  6326. */
  6327. /**
  6328. * Instruction that returns the component instance in which the current instruction is executing.
  6329. * This is a constant-time version of `nextContent` for the case where we know that we need the
  6330. * component instance specifically, rather than the context of a particular template.
  6331. *
  6332. * @codeGenApi
  6333. */
  6334. declare function ɵɵcomponentInstance(): unknown;
  6335. /**
  6336. * Creates an LContainer for an ng-template representing a root node
  6337. * of control flow (@if, @switch). We use this to explicitly set
  6338. * flags on the TNode created to identify which nodes are in control
  6339. * flow or starting control flow for hydration identification and
  6340. * cleanup timing.
  6341. *
  6342. * @param index The index of the container in the data array
  6343. * @param templateFn Inline template
  6344. * @param decls The number of nodes, local refs, and pipes for this template
  6345. * @param vars The number of bindings for this template
  6346. * @param tagName The name of the container element, if applicable
  6347. * @param attrsIndex Index of template attributes in the `consts` array.
  6348. * @param localRefs Index of the local references in the `consts` array.
  6349. * @param localRefExtractor A function which extracts local-refs values from the template.
  6350. * Defaults to the current element associated with the local-ref.
  6351. * @codeGenApi
  6352. */
  6353. declare function ɵɵconditionalCreate(index: number, templateFn: ComponentTemplate<any> | null, decls: number, vars: number, tagName?: string | null, attrsIndex?: number | null, localRefsIndex?: number | null, localRefExtractor?: LocalRefExtractor): typeof ɵɵconditionalBranchCreate;
  6354. /**
  6355. * Creates an LContainer for an ng-template representing a branch
  6356. * of control flow (@else, @case, @default). We use this to explicitly
  6357. * set flags on the TNode created to identify which nodes are in
  6358. * control flow or starting control flow for hydration identification
  6359. * and cleanup timing.
  6360. *
  6361. * @param index The index of the container in the data array
  6362. * @param templateFn Inline template
  6363. * @param decls The number of nodes, local refs, and pipes for this template
  6364. * @param vars The number of bindings for this template
  6365. * @param tagName The name of the container element, if applicable
  6366. * @param attrsIndex Index of template attributes in the `consts` array.
  6367. * @param localRefs Index of the local references in the `consts` array.
  6368. * @param localRefExtractor A function which extracts local-refs values from the template.
  6369. * Defaults to the current element associated with the local-ref.
  6370. * @codeGenApi
  6371. */
  6372. declare function ɵɵconditionalBranchCreate(index: number, templateFn: ComponentTemplate<any> | null, decls: number, vars: number, tagName?: string | null, attrsIndex?: number | null, localRefsIndex?: number | null, localRefExtractor?: LocalRefExtractor): typeof ɵɵconditionalBranchCreate;
  6373. /**
  6374. * The conditional instruction represents the basic building block on the runtime side to support
  6375. * built-in "if" and "switch". On the high level this instruction is responsible for adding and
  6376. * removing views selected by a conditional expression.
  6377. *
  6378. * @param matchingTemplateIndex Index of a template TNode representing a conditional view to be
  6379. * inserted; -1 represents a special case when there is no view to insert.
  6380. * @param contextValue Value that should be exposed as the context of the conditional.
  6381. * @codeGenApi
  6382. */
  6383. declare function ɵɵconditional<T>(matchingTemplateIndex: number, contextValue?: T): void;
  6384. /**
  6385. * A built-in trackBy function used for situations where users specified collection index as a
  6386. * tracking expression. Having this function body in the runtime avoids unnecessary code generation.
  6387. *
  6388. * @param index
  6389. * @returns
  6390. */
  6391. declare function ɵɵrepeaterTrackByIndex(index: number): number;
  6392. /**
  6393. * A built-in trackBy function used for situations where users specified collection item reference
  6394. * as a tracking expression. Having this function body in the runtime avoids unnecessary code
  6395. * generation.
  6396. *
  6397. * @param index
  6398. * @returns
  6399. */
  6400. declare function ɵɵrepeaterTrackByIdentity<T>(_: number, value: T): T;
  6401. /**
  6402. * The repeaterCreate instruction runs in the creation part of the template pass and initializes
  6403. * internal data structures required by the update pass of the built-in repeater logic. Repeater
  6404. * metadata are allocated in the data part of LView with the following layout:
  6405. * - LView[HEADER_OFFSET + index] - metadata
  6406. * - LView[HEADER_OFFSET + index + 1] - reference to a template function rendering an item
  6407. * - LView[HEADER_OFFSET + index + 2] - optional reference to a template function rendering an empty
  6408. * block
  6409. *
  6410. * @param index Index at which to store the metadata of the repeater.
  6411. * @param templateFn Reference to the template of the main repeater block.
  6412. * @param decls The number of nodes, local refs, and pipes for the main block.
  6413. * @param vars The number of bindings for the main block.
  6414. * @param tagName The name of the container element, if applicable
  6415. * @param attrsIndex Index of template attributes in the `consts` array.
  6416. * @param trackByFn Reference to the tracking function.
  6417. * @param trackByUsesComponentInstance Whether the tracking function has any references to the
  6418. * component instance. If it doesn't, we can avoid rebinding it.
  6419. * @param emptyTemplateFn Reference to the template function of the empty block.
  6420. * @param emptyDecls The number of nodes, local refs, and pipes for the empty block.
  6421. * @param emptyVars The number of bindings for the empty block.
  6422. * @param emptyTagName The name of the empty block container element, if applicable
  6423. * @param emptyAttrsIndex Index of the empty block template attributes in the `consts` array.
  6424. *
  6425. * @codeGenApi
  6426. */
  6427. 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;
  6428. /**
  6429. * The repeater instruction does update-time diffing of a provided collection (against the
  6430. * collection seen previously) and maps changes in the collection to views structure (by adding,
  6431. * removing or moving views as needed).
  6432. * @param collection - the collection instance to be checked for changes
  6433. * @codeGenApi
  6434. */
  6435. declare function ɵɵrepeater(collection: Iterable<unknown> | undefined | null): void;
  6436. /**
  6437. * Returns the value associated to the given token from the injectors.
  6438. *
  6439. * `directiveInject` is intended to be used for directive, component and pipe factories.
  6440. * All other injection use `inject` which does not walk the node injector tree.
  6441. *
  6442. * Usage example (in factory function):
  6443. *
  6444. * ```ts
  6445. * class SomeDirective {
  6446. * constructor(directive: DirectiveA) {}
  6447. *
  6448. * static ɵdir = ɵɵdefineDirective({
  6449. * type: SomeDirective,
  6450. * factory: () => new SomeDirective(ɵɵdirectiveInject(DirectiveA))
  6451. * });
  6452. * }
  6453. * ```
  6454. * @param token the type or token to inject
  6455. * @param flags Injection flags
  6456. * @returns the value from the injector or `null` when not found
  6457. *
  6458. * @codeGenApi
  6459. */
  6460. declare function ɵɵdirectiveInject<T>(token: ProviderToken<T>): T;
  6461. declare function ɵɵdirectiveInject<T>(token: ProviderToken<T>, flags: InternalInjectFlags): T;
  6462. /**
  6463. * Throws an error indicating that a factory function could not be generated by the compiler for a
  6464. * particular class.
  6465. *
  6466. * This instruction allows the actual error message to be optimized away when ngDevMode is turned
  6467. * off, saving bytes of generated code while still providing a good experience in dev mode.
  6468. *
  6469. * The name of the class is not mentioned here, but will be in the generated factory function name
  6470. * and thus in the stack trace.
  6471. *
  6472. * @codeGenApi
  6473. */
  6474. declare function ɵɵinvalidFactory(): never;
  6475. /**
  6476. * Facade for the attribute injection from DI.
  6477. *
  6478. * @codeGenApi
  6479. */
  6480. declare function ɵɵinjectAttribute(attrNameToInject: string): string | null;
  6481. /**
  6482. * Create DOM element. The instruction must later be followed by `elementEnd()` call.
  6483. *
  6484. * @param index Index of the element in the LView array
  6485. * @param name Name of the DOM Node
  6486. * @param attrsIndex Index of the element's attributes in the `consts` array.
  6487. * @param localRefsIndex Index of the element's local references in the `consts` array.
  6488. * @returns This function returns itself so that it may be chained.
  6489. *
  6490. * Attributes and localRefs are passed as an array of strings where elements with an even index
  6491. * hold an attribute name and elements with an odd index hold an attribute value, ex.:
  6492. * ['id', 'warning5', 'class', 'alert']
  6493. *
  6494. * @codeGenApi
  6495. */
  6496. declare function ɵɵelementStart(index: number, name: string, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵelementStart;
  6497. /**
  6498. * Mark the end of the element.
  6499. * @returns This function returns itself so that it may be chained.
  6500. *
  6501. * @codeGenApi
  6502. */
  6503. declare function ɵɵelementEnd(): typeof ɵɵelementEnd;
  6504. /**
  6505. * Creates an empty element using {@link elementStart} and {@link elementEnd}
  6506. *
  6507. * @param index Index of the element in the data array
  6508. * @param name Name of the DOM Node
  6509. * @param attrsIndex Index of the element's attributes in the `consts` array.
  6510. * @param localRefsIndex Index of the element's local references in the `consts` array.
  6511. * @returns This function returns itself so that it may be chained.
  6512. *
  6513. * @codeGenApi
  6514. */
  6515. declare function ɵɵelement(index: number, name: string, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵelement;
  6516. /**
  6517. * Create DOM element that cannot have any directives.
  6518. *
  6519. * @param index Index of the element in the LView array
  6520. * @param name Name of the DOM Node
  6521. * @param attrsIndex Index of the element's attributes in the `consts` array.
  6522. * @param localRefsIndex Index of the element's local references in the `consts` array.
  6523. * @returns This function returns itself so that it may be chained.
  6524. *
  6525. * @codeGenApi
  6526. */
  6527. declare function ɵɵdomElementStart(index: number, name: string, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵdomElementStart;
  6528. /**
  6529. * Mark the end of the directiveless element.
  6530. * @returns This function returns itself so that it may be chained.
  6531. *
  6532. * @codeGenApi
  6533. */
  6534. declare function ɵɵdomElementEnd(): typeof ɵɵdomElementEnd;
  6535. /**
  6536. * Creates an empty element using {@link domElementStart} and {@link domElementEnd}
  6537. *
  6538. * @param index Index of the element in the data array
  6539. * @param name Name of the DOM Node
  6540. * @param attrsIndex Index of the element's attributes in the `consts` array.
  6541. * @param localRefsIndex Index of the element's local references in the `consts` array.
  6542. * @returns This function returns itself so that it may be chained.
  6543. *
  6544. * @codeGenApi
  6545. */
  6546. declare function ɵɵdomElement(index: number, name: string, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵdomElement;
  6547. /**
  6548. * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM.
  6549. * The instruction must later be followed by `elementContainerEnd()` call.
  6550. *
  6551. * @param index Index of the element in the LView array
  6552. * @param attrsIndex Index of the container attributes in the `consts` array.
  6553. * @param localRefsIndex Index of the container's local references in the `consts` array.
  6554. * @returns This function returns itself so that it may be chained.
  6555. *
  6556. * Even if this instruction accepts a set of attributes no actual attribute values are propagated to
  6557. * the DOM (as a comment node can't have attributes). Attributes are here only for directive
  6558. * matching purposes and setting initial inputs of directives.
  6559. *
  6560. * @codeGenApi
  6561. */
  6562. declare function ɵɵelementContainerStart(index: number, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵelementContainerStart;
  6563. /**
  6564. * Mark the end of the <ng-container>.
  6565. * @returns This function returns itself so that it may be chained.
  6566. *
  6567. * @codeGenApi
  6568. */
  6569. declare function ɵɵelementContainerEnd(): typeof ɵɵelementContainerEnd;
  6570. /**
  6571. * Creates an empty logical container using {@link elementContainerStart}
  6572. * and {@link elementContainerEnd}
  6573. *
  6574. * @param index Index of the element in the LView array
  6575. * @param attrsIndex Index of the container attributes in the `consts` array.
  6576. * @param localRefsIndex Index of the container's local references in the `consts` array.
  6577. * @returns This function returns itself so that it may be chained.
  6578. *
  6579. * @codeGenApi
  6580. */
  6581. declare function ɵɵelementContainer(index: number, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵelementContainer;
  6582. /**
  6583. * Creates a DOM-only logical container for other nodes (<ng-container>) backed by a comment node
  6584. * in the DOM. The host node will *not* match any directives.
  6585. *
  6586. * @param index Index of the element in the LView array
  6587. * @param attrsIndex Index of the container attributes in the `consts` array.
  6588. * @param localRefsIndex Index of the container's local references in the `consts` array.
  6589. * @returns This function returns itself so that it may be chained.
  6590. *
  6591. * @codeGenApi
  6592. */
  6593. declare function ɵɵdomElementContainerStart(index: number, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵdomElementContainerStart;
  6594. /**
  6595. * Mark the end of a directiveless <ng-container>.
  6596. * @returns This function returns itself so that it may be chained.
  6597. *
  6598. * @codeGenApi
  6599. */
  6600. declare function ɵɵdomElementContainerEnd(): typeof ɵɵelementContainerEnd;
  6601. /**
  6602. * Creates an empty logical container using {@link domElementContainerStart}
  6603. * and {@link domElementContainerEnd}
  6604. *
  6605. * @param index Index of the element in the LView array
  6606. * @param attrsIndex Index of the container attributes in the `consts` array.
  6607. * @param localRefsIndex Index of the container's local references in the `consts` array.
  6608. * @returns This function returns itself so that it may be chained.
  6609. *
  6610. * @codeGenApi
  6611. */
  6612. declare function ɵɵdomElementContainer(index: number, attrsIndex?: number | null, localRefsIndex?: number): typeof ɵɵdomElementContainer;
  6613. /**
  6614. * Sets a strict mode for JIT-compiled components to throw an error on unknown elements,
  6615. * instead of just logging the error.
  6616. * (for AOT-compiled ones this check happens at build time).
  6617. */
  6618. declare function ɵsetUnknownElementStrictMode(shouldThrow: boolean): void;
  6619. /**
  6620. * Gets the current value of the strict mode.
  6621. */
  6622. declare function ɵgetUnknownElementStrictMode(): boolean;
  6623. /**
  6624. * Sets a strict mode for JIT-compiled components to throw an error on unknown properties,
  6625. * instead of just logging the error.
  6626. * (for AOT-compiled ones this check happens at build time).
  6627. */
  6628. declare function ɵsetUnknownPropertyStrictMode(shouldThrow: boolean): void;
  6629. /**
  6630. * Gets the current value of the strict mode.
  6631. */
  6632. declare function ɵgetUnknownPropertyStrictMode(): boolean;
  6633. /**
  6634. * Returns the current OpaqueViewState instance.
  6635. *
  6636. * Used in conjunction with the restoreView() instruction to save a snapshot
  6637. * of the current view and restore it when listeners are invoked. This allows
  6638. * walking the declaration view tree in listeners to get vars from parent views.
  6639. *
  6640. * @codeGenApi
  6641. */
  6642. declare function ɵɵgetCurrentView(): OpaqueViewState;
  6643. interface NO_CHANGE {
  6644. __brand__: 'NO_CHANGE';
  6645. }
  6646. /** A special value which designates that a value has not changed. */
  6647. declare const NO_CHANGE: NO_CHANGE;
  6648. /**
  6649. * Update a DOM property on an element.
  6650. *
  6651. * @param propName Name of property..
  6652. * @param value New value to write.
  6653. * @param sanitizer An optional function used to sanitize the value.
  6654. * @returns This function returns itself so that it may be chained
  6655. * (e.g. `domProperty('name', ctx.name)('title', ctx.title)`)
  6656. *
  6657. * @codeGenApi
  6658. */
  6659. declare function ɵɵdomProperty<T>(propName: string, value: T, sanitizer?: SanitizerFn | null): typeof ɵɵdomProperty;
  6660. /**
  6661. * Updates a synthetic host binding (e.g. `[@foo]`) on a component or directive.
  6662. *
  6663. * This instruction is for compatibility purposes and is designed to ensure that a
  6664. * synthetic host binding (e.g. `@HostBinding('@foo')`) properly gets rendered in
  6665. * the component's renderer. Normally all host bindings are evaluated with the parent
  6666. * component's renderer, but, in the case of animation @triggers, they need to be
  6667. * evaluated with the sub component's renderer (because that's where the animation
  6668. * triggers are defined).
  6669. *
  6670. * Do not use this instruction as a replacement for `elementProperty`. This instruction
  6671. * only exists to ensure compatibility with the ViewEngine's host binding behavior.
  6672. *
  6673. * @param index The index of the element to update in the data array
  6674. * @param propName Name of property. Because it is going to DOM, this is not subject to
  6675. * renaming as part of minification.
  6676. * @param value New value to write.
  6677. * @param sanitizer An optional function used to sanitize the value.
  6678. *
  6679. * @codeGenApi
  6680. */
  6681. declare function ɵɵsyntheticHostProperty<T>(propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null): typeof ɵɵsyntheticHostProperty;
  6682. /**
  6683. * Marks a block of text as translatable.
  6684. *
  6685. * The instructions `i18nStart` and `i18nEnd` mark the translation block in the template.
  6686. * The translation `message` is the value which is locale specific. The translation string may
  6687. * contain placeholders which associate inner elements and sub-templates within the translation.
  6688. *
  6689. * The translation `message` placeholders are:
  6690. * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be
  6691. * interpolated into. The placeholder `index` points to the expression binding index. An optional
  6692. * `block` that matches the sub-template in which it was declared.
  6693. * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*: Marks the beginning
  6694. * and end of DOM element that were embedded in the original translation block. The placeholder
  6695. * `index` points to the element index in the template instructions set. An optional `block` that
  6696. * matches the sub-template in which it was declared.
  6697. * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be
  6698. * split up and translated separately in each angular template function. The `index` points to the
  6699. * `template` instruction index. A `block` that matches the sub-template in which it was declared.
  6700. *
  6701. * @param index A unique index of the translation in the static block.
  6702. * @param messageIndex An index of the translation message from the `def.consts` array.
  6703. * @param subTemplateIndex Optional sub-template index in the `message`.
  6704. *
  6705. * @codeGenApi
  6706. */
  6707. declare function ɵɵi18nStart(index: number, messageIndex: number, subTemplateIndex?: number): void;
  6708. /**
  6709. * Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes
  6710. * into the render tree, moves the placeholder nodes and removes the deleted nodes.
  6711. *
  6712. * @codeGenApi
  6713. */
  6714. declare function ɵɵi18nEnd(): void;
  6715. /**
  6716. *
  6717. * Use this instruction to create a translation block that doesn't contain any placeholder.
  6718. * It calls both {@link i18nStart} and {@link i18nEnd} in one instruction.
  6719. *
  6720. * The translation `message` is the value which is locale specific. The translation string may
  6721. * contain placeholders which associate inner elements and sub-templates within the translation.
  6722. *
  6723. * The translation `message` placeholders are:
  6724. * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be
  6725. * interpolated into. The placeholder `index` points to the expression binding index. An optional
  6726. * `block` that matches the sub-template in which it was declared.
  6727. * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*: Marks the beginning
  6728. * and end of DOM element that were embedded in the original translation block. The placeholder
  6729. * `index` points to the element index in the template instructions set. An optional `block` that
  6730. * matches the sub-template in which it was declared.
  6731. * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be
  6732. * split up and translated separately in each angular template function. The `index` points to the
  6733. * `template` instruction index. A `block` that matches the sub-template in which it was declared.
  6734. *
  6735. * @param index A unique index of the translation in the static block.
  6736. * @param messageIndex An index of the translation message from the `def.consts` array.
  6737. * @param subTemplateIndex Optional sub-template index in the `message`.
  6738. *
  6739. * @codeGenApi
  6740. */
  6741. declare function ɵɵi18n(index: number, messageIndex: number, subTemplateIndex?: number): void;
  6742. /**
  6743. * Marks a list of attributes as translatable.
  6744. *
  6745. * @param index A unique index in the static block
  6746. * @param values
  6747. *
  6748. * @codeGenApi
  6749. */
  6750. declare function ɵɵi18nAttributes(index: number, attrsIndex: number): void;
  6751. /**
  6752. * Stores the values of the bindings during each update cycle in order to determine if we need to
  6753. * update the translated nodes.
  6754. *
  6755. * @param value The binding's value
  6756. * @returns This function returns itself so that it may be chained
  6757. * (e.g. `i18nExp(ctx.name)(ctx.title)`)
  6758. *
  6759. * @codeGenApi
  6760. */
  6761. declare function ɵɵi18nExp<T>(value: T): typeof ɵɵi18nExp;
  6762. /**
  6763. * Updates a translation block or an i18n attribute when the bindings have changed.
  6764. *
  6765. * @param index Index of either {@link i18nStart} (translation block) or {@link i18nAttributes}
  6766. * (i18n attribute) on which it should update the content.
  6767. *
  6768. * @codeGenApi
  6769. */
  6770. declare function ɵɵi18nApply(index: number): void;
  6771. /**
  6772. * Handles message string post-processing for internationalization.
  6773. *
  6774. * Handles message string post-processing by transforming it from intermediate
  6775. * format (that might contain some markers that we need to replace) to the final
  6776. * form, consumable by i18nStart instruction. Post processing steps include:
  6777. *
  6778. * 1. Resolve all multi-value cases (like [�*1:1��#2:1�|�#4:1�|�5�])
  6779. * 2. Replace all ICU vars (like "VAR_PLURAL")
  6780. * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}
  6781. * 4. Replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�)
  6782. * in case multiple ICUs have the same placeholder name
  6783. *
  6784. * @param message Raw translation string for post processing
  6785. * @param replacements Set of replacements that should be applied
  6786. *
  6787. * @returns Transformed string that can be consumed by i18nStart instruction
  6788. *
  6789. * @codeGenApi
  6790. */
  6791. declare function ɵɵi18nPostprocess(message: string, replacements?: {
  6792. [key: string]: string | string[];
  6793. }): string;
  6794. /**
  6795. * Adds an event listener to the current node.
  6796. *
  6797. * If an output exists on one of the node's directives, it also subscribes to the output
  6798. * and saves the subscription for later cleanup.
  6799. *
  6800. * @param eventName Name of the event
  6801. * @param listenerFn The function to be called when event emits
  6802. * @param eventTargetResolver Function that returns global target information in case this listener
  6803. * should be attached to a global object like window, document or body
  6804. *
  6805. * @codeGenApi
  6806. */
  6807. declare function ɵɵlistener(eventName: string, listenerFn: EventCallback, eventTargetResolver?: GlobalTargetResolver): typeof ɵɵlistener;
  6808. /**
  6809. * Registers a synthetic host listener (e.g. `(@foo.start)`) on a component or directive.
  6810. *
  6811. * This instruction is for compatibility purposes and is designed to ensure that a
  6812. * synthetic host listener (e.g. `@HostListener('@foo.start')`) properly gets rendered
  6813. * in the component's renderer. Normally all host listeners are evaluated with the
  6814. * parent component's renderer, but, in the case of animation @triggers, they need
  6815. * to be evaluated with the sub component's renderer (because that's where the
  6816. * animation triggers are defined).
  6817. *
  6818. * Do not use this instruction as a replacement for `listener`. This instruction
  6819. * only exists to ensure compatibility with the ViewEngine's host binding behavior.
  6820. *
  6821. * @param eventName Name of the event
  6822. * @param listenerFn The function to be called when event emits
  6823. * @param useCapture Whether or not to use capture in event listener
  6824. * @param eventTargetResolver Function that returns global target information in case this listener
  6825. * should be attached to a global object like window, document or body
  6826. *
  6827. * @codeGenApi
  6828. */
  6829. declare function ɵɵsyntheticHostListener(eventName: string, listenerFn: EventCallback): typeof ɵɵsyntheticHostListener;
  6830. /**
  6831. * Adds a listener for a DOM event on the current node.
  6832. *
  6833. * @param eventName Name of the event
  6834. * @param listenerFn The function to be called when event emits
  6835. * @param eventTargetResolver Function that returns global target information in case this listener
  6836. * should be attached to a global object like window, document or body
  6837. *
  6838. * @codeGenApi
  6839. */
  6840. declare function ɵɵdomListener(eventName: string, listenerFn: EventCallback, eventTargetResolver?: GlobalTargetResolver): typeof ɵɵdomListener;
  6841. /**
  6842. * Enables directive matching on elements.
  6843. *
  6844. * * Example:
  6845. * ```html
  6846. * <my-comp my-directive>
  6847. * Should match component / directive.
  6848. * </my-comp>
  6849. * <div ngNonBindable>
  6850. * <!-- ɵɵdisableBindings() -->
  6851. * <my-comp my-directive>
  6852. * Should not match component / directive because we are in ngNonBindable.
  6853. * </my-comp>
  6854. * <!-- ɵɵenableBindings() -->
  6855. * </div>
  6856. * ```
  6857. *
  6858. * @codeGenApi
  6859. */
  6860. declare function ɵɵenableBindings(): void;
  6861. /**
  6862. * Disables directive matching on element.
  6863. *
  6864. * * Example:
  6865. * ```html
  6866. * <my-comp my-directive>
  6867. * Should match component / directive.
  6868. * </my-comp>
  6869. * <div ngNonBindable>
  6870. * <!-- ɵɵdisableBindings() -->
  6871. * <my-comp my-directive>
  6872. * Should not match component / directive because we are in ngNonBindable.
  6873. * </my-comp>
  6874. * <!-- ɵɵenableBindings() -->
  6875. * </div>
  6876. * ```
  6877. *
  6878. * @codeGenApi
  6879. */
  6880. declare function ɵɵdisableBindings(): void;
  6881. /**
  6882. * Restores `contextViewData` to the given OpaqueViewState instance.
  6883. *
  6884. * Used in conjunction with the getCurrentView() instruction to save a snapshot
  6885. * of the current view and restore it when listeners are invoked. This allows
  6886. * walking the declaration view tree in listeners to get vars from parent views.
  6887. *
  6888. * @param viewToRestore The OpaqueViewState instance to restore.
  6889. * @returns Context of the restored OpaqueViewState instance.
  6890. *
  6891. * @codeGenApi
  6892. */
  6893. declare function ɵɵrestoreView<T = any>(viewToRestore: OpaqueViewState): T;
  6894. /**
  6895. * Clears the view set in `ɵɵrestoreView` from memory. Returns the passed in
  6896. * value so that it can be used as a return value of an instruction.
  6897. *
  6898. * @codeGenApi
  6899. */
  6900. declare function ɵɵresetView<T>(value?: T): T | undefined;
  6901. /**
  6902. * Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.
  6903. *
  6904. * @codeGenApi
  6905. */
  6906. declare function ɵɵnamespaceSVG(): void;
  6907. /**
  6908. * Sets the namespace used to create elements to `'http://www.w3.org/1998/MathML/'` in global state.
  6909. *
  6910. * @codeGenApi
  6911. */
  6912. declare function ɵɵnamespaceMathML(): void;
  6913. /**
  6914. * Sets the namespace used to create elements to `null`, which forces element creation to use
  6915. * `createElement` rather than `createElementNS`.
  6916. *
  6917. * @codeGenApi
  6918. */
  6919. declare function ɵɵnamespaceHTML(): void;
  6920. /**
  6921. * Retrieves a context at the level specified and saves it as the global, contextViewData.
  6922. * Will get the next level up if level is not specified.
  6923. *
  6924. * This is used to save contexts of parent views so they can be bound in embedded views, or
  6925. * in conjunction with reference() to bind a ref from a parent view.
  6926. *
  6927. * @param level The relative level of the view from which to grab context compared to contextVewData
  6928. * @returns context
  6929. *
  6930. * @codeGenApi
  6931. */
  6932. declare function ɵɵnextContext<T = any>(level?: number): T;
  6933. /**
  6934. * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.
  6935. * It takes all the selectors from the entire component's template and decides where
  6936. * each projected node belongs (it re-distributes nodes among "buckets" where each "bucket" is
  6937. * backed by a selector).
  6938. *
  6939. * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,
  6940. * un-parsed form.
  6941. *
  6942. * The parsed form is needed for efficient matching of a node against a given CSS selector.
  6943. * The un-parsed, textual form is needed for support of the ngProjectAs attribute.
  6944. *
  6945. * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more
  6946. * drawbacks:
  6947. * - having only a textual form would require runtime parsing of CSS selectors;
  6948. * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a
  6949. * template author).
  6950. *
  6951. * @param projectionSlots? A collection of projection slots. A projection slot can be based
  6952. * on a parsed CSS selectors or set to the wildcard selector ("*") in order to match
  6953. * all nodes which do not match any selector. If not specified, a single wildcard
  6954. * selector projection slot will be defined.
  6955. *
  6956. * @codeGenApi
  6957. */
  6958. declare function ɵɵprojectionDef(projectionSlots?: ProjectionSlots): void;
  6959. /**
  6960. * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call
  6961. * to the projectionDef instruction.
  6962. *
  6963. * @param nodeIndex Index of the projection node.
  6964. * @param selectorIndex Index of the slot selector.
  6965. * - 0 when the selector is `*` (or unspecified as this is the default value),
  6966. * - 1 based index of the selector from the {@link projectionDef}
  6967. * @param attrs Static attributes set on the `ng-content` node.
  6968. * @param fallbackTemplateFn Template function with fallback content.
  6969. * Will be rendered if the slot is empty at runtime.
  6970. * @param fallbackDecls Number of declarations in the fallback template.
  6971. * @param fallbackVars Number of variables in the fallback template.
  6972. *
  6973. * @codeGenApi
  6974. */
  6975. declare function ɵɵprojection(nodeIndex: number, selectorIndex?: number, attrs?: TAttributes, fallbackTemplateFn?: ComponentTemplate<unknown>, fallbackDecls?: number, fallbackVars?: number): void;
  6976. /**
  6977. * Update a property on a selected element.
  6978. *
  6979. * Operates on the element selected by index via the {@link select} instruction.
  6980. *
  6981. * If the property name also exists as an input property on one of the element's directives,
  6982. * the component property will be set instead of the element property. This check must
  6983. * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled
  6984. *
  6985. * @param propName Name of property. Because it is going to DOM, this is not subject to
  6986. * renaming as part of minification.
  6987. * @param value New value to write.
  6988. * @param sanitizer An optional function used to sanitize the value.
  6989. * @returns This function returns itself so that it may be chained
  6990. * (e.g. `property('name', ctx.name)('title', ctx.title)`)
  6991. *
  6992. * @codeGenApi
  6993. */
  6994. declare function ɵɵproperty<T>(propName: string, value: T, sanitizer?: SanitizerFn | null): typeof ɵɵproperty;
  6995. /**
  6996. * Registers a QueryList, associated with a content query, for later refresh (part of a view
  6997. * refresh).
  6998. *
  6999. * @param directiveIndex Current directive index
  7000. * @param predicate The type for which the query will search
  7001. * @param flags Flags associated with the query
  7002. * @param read What to save in the query
  7003. * @returns QueryList<T>
  7004. *
  7005. * @codeGenApi
  7006. */
  7007. declare function ɵɵcontentQuery<T>(directiveIndex: number, predicate: ProviderToken<unknown> | string | string[], flags: QueryFlags, read?: any): void;
  7008. /**
  7009. * Creates a new view query by initializing internal data structures.
  7010. *
  7011. * @param predicate The type for which the query will search
  7012. * @param flags Flags associated with the query
  7013. * @param read What to save in the query
  7014. *
  7015. * @codeGenApi
  7016. */
  7017. declare function ɵɵviewQuery<T>(predicate: ProviderToken<unknown> | string | string[], flags: QueryFlags, read?: any): void;
  7018. /**
  7019. * Refreshes a query by combining matches from all active views and removing matches from deleted
  7020. * views.
  7021. *
  7022. * @returns `true` if a query got dirty during change detection or if this is a static query
  7023. * resolving in creation mode, `false` otherwise.
  7024. *
  7025. * @codeGenApi
  7026. */
  7027. declare function ɵɵqueryRefresh(queryList: QueryList<any>): boolean;
  7028. /**
  7029. * Loads a QueryList corresponding to the current view or content query.
  7030. *
  7031. * @codeGenApi
  7032. */
  7033. declare function ɵɵloadQuery<T>(): QueryList<T>;
  7034. /**
  7035. * Creates a new content query and binds it to a signal created by an authoring function.
  7036. *
  7037. * @param directiveIndex Current directive index
  7038. * @param target The target signal to which the query should be bound
  7039. * @param predicate The type for which the query will search
  7040. * @param flags Flags associated with the query
  7041. * @param read What to save in the query
  7042. *
  7043. * @codeGenApi
  7044. */
  7045. declare function ɵɵcontentQuerySignal<T>(directiveIndex: number, target: Signal<T>, predicate: ProviderToken<unknown> | string[], flags: QueryFlags, read?: any): void;
  7046. /**
  7047. * Creates a new view query by initializing internal data structures and binding a new query to the
  7048. * target signal.
  7049. *
  7050. * @param target The target signal to assign the query results to.
  7051. * @param predicate The type or label that should match a given query
  7052. * @param flags Flags associated with the query
  7053. * @param read What to save in the query
  7054. *
  7055. * @codeGenApi
  7056. */
  7057. declare function ɵɵviewQuerySignal(target: Signal<unknown>, predicate: ProviderToken<unknown> | string[], flags: QueryFlags, read?: ProviderToken<unknown>): void;
  7058. /**
  7059. * Advances the current query index by a specified offset.
  7060. *
  7061. * Adjusting the current query index is necessary in cases where a given directive has a mix of
  7062. * zone-based and signal-based queries. The signal-based queries don't require tracking of the
  7063. * current index (those are refreshed on demand and not during change detection) so this instruction
  7064. * is only necessary for backward-compatibility.
  7065. *
  7066. * @param index offset to apply to the current query index (defaults to 1)
  7067. *
  7068. * @codeGenApi
  7069. */
  7070. declare function ɵɵqueryAdvance(indexOffset?: number): void;
  7071. /**
  7072. * Retrieves a local reference from the current contextViewData.
  7073. *
  7074. * If the reference to retrieve is in a parent view, this instruction is used in conjunction
  7075. * with a nextContext() call, which walks up the tree and updates the contextViewData instance.
  7076. *
  7077. * @param index The index of the local ref in contextViewData.
  7078. *
  7079. * @codeGenApi
  7080. */
  7081. declare function ɵɵreference<T>(index: number): T;
  7082. /**
  7083. * Update a style binding on an element with the provided value.
  7084. *
  7085. * If the style value is falsy then it will be removed from the element
  7086. * (or assigned a different value depending if there are any styles placed
  7087. * on the element with `styleMap` or any static styles that are
  7088. * present from when the element was created with `styling`).
  7089. *
  7090. * Note that the styling element is updated as part of `stylingApply`.
  7091. *
  7092. * @param prop A valid CSS property.
  7093. * @param value New value to write (`null` or an empty string to remove).
  7094. * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.
  7095. *
  7096. * Note that this will apply the provided style value to the host element if this function is called
  7097. * within a host binding function.
  7098. *
  7099. * @codeGenApi
  7100. */
  7101. declare function ɵɵstyleProp(prop: string, value: string | number | SafeValue | undefined | null, suffix?: string | null): typeof ɵɵstyleProp;
  7102. /**
  7103. * Update a class binding on an element with the provided value.
  7104. *
  7105. * This instruction is meant to handle the `[class.foo]="exp"` case and,
  7106. * therefore, the class binding itself must already be allocated using
  7107. * `styling` within the creation block.
  7108. *
  7109. * @param prop A valid CSS class (only one).
  7110. * @param value A true/false value which will turn the class on or off.
  7111. *
  7112. * Note that this will apply the provided class value to the host element if this function
  7113. * is called within a host binding function.
  7114. *
  7115. * @codeGenApi
  7116. */
  7117. declare function ɵɵclassProp(className: string, value: boolean | undefined | null): typeof ɵɵclassProp;
  7118. /**
  7119. * Update style bindings using an object literal on an element.
  7120. *
  7121. * This instruction is meant to apply styling via the `[style]="exp"` template bindings.
  7122. * When styles are applied to the element they will then be updated with respect to
  7123. * any styles/classes set via `styleProp`. If any styles are set to falsy
  7124. * then they will be removed from the element.
  7125. *
  7126. * Note that the styling instruction will not be applied until `stylingApply` is called.
  7127. *
  7128. * @param styles A key/value style map of the styles that will be applied to the given element.
  7129. * Any missing styles (that have already been applied to the element beforehand) will be
  7130. * removed (unset) from the element's styling.
  7131. *
  7132. * Note that this will apply the provided styleMap value to the host element if this function
  7133. * is called within a host binding.
  7134. *
  7135. * @codeGenApi
  7136. */
  7137. declare function ɵɵstyleMap(styles: {
  7138. [styleName: string]: any;
  7139. } | string | undefined | null): void;
  7140. /**
  7141. * Update class bindings using an object literal or class-string on an element.
  7142. *
  7143. * This instruction is meant to apply styling via the `[class]="exp"` template bindings.
  7144. * When classes are applied to the element they will then be updated with
  7145. * respect to any styles/classes set via `classProp`. If any
  7146. * classes are set to falsy then they will be removed from the element.
  7147. *
  7148. * Note that the styling instruction will not be applied until `stylingApply` is called.
  7149. * Note that this will the provided classMap value to the host element if this function is called
  7150. * within a host binding.
  7151. *
  7152. * @param classes A key/value map or string of CSS classes that will be added to the
  7153. * given element. Any missing classes (that have already been applied to the element
  7154. * beforehand) will be removed (unset) from the element's list of CSS classes.
  7155. *
  7156. * @codeGenApi
  7157. */
  7158. declare function ɵɵclassMap(classes: {
  7159. [className: string]: boolean | undefined | null;
  7160. } | string | undefined | null): void;
  7161. /**
  7162. * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.
  7163. *
  7164. * <ng-template #foo>
  7165. * <div></div>
  7166. * </ng-template>
  7167. *
  7168. * @param index The index of the container in the data array
  7169. * @param templateFn Inline template
  7170. * @param decls The number of nodes, local refs, and pipes for this template
  7171. * @param vars The number of bindings for this template
  7172. * @param tagName The name of the container element, if applicable
  7173. * @param attrsIndex Index of template attributes in the `consts` array.
  7174. * @param localRefs Index of the local references in the `consts` array.
  7175. * @param localRefExtractor A function which extracts local-refs values from the template.
  7176. * Defaults to the current element associated with the local-ref.
  7177. *
  7178. * @codeGenApi
  7179. */
  7180. 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;
  7181. /**
  7182. * Creates an LContainer for an ng-template that cannot have directives.
  7183. *
  7184. * @param index The index of the container in the data array
  7185. * @param templateFn Inline template
  7186. * @param decls The number of nodes, local refs, and pipes for this template
  7187. * @param vars The number of bindings for this template
  7188. * @param tagName The name of the container element, if applicable
  7189. * @param attrsIndex Index of template attributes in the `consts` array.
  7190. * @param localRefs Index of the local references in the `consts` array.
  7191. * @param localRefExtractor A function which extracts local-refs values from the template.
  7192. * Defaults to the current element associated with the local-ref.
  7193. *
  7194. * @codeGenApi
  7195. */
  7196. declare function ɵɵdomTemplate(index: number, templateFn: ComponentTemplate<any> | null, decls: number, vars: number, tagName?: string | null, attrsIndex?: number | null, localRefsIndex?: number | null, localRefExtractor?: LocalRefExtractor): typeof ɵɵdomTemplate;
  7197. /**
  7198. * Create static text node
  7199. *
  7200. * @param index Index of the node in the data array
  7201. * @param value Static string value to write.
  7202. *
  7203. * @codeGenApi
  7204. */
  7205. declare function ɵɵtext(index: number, value?: string): void;
  7206. /**
  7207. *
  7208. * Update text content with a lone bound value
  7209. *
  7210. * Used when a text node has 1 interpolated value in it, an no additional text
  7211. * surrounds that interpolated value:
  7212. *
  7213. * ```html
  7214. * <div>{{v0}}</div>
  7215. * ```
  7216. *
  7217. * Its compiled representation is:
  7218. *
  7219. * ```ts
  7220. * ɵɵtextInterpolate(v0);
  7221. * ```
  7222. * @returns itself, so that it may be chained.
  7223. * @see textInterpolateV
  7224. * @codeGenApi
  7225. */
  7226. declare function ɵɵtextInterpolate(v0: any): typeof ɵɵtextInterpolate;
  7227. /**
  7228. *
  7229. * Update text content with single bound value surrounded by other text.
  7230. *
  7231. * Used when a text node has 1 interpolated value in it:
  7232. *
  7233. * ```html
  7234. * <div>prefix{{v0}}suffix</div>
  7235. * ```
  7236. *
  7237. * Its compiled representation is:
  7238. *
  7239. * ```ts
  7240. * ɵɵtextInterpolate1('prefix', v0, 'suffix');
  7241. * ```
  7242. * @returns itself, so that it may be chained.
  7243. * @see textInterpolateV
  7244. * @codeGenApi
  7245. */
  7246. declare function ɵɵtextInterpolate1(prefix: string, v0: any, suffix?: string): typeof ɵɵtextInterpolate1;
  7247. /**
  7248. *
  7249. * Update text content with 2 bound values surrounded by other text.
  7250. *
  7251. * Used when a text node has 2 interpolated values in it:
  7252. *
  7253. * ```html
  7254. * <div>prefix{{v0}}-{{v1}}suffix</div>
  7255. * ```
  7256. *
  7257. * Its compiled representation is:
  7258. *
  7259. * ```ts
  7260. * ɵɵtextInterpolate2('prefix', v0, '-', v1, 'suffix');
  7261. * ```
  7262. * @returns itself, so that it may be chained.
  7263. * @see textInterpolateV
  7264. * @codeGenApi
  7265. */
  7266. declare function ɵɵtextInterpolate2(prefix: string, v0: any, i0: string, v1: any, suffix?: string): typeof ɵɵtextInterpolate2;
  7267. /**
  7268. *
  7269. * Update text content with 3 bound values surrounded by other text.
  7270. *
  7271. * Used when a text node has 3 interpolated values in it:
  7272. *
  7273. * ```html
  7274. * <div>prefix{{v0}}-{{v1}}-{{v2}}suffix</div>
  7275. * ```
  7276. *
  7277. * Its compiled representation is:
  7278. *
  7279. * ```ts
  7280. * ɵɵtextInterpolate3(
  7281. * 'prefix', v0, '-', v1, '-', v2, 'suffix');
  7282. * ```
  7283. * @returns itself, so that it may be chained.
  7284. * @see textInterpolateV
  7285. * @codeGenApi
  7286. */
  7287. declare function ɵɵtextInterpolate3(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix?: string): typeof ɵɵtextInterpolate3;
  7288. /**
  7289. *
  7290. * Update text content with 4 bound values surrounded by other text.
  7291. *
  7292. * Used when a text node has 4 interpolated values in it:
  7293. *
  7294. * ```html
  7295. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix</div>
  7296. * ```
  7297. *
  7298. * Its compiled representation is:
  7299. *
  7300. * ```ts
  7301. * ɵɵtextInterpolate4(
  7302. * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
  7303. * ```
  7304. * @returns itself, so that it may be chained.
  7305. * @see ɵɵtextInterpolateV
  7306. * @codeGenApi
  7307. */
  7308. declare function ɵɵtextInterpolate4(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix?: string): typeof ɵɵtextInterpolate4;
  7309. /**
  7310. *
  7311. * Update text content with 5 bound values surrounded by other text.
  7312. *
  7313. * Used when a text node has 5 interpolated values in it:
  7314. *
  7315. * ```html
  7316. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix</div>
  7317. * ```
  7318. *
  7319. * Its compiled representation is:
  7320. *
  7321. * ```ts
  7322. * ɵɵtextInterpolate5(
  7323. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
  7324. * ```
  7325. * @returns itself, so that it may be chained.
  7326. * @see textInterpolateV
  7327. * @codeGenApi
  7328. */
  7329. 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;
  7330. /**
  7331. *
  7332. * Update text content with 6 bound values surrounded by other text.
  7333. *
  7334. * Used when a text node has 6 interpolated values in it:
  7335. *
  7336. * ```html
  7337. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix</div>
  7338. * ```
  7339. *
  7340. * Its compiled representation is:
  7341. *
  7342. * ```ts
  7343. * ɵɵtextInterpolate6(
  7344. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
  7345. * ```
  7346. *
  7347. * @param i4 Static value used for concatenation only.
  7348. * @param v5 Value checked for change. @returns itself, so that it may be chained.
  7349. * @see textInterpolateV
  7350. * @codeGenApi
  7351. */
  7352. 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;
  7353. /**
  7354. *
  7355. * Update text content with 7 bound values surrounded by other text.
  7356. *
  7357. * Used when a text node has 7 interpolated values in it:
  7358. *
  7359. * ```html
  7360. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix</div>
  7361. * ```
  7362. *
  7363. * Its compiled representation is:
  7364. *
  7365. * ```ts
  7366. * ɵɵtextInterpolate7(
  7367. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
  7368. * ```
  7369. * @returns itself, so that it may be chained.
  7370. * @see textInterpolateV
  7371. * @codeGenApi
  7372. */
  7373. 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;
  7374. /**
  7375. *
  7376. * Update text content with 8 bound values surrounded by other text.
  7377. *
  7378. * Used when a text node has 8 interpolated values in it:
  7379. *
  7380. * ```html
  7381. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix</div>
  7382. * ```
  7383. *
  7384. * Its compiled representation is:
  7385. *
  7386. * ```ts
  7387. * ɵɵtextInterpolate8(
  7388. * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
  7389. * ```
  7390. * @returns itself, so that it may be chained.
  7391. * @see textInterpolateV
  7392. * @codeGenApi
  7393. */
  7394. 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;
  7395. /**
  7396. * Update text content with 9 or more bound values other surrounded by text.
  7397. *
  7398. * Used when the number of interpolated values exceeds 8.
  7399. *
  7400. * ```html
  7401. * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix</div>
  7402. * ```
  7403. *
  7404. * Its compiled representation is:
  7405. *
  7406. * ```ts
  7407. * ɵɵtextInterpolateV(
  7408. * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
  7409. * 'suffix']);
  7410. * ```
  7411. *.
  7412. * @param values The collection of values and the strings in between those values, beginning with
  7413. * a string prefix and ending with a string suffix.
  7414. * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
  7415. *
  7416. * @returns itself, so that it may be chained.
  7417. * @codeGenApi
  7418. */
  7419. declare function ɵɵtextInterpolateV(values: any[]): typeof ɵɵtextInterpolateV;
  7420. /*!
  7421. * @license
  7422. * Copyright Google LLC All Rights Reserved.
  7423. *
  7424. * Use of this source code is governed by an MIT-style license that can be
  7425. * found in the LICENSE file at https://angular.dev/license
  7426. */
  7427. /**
  7428. * Update a two-way bound property on a selected element.
  7429. *
  7430. * Operates on the element selected by index via the {@link select} instruction.
  7431. *
  7432. * @param propName Name of property.
  7433. * @param value New value to write.
  7434. * @param sanitizer An optional function used to sanitize the value.
  7435. * @returns This function returns itself so that it may be chained
  7436. * (e.g. `twoWayProperty('name', ctx.name)('title', ctx.title)`)
  7437. *
  7438. * @codeGenApi
  7439. */
  7440. declare function ɵɵtwoWayProperty<T>(propName: string, value: T | WritableSignal<T>, sanitizer?: SanitizerFn | null): typeof ɵɵtwoWayProperty;
  7441. /**
  7442. * Function used inside two-way listeners to conditionally set the value of the bound expression.
  7443. *
  7444. * @param target Field on which to set the value.
  7445. * @param value Value to be set to the field.
  7446. *
  7447. * @codeGenApi
  7448. */
  7449. declare function ɵɵtwoWayBindingSet<T>(target: unknown, value: T): boolean;
  7450. /**
  7451. * Adds an event listener that updates a two-way binding to the current node.
  7452. *
  7453. * @param eventName Name of the event.
  7454. * @param listenerFn The function to be called when event emits.
  7455. *
  7456. * @codeGenApi
  7457. */
  7458. declare function ɵɵtwoWayListener(eventName: string, listenerFn: EventCallback): typeof ɵɵtwoWayListener;
  7459. /*!
  7460. * @license
  7461. * Copyright Google LLC All Rights Reserved.
  7462. *
  7463. * Use of this source code is governed by an MIT-style license that can be
  7464. * found in the LICENSE file at https://angular.dev/license
  7465. */
  7466. /**
  7467. * Declares an `@let` at a specific data slot. Returns itself to allow chaining.
  7468. *
  7469. * @param index Index at which to declare the `@let`.
  7470. *
  7471. * @codeGenApi
  7472. */
  7473. declare function ɵɵdeclareLet(index: number): typeof ɵɵdeclareLet;
  7474. /**
  7475. * Instruction that stores the value of a `@let` declaration on the current view.
  7476. * Returns the value to allow usage inside variable initializers.
  7477. *
  7478. * @codeGenApi
  7479. */
  7480. declare function ɵɵstoreLet<T>(value: T): T;
  7481. /**
  7482. * Retrieves the value of a `@let` declaration defined in a parent view.
  7483. *
  7484. * @param index Index of the declaration within the view.
  7485. *
  7486. * @codeGenApi
  7487. */
  7488. declare function ɵɵreadContextLet<T>(index: number): T;
  7489. /*!
  7490. * @license
  7491. * Copyright Google LLC All Rights Reserved.
  7492. *
  7493. * Use of this source code is governed by an MIT-style license that can be
  7494. * found in the LICENSE file at https://angular.dev/license
  7495. */
  7496. /**
  7497. * Sets the location within the source template at which
  7498. * each element in the current view was defined.
  7499. *
  7500. * @param index Index at which the DOM node was created.
  7501. * @param templatePath Path to the template at which the node was defined.
  7502. * @param locations Element locations to which to attach the source location.
  7503. *
  7504. * @codeGenApi
  7505. */
  7506. declare function ɵɵattachSourceLocations(templatePath: string, locations: [index: number, offset: number, line: number, column: number][]): void;
  7507. /*!
  7508. * @license
  7509. * Copyright Google LLC All Rights Reserved.
  7510. *
  7511. * Use of this source code is governed by an MIT-style license that can be
  7512. * found in the LICENSE file at https://angular.dev/license
  7513. */
  7514. /**
  7515. * Interpolate a value with a single bound value and no prefixes or suffixes.
  7516. *
  7517. * @param v0 Value checked for change.
  7518. * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.
  7519. * @codeGenApi
  7520. */
  7521. declare function ɵɵinterpolate(v0: any): string | NO_CHANGE;
  7522. /**
  7523. * Interpolate a value with a single bound value.
  7524. *
  7525. * @param prefix Static value used for concatenation only.
  7526. * @param v0 Value checked for change.
  7527. * @param suffix Static value used for concatenation only.
  7528. * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.
  7529. * @codeGenApi
  7530. */
  7531. declare function ɵɵinterpolate1(prefix: string, v0: any, suffix?: string): string | NO_CHANGE;
  7532. /**
  7533. * Interpolate a value with two bound values.
  7534. *
  7535. * @param prefix Static value used for concatenation only.
  7536. * @param v0 Value checked for change.
  7537. * @param i0 Static value used for concatenation only.
  7538. * @param v1 Value checked for change.
  7539. * @param suffix Static value used for concatenation only.
  7540. * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.
  7541. * @codeGenApi
  7542. */
  7543. declare function ɵɵinterpolate2(prefix: string, v0: any, i0: string, v1: any, suffix?: string): string | NO_CHANGE;
  7544. /**
  7545. * Interpolate a value with three bound values.
  7546. *
  7547. * @param prefix Static value used for concatenation only.
  7548. * @param v0 Value checked for change.
  7549. * @param i0 Static value used for concatenation only.
  7550. * @param v1 Value checked for change.
  7551. * @param i1 Static value used for concatenation only.
  7552. * @param v2 Value checked for change.
  7553. * @param suffix Static value used for concatenation only.
  7554. * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.
  7555. * @codeGenApi
  7556. */
  7557. declare function ɵɵinterpolate3(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix?: string): string | NO_CHANGE;
  7558. /**
  7559. * Interpolate a value with four bound values.
  7560. *
  7561. * @param prefix Static value used for concatenation only.
  7562. * @param v0 Value checked for change.
  7563. * @param i0 Static value used for concatenation only.
  7564. * @param v1 Value checked for change.
  7565. * @param i1 Static value used for concatenation only.
  7566. * @param v2 Value checked for change.
  7567. * @param i2 Static value used for concatenation only.
  7568. * @param v3 Value checked for change.
  7569. * @param suffix Static value used for concatenation only.
  7570. * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.
  7571. * @codeGenApi
  7572. */
  7573. declare function ɵɵinterpolate4(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix?: string): string | NO_CHANGE;
  7574. /**
  7575. * Interpolate a value with five bound values.
  7576. *
  7577. * @param prefix Static value used for concatenation only.
  7578. * @param v0 Value checked for change.
  7579. * @param i0 Static value used for concatenation only.
  7580. * @param v1 Value checked for change.
  7581. * @param i1 Static value used for concatenation only.
  7582. * @param v2 Value checked for change.
  7583. * @param i2 Static value used for concatenation only.
  7584. * @param v3 Value checked for change.
  7585. * @param i3 Static value used for concatenation only.
  7586. * @param v4 Value checked for change.
  7587. * @param suffix Static value used for concatenation only.
  7588. * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.
  7589. * @codeGenApi
  7590. */
  7591. declare function ɵɵinterpolate5(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, suffix?: string): string | NO_CHANGE;
  7592. /**
  7593. * Interpolate a value with six bound values.
  7594. *
  7595. * @param prefix Static value used for concatenation only.
  7596. * @param v0 Value checked for change.
  7597. * @param i0 Static value used for concatenation only.
  7598. * @param v1 Value checked for change.
  7599. * @param i1 Static value used for concatenation only.
  7600. * @param v2 Value checked for change.
  7601. * @param i2 Static value used for concatenation only.
  7602. * @param v3 Value checked for change.
  7603. * @param i3 Static value used for concatenation only.
  7604. * @param v4 Value checked for change.
  7605. * @param i4 Static value used for concatenation only.
  7606. * @param v5 Value checked for change.
  7607. * @param suffix Static value used for concatenation only.
  7608. * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.
  7609. * @codeGenApi
  7610. */
  7611. declare function ɵɵinterpolate6(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): string | NO_CHANGE;
  7612. /**
  7613. * Interpolate a value with seven bound values.
  7614. *
  7615. * @param prefix Static value used for concatenation only.
  7616. * @param v0 Value checked for change.
  7617. * @param i0 Static value used for concatenation only.
  7618. * @param v1 Value checked for change.
  7619. * @param i1 Static value used for concatenation only.
  7620. * @param v2 Value checked for change.
  7621. * @param i2 Static value used for concatenation only.
  7622. * @param v3 Value checked for change.
  7623. * @param i3 Static value used for concatenation only.
  7624. * @param v4 Value checked for change.
  7625. * @param i4 Static value used for concatenation only.
  7626. * @param v5 Value checked for change.
  7627. * @param i5 Static value used for concatenation only.
  7628. * @param v6 Value checked for change.
  7629. * @param suffix Static value used for concatenation only.
  7630. * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.
  7631. * @codeGenApi
  7632. */
  7633. declare function ɵɵinterpolate7(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): string | NO_CHANGE;
  7634. /**
  7635. * Interpolate a value with eight bound values.
  7636. *
  7637. * @param prefix Static value used for concatenation only.
  7638. * @param v0 Value checked for change.
  7639. * @param i0 Static value used for concatenation only.
  7640. * @param v1 Value checked for change.
  7641. * @param i1 Static value used for concatenation only.
  7642. * @param v2 Value checked for change.
  7643. * @param i2 Static value used for concatenation only.
  7644. * @param v3 Value checked for change.
  7645. * @param i3 Static value used for concatenation only.
  7646. * @param v4 Value checked for change.
  7647. * @param i4 Static value used for concatenation only.
  7648. * @param v5 Value checked for change.
  7649. * @param i5 Static value used for concatenation only.
  7650. * @param v6 Value checked for change.
  7651. * @param i6 Static value used for concatenation only.
  7652. * @param v7 Value checked for change.
  7653. * @param suffix Static value used for concatenation only.
  7654. * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.
  7655. * @codeGenApi
  7656. */
  7657. declare function ɵɵinterpolate8(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): string | NO_CHANGE;
  7658. /**
  7659. * Interpolate a value with nine or more bound values.
  7660. *
  7661. * @param values The collection of values and the strings in-between those values, beginning with
  7662. * a string prefix and ending with a string suffix.
  7663. * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
  7664. * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.
  7665. * @codeGenApi
  7666. */
  7667. declare function ɵɵinterpolateV(values: unknown[]): string | NO_CHANGE;
  7668. /**
  7669. * Create a pipe.
  7670. *
  7671. * @param index Pipe index where the pipe will be stored.
  7672. * @param pipeName The name of the pipe
  7673. * @returns T the instance of the pipe.
  7674. *
  7675. * @codeGenApi
  7676. */
  7677. declare function ɵɵpipe(index: number, pipeName: string): any;
  7678. /**
  7679. * Invokes a pipe with 1 arguments.
  7680. *
  7681. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  7682. * the pipe only when an input to the pipe changes.
  7683. *
  7684. * @param index Pipe index where the pipe was stored on creation.
  7685. * @param offset the binding offset
  7686. * @param v1 1st argument to {@link PipeTransform#transform}.
  7687. *
  7688. * @codeGenApi
  7689. */
  7690. declare function ɵɵpipeBind1(index: number, offset: number, v1: any): any;
  7691. /**
  7692. * Invokes a pipe with 2 arguments.
  7693. *
  7694. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  7695. * the pipe only when an input to the pipe changes.
  7696. *
  7697. * @param index Pipe index where the pipe was stored on creation.
  7698. * @param slotOffset the offset in the reserved slot space
  7699. * @param v1 1st argument to {@link PipeTransform#transform}.
  7700. * @param v2 2nd argument to {@link PipeTransform#transform}.
  7701. *
  7702. * @codeGenApi
  7703. */
  7704. declare function ɵɵpipeBind2(index: number, slotOffset: number, v1: any, v2: any): any;
  7705. /**
  7706. * Invokes a pipe with 3 arguments.
  7707. *
  7708. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  7709. * the pipe only when an input to the pipe changes.
  7710. *
  7711. * @param index Pipe index where the pipe was stored on creation.
  7712. * @param slotOffset the offset in the reserved slot space
  7713. * @param v1 1st argument to {@link PipeTransform#transform}.
  7714. * @param v2 2nd argument to {@link PipeTransform#transform}.
  7715. * @param v3 4rd argument to {@link PipeTransform#transform}.
  7716. *
  7717. * @codeGenApi
  7718. */
  7719. declare function ɵɵpipeBind3(index: number, slotOffset: number, v1: any, v2: any, v3: any): any;
  7720. /**
  7721. * Invokes a pipe with 4 arguments.
  7722. *
  7723. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  7724. * the pipe only when an input to the pipe changes.
  7725. *
  7726. * @param index Pipe index where the pipe was stored on creation.
  7727. * @param slotOffset the offset in the reserved slot space
  7728. * @param v1 1st argument to {@link PipeTransform#transform}.
  7729. * @param v2 2nd argument to {@link PipeTransform#transform}.
  7730. * @param v3 3rd argument to {@link PipeTransform#transform}.
  7731. * @param v4 4th argument to {@link PipeTransform#transform}.
  7732. *
  7733. * @codeGenApi
  7734. */
  7735. declare function ɵɵpipeBind4(index: number, slotOffset: number, v1: any, v2: any, v3: any, v4: any): any;
  7736. /**
  7737. * Invokes a pipe with variable number of arguments.
  7738. *
  7739. * This instruction acts as a guard to {@link PipeTransform#transform} invoking
  7740. * the pipe only when an input to the pipe changes.
  7741. *
  7742. * @param index Pipe index where the pipe was stored on creation.
  7743. * @param slotOffset the offset in the reserved slot space
  7744. * @param values Array of arguments to pass to {@link PipeTransform#transform} method.
  7745. *
  7746. * @codeGenApi
  7747. */
  7748. declare function ɵɵpipeBindV(index: number, slotOffset: number, values: [any, ...any[]]): any;
  7749. /**
  7750. * Bindings for pure functions are stored after regular bindings.
  7751. *
  7752. * |-------decls------|---------vars---------| |----- hostVars (dir1) ------|
  7753. * ------------------------------------------------------------------------------------------
  7754. * | nodes/refs/pipes | bindings | fn slots | injector | dir1 | host bindings | host slots |
  7755. * ------------------------------------------------------------------------------------------
  7756. * ^ ^
  7757. * TView.bindingStartIndex TView.expandoStartIndex
  7758. *
  7759. * Pure function instructions are given an offset from the binding root. Adding the offset to the
  7760. * binding root gives the first index where the bindings are stored. In component views, the binding
  7761. * root is the bindingStartIndex. In host bindings, the binding root is the expandoStartIndex +
  7762. * any directive instances + any hostVars in directives evaluated before it.
  7763. *
  7764. * See VIEW_DATA.md for more information about host binding resolution.
  7765. */
  7766. /**
  7767. * If the value hasn't been saved, calls the pure function to store and return the
  7768. * value. If it has been saved, returns the saved value.
  7769. *
  7770. * @param slotOffset the offset from binding root to the reserved slot
  7771. * @param pureFn Function that returns a value
  7772. * @param thisArg Optional calling context of pureFn
  7773. * @returns value
  7774. *
  7775. * @codeGenApi
  7776. */
  7777. declare function ɵɵpureFunction0<T>(slotOffset: number, pureFn: () => T, thisArg?: any): T;
  7778. /**
  7779. * If the value of the provided exp has changed, calls the pure function to return
  7780. * an updated value. Or if the value has not changed, returns cached value.
  7781. *
  7782. * @param slotOffset the offset from binding root to the reserved slot
  7783. * @param pureFn Function that returns an updated value
  7784. * @param exp Updated expression value
  7785. * @param thisArg Optional calling context of pureFn
  7786. * @returns Updated or cached value
  7787. *
  7788. * @codeGenApi
  7789. */
  7790. declare function ɵɵpureFunction1(slotOffset: number, pureFn: (v: any) => any, exp: any, thisArg?: any): any;
  7791. /**
  7792. * If the value of any provided exp has changed, calls the pure function to return
  7793. * an updated value. Or if no values have changed, returns cached value.
  7794. *
  7795. * @param slotOffset the offset from binding root to the reserved slot
  7796. * @param pureFn
  7797. * @param exp1
  7798. * @param exp2
  7799. * @param thisArg Optional calling context of pureFn
  7800. * @returns Updated or cached value
  7801. *
  7802. * @codeGenApi
  7803. */
  7804. declare function ɵɵpureFunction2(slotOffset: number, pureFn: (v1: any, v2: any) => any, exp1: any, exp2: any, thisArg?: any): any;
  7805. /**
  7806. * If the value of any provided exp has changed, calls the pure function to return
  7807. * an updated value. Or if no values have changed, returns cached value.
  7808. *
  7809. * @param slotOffset the offset from binding root to the reserved slot
  7810. * @param pureFn
  7811. * @param exp1
  7812. * @param exp2
  7813. * @param exp3
  7814. * @param thisArg Optional calling context of pureFn
  7815. * @returns Updated or cached value
  7816. *
  7817. * @codeGenApi
  7818. */
  7819. declare function ɵɵpureFunction3(slotOffset: number, pureFn: (v1: any, v2: any, v3: any) => any, exp1: any, exp2: any, exp3: any, thisArg?: any): any;
  7820. /**
  7821. * If the value of any provided exp has changed, calls the pure function to return
  7822. * an updated value. Or if no values have changed, returns cached value.
  7823. *
  7824. * @param slotOffset the offset from binding root to the reserved slot
  7825. * @param pureFn
  7826. * @param exp1
  7827. * @param exp2
  7828. * @param exp3
  7829. * @param exp4
  7830. * @param thisArg Optional calling context of pureFn
  7831. * @returns Updated or cached value
  7832. *
  7833. * @codeGenApi
  7834. */
  7835. 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;
  7836. /**
  7837. * If the value of any provided exp has changed, calls the pure function to return
  7838. * an updated value. Or if no values have changed, returns cached value.
  7839. *
  7840. * @param slotOffset the offset from binding root to the reserved slot
  7841. * @param pureFn
  7842. * @param exp1
  7843. * @param exp2
  7844. * @param exp3
  7845. * @param exp4
  7846. * @param exp5
  7847. * @param thisArg Optional calling context of pureFn
  7848. * @returns Updated or cached value
  7849. *
  7850. * @codeGenApi
  7851. */
  7852. 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;
  7853. /**
  7854. * If the value of any provided exp has changed, calls the pure function to return
  7855. * an updated value. Or if no values have changed, returns cached value.
  7856. *
  7857. * @param slotOffset the offset from binding root to the reserved slot
  7858. * @param pureFn
  7859. * @param exp1
  7860. * @param exp2
  7861. * @param exp3
  7862. * @param exp4
  7863. * @param exp5
  7864. * @param exp6
  7865. * @param thisArg Optional calling context of pureFn
  7866. * @returns Updated or cached value
  7867. *
  7868. * @codeGenApi
  7869. */
  7870. 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;
  7871. /**
  7872. * If the value of any provided exp has changed, calls the pure function to return
  7873. * an updated value. Or if no values have changed, returns cached value.
  7874. *
  7875. * @param slotOffset the offset from binding root to the reserved slot
  7876. * @param pureFn
  7877. * @param exp1
  7878. * @param exp2
  7879. * @param exp3
  7880. * @param exp4
  7881. * @param exp5
  7882. * @param exp6
  7883. * @param exp7
  7884. * @param thisArg Optional calling context of pureFn
  7885. * @returns Updated or cached value
  7886. *
  7887. * @codeGenApi
  7888. */
  7889. 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;
  7890. /**
  7891. * If the value of any provided exp has changed, calls the pure function to return
  7892. * an updated value. Or if no values have changed, returns cached value.
  7893. *
  7894. * @param slotOffset the offset from binding root to the reserved slot
  7895. * @param pureFn
  7896. * @param exp1
  7897. * @param exp2
  7898. * @param exp3
  7899. * @param exp4
  7900. * @param exp5
  7901. * @param exp6
  7902. * @param exp7
  7903. * @param exp8
  7904. * @param thisArg Optional calling context of pureFn
  7905. * @returns Updated or cached value
  7906. *
  7907. * @codeGenApi
  7908. */
  7909. 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;
  7910. /**
  7911. * pureFunction instruction that can support any number of bindings.
  7912. *
  7913. * If the value of any provided exp has changed, calls the pure function to return
  7914. * an updated value. Or if no values have changed, returns cached value.
  7915. *
  7916. * @param slotOffset the offset from binding root to the reserved slot
  7917. * @param pureFn A pure function that takes binding values and builds an object or array
  7918. * containing those values.
  7919. * @param exps An array of binding values
  7920. * @param thisArg Optional calling context of pureFn
  7921. * @returns Updated or cached value
  7922. *
  7923. * @codeGenApi
  7924. */
  7925. declare function ɵɵpureFunctionV(slotOffset: number, pureFn: (...v: any[]) => any, exps: any[], thisArg?: any): any;
  7926. /**
  7927. *
  7928. * @codeGenApi
  7929. */
  7930. declare function ɵɵresolveWindow(element: RElement & {
  7931. ownerDocument: Document;
  7932. }): (Window & typeof globalThis) | null;
  7933. /**
  7934. *
  7935. * @codeGenApi
  7936. */
  7937. declare function ɵɵresolveDocument(element: RElement & {
  7938. ownerDocument: Document;
  7939. }): Document;
  7940. /**
  7941. *
  7942. * @codeGenApi
  7943. */
  7944. declare function ɵɵresolveBody(element: RElement & {
  7945. ownerDocument: Document;
  7946. }): HTMLElement;
  7947. /**
  7948. * Retrieves `TemplateRef` instance from `Injector` when a local reference is placed on the
  7949. * `<ng-template>` element.
  7950. *
  7951. * @codeGenApi
  7952. */
  7953. declare function ɵɵtemplateRefExtractor(tNode: TNode, lView: LView): TemplateRef<any> | null;
  7954. declare function ɵɵgetComponentDepsFactory(type: ComponentType<any>, rawImports?: RawScopeInfoFromDecorator[]): () => DependencyTypeList;
  7955. /**
  7956. * Sets the debug info for an Angular class.
  7957. *
  7958. * This runtime is guarded by ngDevMode flag.
  7959. */
  7960. declare function ɵsetClassDebugInfo(type: Type$1<any>, debugInfo: ClassDebugInfo): void;
  7961. /*!
  7962. * @license
  7963. * Copyright Google LLC All Rights Reserved.
  7964. *
  7965. * Use of this source code is governed by an MIT-style license that can be
  7966. * found in the LICENSE file at https://angular.dev/license
  7967. */
  7968. /** Represents `import.meta` plus some information that's not in the built-in types. */
  7969. type ImportMetaExtended = ImportMeta & {
  7970. hot?: {
  7971. send?: (name: string, payload: unknown) => void;
  7972. };
  7973. };
  7974. /**
  7975. * Gets the URL from which the client will fetch a new version of a component's metadata so it
  7976. * can be replaced during hot module reloading.
  7977. * @param id Unique ID for the component, generated during compile time.
  7978. * @param timestamp Time at which the request happened.
  7979. * @param base Base URL against which to resolve relative paths.
  7980. * @codeGenApi
  7981. */
  7982. declare function ɵɵgetReplaceMetadataURL(id: string, timestamp: string, base: string): string;
  7983. /**
  7984. * Replaces the metadata of a component type and re-renders all live instances of the component.
  7985. * @param type Class whose metadata will be replaced.
  7986. * @param applyMetadata Callback that will apply a new set of metadata on the `type` when invoked.
  7987. * @param environment Syntehtic namespace imports that need to be passed along to the callback.
  7988. * @param locals Local symbols from the source location that have to be exposed to the callback.
  7989. * @param importMeta `import.meta` from the call site of the replacement function. Optional since
  7990. * it isn't used internally.
  7991. * @param id ID to the class being replaced. **Not** the same as the component definition ID.
  7992. * Optional since the ID might not be available internally.
  7993. * @codeGenApi
  7994. */
  7995. 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;
  7996. /** Store a value in the `data` at a given `index`. */
  7997. declare function store<T>(tView: TView, lView: LView, index: number, value: T): void;
  7998. type Type = Function;
  7999. type OpaqueValue = unknown;
  8000. declare enum FactoryTarget {
  8001. Directive = 0,
  8002. Component = 1,
  8003. Injectable = 2,
  8004. Pipe = 3,
  8005. NgModule = 4
  8006. }
  8007. interface R3DeclareDependencyMetadataFacade {
  8008. token: OpaqueValue;
  8009. attribute?: boolean;
  8010. host?: boolean;
  8011. optional?: boolean;
  8012. self?: boolean;
  8013. skipSelf?: boolean;
  8014. }
  8015. interface R3HostDirectiveMetadataFacade {
  8016. directive: Type;
  8017. inputs?: string[];
  8018. outputs?: string[];
  8019. }
  8020. type LegacyInputPartialMapping = string | [bindingPropertyName: string, classPropertyName: string, transformFunction?: Function];
  8021. interface R3DeclareDirectiveFacade {
  8022. selector?: string;
  8023. type: Type;
  8024. version: string;
  8025. inputs?: {
  8026. [fieldName: string]: {
  8027. classPropertyName: string;
  8028. publicName: string;
  8029. isSignal: boolean;
  8030. isRequired: boolean;
  8031. transformFunction: Function | null;
  8032. } | LegacyInputPartialMapping;
  8033. };
  8034. outputs?: {
  8035. [classPropertyName: string]: string;
  8036. };
  8037. host?: {
  8038. attributes?: {
  8039. [key: string]: OpaqueValue;
  8040. };
  8041. listeners?: {
  8042. [key: string]: string;
  8043. };
  8044. properties?: {
  8045. [key: string]: string;
  8046. };
  8047. classAttribute?: string;
  8048. styleAttribute?: string;
  8049. };
  8050. queries?: R3DeclareQueryMetadataFacade[];
  8051. viewQueries?: R3DeclareQueryMetadataFacade[];
  8052. providers?: OpaqueValue;
  8053. exportAs?: string[];
  8054. usesInheritance?: boolean;
  8055. usesOnChanges?: boolean;
  8056. isStandalone?: boolean;
  8057. hostDirectives?: R3HostDirectiveMetadataFacade[] | null;
  8058. isSignal?: boolean;
  8059. }
  8060. interface R3DeclareComponentFacade extends R3DeclareDirectiveFacade {
  8061. template: string;
  8062. isInline?: boolean;
  8063. styles?: string[];
  8064. dependencies?: R3DeclareTemplateDependencyFacade[];
  8065. components?: R3DeclareDirectiveDependencyFacade[];
  8066. directives?: R3DeclareDirectiveDependencyFacade[];
  8067. pipes?: {
  8068. [pipeName: string]: OpaqueValue | (() => OpaqueValue);
  8069. };
  8070. deferBlockDependencies?: (() => Promise<Type> | null)[];
  8071. viewProviders?: OpaqueValue;
  8072. animations?: OpaqueValue;
  8073. changeDetection?: ChangeDetectionStrategy;
  8074. encapsulation?: ViewEncapsulation;
  8075. interpolation?: [string, string];
  8076. preserveWhitespaces?: boolean;
  8077. }
  8078. type R3DeclareTemplateDependencyFacade = {
  8079. kind: string;
  8080. } & (R3DeclareDirectiveDependencyFacade | R3DeclarePipeDependencyFacade | R3DeclareNgModuleDependencyFacade);
  8081. interface R3DeclareDirectiveDependencyFacade {
  8082. kind?: 'directive' | 'component';
  8083. selector: string;
  8084. type: OpaqueValue | (() => OpaqueValue);
  8085. inputs?: string[];
  8086. outputs?: string[];
  8087. exportAs?: string[];
  8088. }
  8089. interface R3DeclarePipeDependencyFacade {
  8090. kind?: 'pipe';
  8091. name: string;
  8092. type: OpaqueValue | (() => OpaqueValue);
  8093. }
  8094. interface R3DeclareNgModuleDependencyFacade {
  8095. kind: 'ngmodule';
  8096. type: OpaqueValue | (() => OpaqueValue);
  8097. }
  8098. interface R3DeclareFactoryFacade {
  8099. type: Type;
  8100. deps: R3DeclareDependencyMetadataFacade[] | 'invalid' | null;
  8101. target: FactoryTarget;
  8102. }
  8103. interface R3DeclareInjectableFacade {
  8104. type: Type;
  8105. providedIn?: Type | 'root' | 'platform' | 'any' | null;
  8106. useClass?: OpaqueValue;
  8107. useFactory?: OpaqueValue;
  8108. useExisting?: OpaqueValue;
  8109. useValue?: OpaqueValue;
  8110. deps?: R3DeclareDependencyMetadataFacade[];
  8111. }
  8112. declare enum ViewEncapsulation {
  8113. Emulated = 0,
  8114. None = 2,
  8115. ShadowDom = 3
  8116. }
  8117. type ChangeDetectionStrategy = number;
  8118. interface R3DeclareQueryMetadataFacade {
  8119. propertyName: string;
  8120. first?: boolean;
  8121. predicate: OpaqueValue | string[];
  8122. descendants?: boolean;
  8123. read?: OpaqueValue;
  8124. static?: boolean;
  8125. emitDistinctChangesOnly?: boolean;
  8126. isSignal?: boolean;
  8127. }
  8128. interface R3DeclareInjectorFacade {
  8129. type: Type;
  8130. imports?: OpaqueValue[];
  8131. providers?: OpaqueValue[];
  8132. }
  8133. interface R3DeclareNgModuleFacade {
  8134. type: Type;
  8135. bootstrap?: OpaqueValue[] | (() => OpaqueValue[]);
  8136. declarations?: OpaqueValue[] | (() => OpaqueValue[]);
  8137. imports?: OpaqueValue[] | (() => OpaqueValue[]);
  8138. exports?: OpaqueValue[] | (() => OpaqueValue[]);
  8139. schemas?: OpaqueValue[];
  8140. id?: OpaqueValue;
  8141. }
  8142. interface R3DeclarePipeFacade {
  8143. type: Type;
  8144. name: string;
  8145. version: string;
  8146. pure?: boolean;
  8147. isStandalone?: boolean;
  8148. }
  8149. /**
  8150. * Compile an Angular component according to its decorator metadata, and patch the resulting
  8151. * component def (ɵcmp) onto the component type.
  8152. *
  8153. * Compilation may be asynchronous (due to the need to resolve URLs for the component template or
  8154. * other resources, for example). In the event that compilation is not immediate, `compileComponent`
  8155. * will enqueue resource resolution into a global queue and will fail to return the `ɵcmp`
  8156. * until the global queue has been resolved with a call to `resolveComponentResources`.
  8157. */
  8158. declare function compileComponent(type: Type$1<any>, metadata: Component): void;
  8159. /**
  8160. * Compile an Angular directive according to its decorator metadata, and patch the resulting
  8161. * directive def onto the component type.
  8162. *
  8163. * In the event that compilation is not immediate, `compileDirective` will return a `Promise` which
  8164. * will resolve when compilation completes and the directive becomes usable.
  8165. */
  8166. declare function compileDirective(type: Type$1<any>, directive: Directive | null): void;
  8167. declare function resetJitOptions(): void;
  8168. /**
  8169. * Loops over queued module definitions, if a given module definition has all of its
  8170. * declarations resolved, it dequeues that module definition and sets the scope on
  8171. * its declarations.
  8172. */
  8173. declare function flushModuleScopingQueueAsMuchAsPossible(): void;
  8174. /**
  8175. * Compiles a module in JIT mode.
  8176. *
  8177. * This function automatically gets called when a class has a `@NgModule` decorator.
  8178. */
  8179. declare function compileNgModule(moduleType: Type$1<any>, ngModule?: NgModule): void;
  8180. /**
  8181. * Compiles and adds the `ɵmod`, `ɵfac` and `ɵinj` properties to the module class.
  8182. *
  8183. * It's possible to compile a module via this API which will allow duplicate declarations in its
  8184. * root.
  8185. */
  8186. declare function compileNgModuleDefs(moduleType: NgModuleType, ngModule: NgModule, allowDuplicateDeclarationsInRoot?: boolean): void;
  8187. declare function generateStandaloneInDeclarationsError(type: Type$1<any>, location: string): string;
  8188. declare function resetCompiledComponents(): void;
  8189. /**
  8190. * Patch the definition of a component with directives and pipes from the compilation scope of
  8191. * a given module.
  8192. */
  8193. declare function patchComponentDefWithScope<C>(componentDef: ComponentDef<C>, transitiveScopes: NgModuleTransitiveScopes): void;
  8194. /**
  8195. * Compute the pair of transitive scopes (compilation scope and exported scope) for a given type
  8196. * (either a NgModule or a standalone component / directive / pipe).
  8197. */
  8198. declare function transitiveScopesFor<T>(type: Type$1<T>): NgModuleTransitiveScopes;
  8199. /**
  8200. * Compiles a partial directive declaration object into a full directive definition object.
  8201. *
  8202. * @codeGenApi
  8203. */
  8204. declare function ɵɵngDeclareDirective(decl: R3DeclareDirectiveFacade): unknown;
  8205. /**
  8206. * Evaluates the class metadata declaration.
  8207. *
  8208. * @codeGenApi
  8209. */
  8210. declare function ɵɵngDeclareClassMetadata(decl: {
  8211. type: Type$1<any>;
  8212. decorators: any[];
  8213. ctorParameters?: () => any[];
  8214. propDecorators?: {
  8215. [field: string]: any;
  8216. };
  8217. }): void;
  8218. /**
  8219. * Evaluates the class metadata of a component that contains deferred blocks.
  8220. *
  8221. * @codeGenApi
  8222. */
  8223. declare function ɵɵngDeclareClassMetadataAsync(decl: {
  8224. type: Type$1<any>;
  8225. resolveDeferredDeps: () => Promise<Type$1<unknown>>[];
  8226. resolveMetadata: (...types: Type$1<unknown>[]) => {
  8227. decorators: any[];
  8228. ctorParameters: (() => any[]) | null;
  8229. propDecorators: {
  8230. [field: string]: any;
  8231. } | null;
  8232. };
  8233. }): void;
  8234. /**
  8235. * Compiles a partial component declaration object into a full component definition object.
  8236. *
  8237. * @codeGenApi
  8238. */
  8239. declare function ɵɵngDeclareComponent(decl: R3DeclareComponentFacade): unknown;
  8240. /**
  8241. * Compiles a partial pipe declaration object into a full pipe definition object.
  8242. *
  8243. * @codeGenApi
  8244. */
  8245. declare function ɵɵngDeclareFactory(decl: R3DeclareFactoryFacade): unknown;
  8246. /**
  8247. * Compiles a partial injectable declaration object into a full injectable definition object.
  8248. *
  8249. * @codeGenApi
  8250. */
  8251. declare function ɵɵngDeclareInjectable(decl: R3DeclareInjectableFacade): unknown;
  8252. /**
  8253. * Compiles a partial injector declaration object into a full injector definition object.
  8254. *
  8255. * @codeGenApi
  8256. */
  8257. declare function ɵɵngDeclareInjector(decl: R3DeclareInjectorFacade): unknown;
  8258. /**
  8259. * Compiles a partial NgModule declaration object into a full NgModule definition object.
  8260. *
  8261. * @codeGenApi
  8262. */
  8263. declare function ɵɵngDeclareNgModule(decl: R3DeclareNgModuleFacade): unknown;
  8264. /**
  8265. * Compiles a partial pipe declaration object into a full pipe definition object.
  8266. *
  8267. * @codeGenApi
  8268. */
  8269. declare function ɵɵngDeclarePipe(decl: R3DeclarePipeFacade): unknown;
  8270. declare function compilePipe(type: Type$1<any>, meta: Pipe): void;
  8271. declare function isNgModule<T>(value: Type$1<T>): value is Type$1<T> & {
  8272. ɵmod: NgModuleDef<T>;
  8273. };
  8274. /*!
  8275. * @license
  8276. * Copyright Google LLC All Rights Reserved.
  8277. *
  8278. * Use of this source code is governed by an MIT-style license that can be
  8279. * found in the LICENSE file at https://angular.dev/license
  8280. */
  8281. /**
  8282. * Profiler events is an enum used by the profiler to distinguish between different calls of user
  8283. * code invoked throughout the application lifecycle.
  8284. */
  8285. declare const enum ProfilerEvent {
  8286. /**
  8287. * Corresponds to the point in time before the runtime has called the template function of a
  8288. * component with `RenderFlags.Create`.
  8289. */
  8290. TemplateCreateStart = 0,
  8291. /**
  8292. * Corresponds to the point in time after the runtime has called the template function of a
  8293. * component with `RenderFlags.Create`.
  8294. */
  8295. TemplateCreateEnd = 1,
  8296. /**
  8297. * Corresponds to the point in time before the runtime has called the template function of a
  8298. * component with `RenderFlags.Update`.
  8299. */
  8300. TemplateUpdateStart = 2,
  8301. /**
  8302. * Corresponds to the point in time after the runtime has called the template function of a
  8303. * component with `RenderFlags.Update`.
  8304. */
  8305. TemplateUpdateEnd = 3,
  8306. /**
  8307. * Corresponds to the point in time before the runtime has called a lifecycle hook of a component
  8308. * or directive.
  8309. */
  8310. LifecycleHookStart = 4,
  8311. /**
  8312. * Corresponds to the point in time after the runtime has called a lifecycle hook of a component
  8313. * or directive.
  8314. */
  8315. LifecycleHookEnd = 5,
  8316. /**
  8317. * Corresponds to the point in time before the runtime has evaluated an expression associated with
  8318. * an event or an output.
  8319. */
  8320. OutputStart = 6,
  8321. /**
  8322. * Corresponds to the point in time after the runtime has evaluated an expression associated with
  8323. * an event or an output.
  8324. */
  8325. OutputEnd = 7,
  8326. /**
  8327. * Corresponds to the point in time just before application bootstrap.
  8328. */
  8329. BootstrapApplicationStart = 8,
  8330. /**
  8331. * Corresponds to the point in time after application bootstrap.
  8332. */
  8333. BootstrapApplicationEnd = 9,
  8334. /**
  8335. * Corresponds to the point in time just before root component bootstrap.
  8336. */
  8337. BootstrapComponentStart = 10,
  8338. /**
  8339. * Corresponds to the point in time after root component bootstrap.
  8340. */
  8341. BootstrapComponentEnd = 11,
  8342. /**
  8343. * Corresponds to the point in time just before Angular starts a change detection tick.
  8344. */
  8345. ChangeDetectionStart = 12,
  8346. /**
  8347. * Corresponds to the point in time after Angular ended a change detection tick.
  8348. */
  8349. ChangeDetectionEnd = 13,
  8350. /**
  8351. * Corresponds to the point in time just before Angular starts a new synchronization pass of change detection tick.
  8352. */
  8353. ChangeDetectionSyncStart = 14,
  8354. /**
  8355. * Corresponds to the point in time after Angular ended a synchronization pass.
  8356. */
  8357. ChangeDetectionSyncEnd = 15,
  8358. /**
  8359. * Corresponds to the point in time just before Angular executes after render hooks.
  8360. */
  8361. AfterRenderHooksStart = 16,
  8362. /**
  8363. * Corresponds to the point in time after Angular executed after render hooks.
  8364. */
  8365. AfterRenderHooksEnd = 17,
  8366. /**
  8367. * Corresponds to the point in time just before Angular starts processing a component (create or update).
  8368. */
  8369. ComponentStart = 18,
  8370. /**
  8371. * Corresponds to the point in time after Angular finished processing a component.
  8372. */
  8373. ComponentEnd = 19,
  8374. /**
  8375. * Corresponds to the point in time just before a defer block transitions between states.
  8376. */
  8377. DeferBlockStateStart = 20,
  8378. /**
  8379. * Corresponds to the point in time after a defer block transitioned between states.
  8380. */
  8381. DeferBlockStateEnd = 21,
  8382. /**
  8383. * Corresponds to the point in time just before a component instance is created dynamically.
  8384. */
  8385. DynamicComponentStart = 22,
  8386. /**
  8387. * Corresponds to the point in time after a a component instance is created dynamically.
  8388. */
  8389. DynamicComponentEnd = 23,
  8390. /**
  8391. * Corresponds to the point in time before the runtime has called the host bindings function
  8392. * of a directive.
  8393. */
  8394. HostBindingsUpdateStart = 24,
  8395. /**
  8396. * Corresponds to the point in time after the runtime has called the host bindings function
  8397. * of a directive.
  8398. */
  8399. HostBindingsUpdateEnd = 25
  8400. }
  8401. /**
  8402. * Profiler function which the runtime will invoke before and after user code.
  8403. */
  8404. interface Profiler {
  8405. (event: ProfilerEvent, instance?: {} | null, eventFn?: Function): void;
  8406. }
  8407. /**
  8408. * Adds a callback function which will be invoked before and after performing certain actions at
  8409. * runtime (for example, before and after running change detection). Multiple profiler callbacks can be set:
  8410. * in this case profiling events are reported to every registered callback.
  8411. *
  8412. * Warning: this function is *INTERNAL* and should not be relied upon in application's code.
  8413. * The contract of the function might be changed in any release and/or the function can be removed
  8414. * completely.
  8415. *
  8416. * @param profiler function provided by the caller or null value to disable all profilers.
  8417. * @returns a cleanup function that, when invoked, removes a given profiler callback.
  8418. */
  8419. declare function setProfiler(profiler: Profiler | null): () => void;
  8420. /**
  8421. * Marks a component for check (in case of OnPush components) and synchronously
  8422. * performs change detection on the application this component belongs to.
  8423. *
  8424. * @param component Component to {@link /api/core/ChangeDetectorRef#markForCheck mark for check}
  8425. *
  8426. * @publicApi
  8427. */
  8428. declare function applyChanges(component: {}): void;
  8429. /*!
  8430. * @license
  8431. * Copyright Google LLC All Rights Reserved.
  8432. *
  8433. * Use of this source code is governed by an MIT-style license that can be
  8434. * found in the LICENSE file at https://angular.dev/license
  8435. */
  8436. /** Retrieved information about a `@defer` block. */
  8437. interface DeferBlockData {
  8438. /** Current state of the block. */
  8439. state: 'placeholder' | 'loading' | 'complete' | 'error' | 'initial';
  8440. /** Hydration state of the block. */
  8441. incrementalHydrationState: 'not-configured' | 'hydrated' | 'dehydrated';
  8442. /** Wherther the block has a connected `@error` block. */
  8443. hasErrorBlock: boolean;
  8444. /** Information about the connected `@loading` block. */
  8445. loadingBlock: {
  8446. /** Whether the block is defined. */
  8447. exists: boolean;
  8448. /** Minimum amount of milliseconds that the block should be shown. */
  8449. minimumTime: number | null;
  8450. /** Amount of time after which the block should be shown. */
  8451. afterTime: number | null;
  8452. };
  8453. /** Information about the connected `@placeholder` block. */
  8454. placeholderBlock: {
  8455. /** Whether the block is defined. */
  8456. exists: boolean;
  8457. /** Minimum amount of time that block should be shown. */
  8458. minimumTime: number | null;
  8459. };
  8460. /** Stringified version of the block's triggers. */
  8461. triggers: string[];
  8462. /** Element root nodes that are currently being shown in the block. */
  8463. rootNodes: Node[];
  8464. }
  8465. /**
  8466. * Gets all of the `@defer` blocks that are present inside the specified DOM node.
  8467. * @param node Node in which to look for `@defer` blocks.
  8468. *
  8469. * @publicApi
  8470. */
  8471. declare function getDeferBlocks(node: Node): DeferBlockData[];
  8472. /**
  8473. * Discovers the dependencies of an injectable instance. Provides DI information about each
  8474. * dependency that the injectable was instantiated with, including where they were provided from.
  8475. *
  8476. * @param injector An injector instance
  8477. * @param token a DI token that was constructed by the given injector instance
  8478. * @returns an object that contains the created instance of token as well as all of the dependencies
  8479. * that it was instantiated with OR undefined if the token was not created within the given
  8480. * injector.
  8481. */
  8482. declare function getDependenciesFromInjectable<T>(injector: Injector, token: Type$1<T> | InjectionToken<T>): {
  8483. instance: T;
  8484. dependencies: Omit<InjectedService, 'injectedIn'>[];
  8485. } | undefined;
  8486. /**
  8487. * Gets the providers configured on an injector.
  8488. *
  8489. * @param injector the injector to lookup the providers of
  8490. * @returns ProviderRecord[] an array of objects representing the providers of the given injector
  8491. */
  8492. declare function getInjectorProviders(injector: Injector): ProviderRecord[];
  8493. /**
  8494. *
  8495. * Given an injector, this function will return
  8496. * an object containing the type and source of the injector.
  8497. *
  8498. * | | type | source |
  8499. * |--------------|-------------|-------------------------------------------------------------|
  8500. * | NodeInjector | element | DOM element that created this injector |
  8501. * | R3Injector | environment | `injector.source` |
  8502. * | NullInjector | null | null |
  8503. *
  8504. * @param injector the Injector to get metadata for
  8505. * @returns an object containing the type and source of the given injector. If the injector metadata
  8506. * cannot be determined, returns null.
  8507. */
  8508. declare function getInjectorMetadata(injector: Injector): {
  8509. type: 'element';
  8510. source: RElement;
  8511. } | {
  8512. type: 'environment';
  8513. source: string | null;
  8514. } | {
  8515. type: 'null';
  8516. source: null;
  8517. } | null;
  8518. declare function getInjectorResolutionPath(injector: Injector): Injector[];
  8519. interface DebugSignalGraphNode {
  8520. kind: string;
  8521. id: string;
  8522. epoch: number;
  8523. label?: string;
  8524. value?: unknown;
  8525. debuggableFn?: () => unknown;
  8526. }
  8527. interface DebugSignalGraphEdge {
  8528. /**
  8529. * Index of a signal node in the `nodes` array that is a consumer of the signal produced by the producer node.
  8530. */
  8531. consumer: number;
  8532. /**
  8533. * Index of a signal node in the `nodes` array that is a producer of the signal consumed by the consumer node.
  8534. */
  8535. producer: number;
  8536. }
  8537. /**
  8538. * A debug representation of the signal graph.
  8539. */
  8540. interface DebugSignalGraph {
  8541. nodes: DebugSignalGraphNode[];
  8542. edges: DebugSignalGraphEdge[];
  8543. }
  8544. /**
  8545. * Returns a debug representation of the signal graph for the given injector.
  8546. *
  8547. * Currently only supports element injectors. Starts by discovering the consumer nodes
  8548. * and then traverses their producer nodes to build the signal graph.
  8549. *
  8550. * @param injector The injector to get the signal graph for.
  8551. * @returns A debug representation of the signal graph.
  8552. * @throws If the injector is an environment injector.
  8553. */
  8554. declare function getSignalGraph(injector: Injector): DebugSignalGraph;
  8555. /**
  8556. * This file introduces series of globally accessible debug tools
  8557. * to allow for the Angular debugging story to function.
  8558. *
  8559. * To see this in action run the following command:
  8560. *
  8561. * bazel run //packages/core/test/bundling/todo:devserver
  8562. *
  8563. * Then load `localhost:5432` and start using the console tools.
  8564. */
  8565. /**
  8566. * This value reflects the property on the window where the dev
  8567. * tools are patched (window.ng).
  8568. * */
  8569. declare const GLOBAL_PUBLISH_EXPANDO_KEY = "ng";
  8570. interface NgGlobalPublishUtils {
  8571. ɵgetLoadedRoutes(route: any): any;
  8572. }
  8573. declare const globalUtilsFunctions: {
  8574. /**
  8575. * Warning: functions that start with `ɵ` are considered *INTERNAL* and should not be relied upon
  8576. * in application's code. The contract of those functions might be changed in any release and/or a
  8577. * function can be removed completely.
  8578. */
  8579. ɵgetDependenciesFromInjectable: typeof getDependenciesFromInjectable;
  8580. ɵgetInjectorProviders: typeof getInjectorProviders;
  8581. ɵgetInjectorResolutionPath: typeof getInjectorResolutionPath;
  8582. ɵgetInjectorMetadata: typeof getInjectorMetadata;
  8583. ɵsetProfiler: typeof setProfiler;
  8584. ɵgetSignalGraph: typeof getSignalGraph;
  8585. ɵgetDeferBlocks: typeof getDeferBlocks;
  8586. getDirectiveMetadata: typeof getDirectiveMetadata;
  8587. getComponent: typeof getComponent;
  8588. getContext: typeof getContext;
  8589. getListeners: typeof getListeners;
  8590. getOwningComponent: typeof getOwningComponent;
  8591. getHostElement: typeof getHostElement;
  8592. getInjector: typeof getInjector;
  8593. getRootComponents: typeof getRootComponents;
  8594. getDirectives: typeof getDirectives;
  8595. applyChanges: typeof applyChanges;
  8596. isSignal: typeof isSignal;
  8597. enableProfiling: typeof enableProfiling$1;
  8598. };
  8599. type ExternalGlobalUtilsFunctions = keyof NgGlobalPublishUtils;
  8600. /**
  8601. * Default debug tools available under `window.ng`.
  8602. */
  8603. type GlobalDevModeUtils = {
  8604. [GLOBAL_PUBLISH_EXPANDO_KEY]: typeof globalUtilsFunctions;
  8605. };
  8606. /**
  8607. * Defines the framework-agnostic `ng` global type, not just the `@angular/core` implementation.
  8608. *
  8609. * `typeof globalUtilsFunctions` is specifically the `@angular/core` implementation, so we
  8610. * overwrite some properties to make them more framework-agnostic. Longer term, we should define
  8611. * the `ng` global type as an interface implemented by `globalUtilsFunctions` rather than a type
  8612. * derived from it.
  8613. */
  8614. type FrameworkAgnosticGlobalUtils = Omit<typeof globalUtilsFunctions, 'getDirectiveMetadata'> & {
  8615. getDirectiveMetadata(directiveOrComponentInstance: any): DirectiveDebugMetadata | null;
  8616. };
  8617. /**
  8618. * Publishes the given function to `window.ng` from package other than @angular/core
  8619. * So that it can be used from the browser console when an application is not in production.
  8620. */
  8621. declare function publishExternalGlobalUtil<K extends ExternalGlobalUtilsFunctions>(name: K, fn: NgGlobalPublishUtils[K]): void;
  8622. /**
  8623. * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing
  8624. * dangerous content.
  8625. *
  8626. * This method parses the `html` and locates potentially dangerous content (such as urls and
  8627. * javascript) and removes it.
  8628. *
  8629. * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.
  8630. *
  8631. * @param unsafeHtml untrusted `html`, typically from the user.
  8632. * @returns `html` string which is safe to display to user, because all of the dangerous javascript
  8633. * and urls have been removed.
  8634. *
  8635. * @codeGenApi
  8636. */
  8637. declare function ɵɵsanitizeHtml(unsafeHtml: any): TrustedHTML | string;
  8638. /**
  8639. * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing
  8640. * dangerous content.
  8641. *
  8642. * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.
  8643. *
  8644. * @param unsafeStyle untrusted `style`, typically from the user.
  8645. * @returns `style` string which is safe to bind to the `style` properties.
  8646. *
  8647. * @codeGenApi
  8648. */
  8649. declare function ɵɵsanitizeStyle(unsafeStyle: any): string;
  8650. /**
  8651. * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing
  8652. * dangerous
  8653. * content.
  8654. *
  8655. * This method parses the `url` and locates potentially dangerous content (such as javascript) and
  8656. * removes it.
  8657. *
  8658. * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.
  8659. *
  8660. * @param unsafeUrl untrusted `url`, typically from the user.
  8661. * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
  8662. * all of the dangerous javascript has been removed.
  8663. *
  8664. * @codeGenApi
  8665. */
  8666. declare function ɵɵsanitizeUrl(unsafeUrl: any): string;
  8667. /**
  8668. * A `url` sanitizer which only lets trusted `url`s through.
  8669. *
  8670. * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.
  8671. *
  8672. * @param unsafeResourceUrl untrusted `url`, typically from the user.
  8673. * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
  8674. * only trusted `url`s have been allowed to pass.
  8675. *
  8676. * @codeGenApi
  8677. */
  8678. declare function ɵɵsanitizeResourceUrl(unsafeResourceUrl: any): TrustedScriptURL | string;
  8679. /**
  8680. * A `script` sanitizer which only lets trusted javascript through.
  8681. *
  8682. * This passes only `script`s marked trusted by calling {@link
  8683. * bypassSanitizationTrustScript}.
  8684. *
  8685. * @param unsafeScript untrusted `script`, typically from the user.
  8686. * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,
  8687. * because only trusted `scripts` have been allowed to pass.
  8688. *
  8689. * @codeGenApi
  8690. */
  8691. declare function ɵɵsanitizeScript(unsafeScript: any): TrustedScript | string;
  8692. /**
  8693. * A template tag function for promoting the associated constant literal to a
  8694. * TrustedHTML. Interpolation is explicitly not allowed.
  8695. *
  8696. * @param html constant template literal containing trusted HTML.
  8697. * @returns TrustedHTML wrapping `html`.
  8698. *
  8699. * @security This is a security-sensitive function and should only be used to
  8700. * convert constant values of attributes and properties found in
  8701. * application-provided Angular templates to TrustedHTML.
  8702. *
  8703. * @codeGenApi
  8704. */
  8705. declare function ɵɵtrustConstantHtml(html: TemplateStringsArray): TrustedHTML | string;
  8706. /**
  8707. * A template tag function for promoting the associated constant literal to a
  8708. * TrustedScriptURL. Interpolation is explicitly not allowed.
  8709. *
  8710. * @param url constant template literal containing a trusted script URL.
  8711. * @returns TrustedScriptURL wrapping `url`.
  8712. *
  8713. * @security This is a security-sensitive function and should only be used to
  8714. * convert constant values of attributes and properties found in
  8715. * application-provided Angular templates to TrustedScriptURL.
  8716. *
  8717. * @codeGenApi
  8718. */
  8719. declare function ɵɵtrustConstantResourceUrl(url: TemplateStringsArray): TrustedScriptURL | string;
  8720. /**
  8721. * Sanitizes URL, selecting sanitizer function based on tag and property names.
  8722. *
  8723. * This function is used in case we can't define security context at compile time, when only prop
  8724. * name is available. This happens when we generate host bindings for Directives/Components. The
  8725. * host element is unknown at compile time, so we defer calculation of specific sanitizer to
  8726. * runtime.
  8727. *
  8728. * @param unsafeUrl untrusted `url`, typically from the user.
  8729. * @param tag target element tag name.
  8730. * @param prop name of the property that contains the value.
  8731. * @returns `url` string which is safe to bind.
  8732. *
  8733. * @codeGenApi
  8734. */
  8735. declare function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl: any, tag: string, prop: string): any;
  8736. /**
  8737. * Validation function invoked at runtime for each binding that might potentially
  8738. * represent a security-sensitive attribute of an <iframe>.
  8739. * See `IFRAME_SECURITY_SENSITIVE_ATTRS` in the
  8740. * `packages/compiler/src/schema/dom_security_schema.ts` script for the full list
  8741. * of such attributes.
  8742. *
  8743. * @codeGenApi
  8744. */
  8745. declare function ɵɵvalidateIframeAttribute(attrValue: any, tagName: string, attrName: string): any;
  8746. /**
  8747. * Represents the set of dependencies of a type in a certain context.
  8748. */
  8749. interface ScopeData {
  8750. pipes: Set<PipeType<any>>;
  8751. directives: Set<DirectiveType<any> | ComponentType<any> | Type$1<any>>;
  8752. /**
  8753. * If true it indicates that calculating this scope somehow was not successful. The consumers
  8754. * should interpret this as empty dependencies. The application of this flag is when calculating
  8755. * scope recursively, the presence of this flag in a scope dependency implies that the scope is
  8756. * also poisoned and thus we can return immediately without having to continue the recursion. The
  8757. * reason for this error is displayed as an error message in the console as per JIT behavior
  8758. * today. In addition to that, in local compilation the other build/compilations run in parallel
  8759. * with local compilation may or may not reveal some details about the error as well.
  8760. */
  8761. isPoisoned?: boolean;
  8762. }
  8763. /**
  8764. * Represents scope data for standalone components as calculated during runtime by the deps
  8765. * tracker.
  8766. */
  8767. interface StandaloneCompScopeData extends ScopeData {
  8768. ngModules: Set<NgModuleType<any>>;
  8769. }
  8770. /** Represents scope data for NgModule as calculated during runtime by the deps tracker. */
  8771. interface NgModuleScope {
  8772. compilation: ScopeData;
  8773. exported: ScopeData;
  8774. }
  8775. /**
  8776. * Represents scope data for standalone component as calculated during runtime by the deps tracker.
  8777. */
  8778. interface StandaloneComponentScope {
  8779. compilation: StandaloneCompScopeData;
  8780. }
  8781. /** Component dependencies info as calculated during runtime by the deps tracker. */
  8782. interface ComponentDependencies {
  8783. dependencies: DependencyTypeList;
  8784. }
  8785. /**
  8786. * Public API for runtime deps tracker (RDT).
  8787. *
  8788. * All downstream tools should only use these methods.
  8789. */
  8790. interface DepsTrackerApi {
  8791. /**
  8792. * Computes the component dependencies, i.e., a set of components/directive/pipes that could be
  8793. * present in the component's template (This set might contain directives/components/pipes not
  8794. * necessarily used in the component's template depending on the implementation).
  8795. *
  8796. * Standalone components should specify `rawImports` as this information is not available from
  8797. * their type. The consumer (e.g., {@link getStandaloneDefFunctions}) is expected to pass this
  8798. * parameter.
  8799. *
  8800. * The implementation is expected to use some caching mechanism in order to optimize the resources
  8801. * needed to do this computation.
  8802. */
  8803. getComponentDependencies(cmp: ComponentType<any>, rawImports?: (Type$1<any> | (() => Type$1<any>))[]): ComponentDependencies;
  8804. /**
  8805. * Registers an NgModule into the tracker with the given scope info.
  8806. *
  8807. * This method should be called for every NgModule whether it is compiled in local mode or not.
  8808. * This is needed in order to compute component's dependencies as some dependencies might be in
  8809. * different compilation units with different compilation mode.
  8810. */
  8811. registerNgModule(type: Type$1<any>, scopeInfo: NgModuleScopeInfoFromDecorator): void;
  8812. /**
  8813. * Clears the scope cache for NgModule or standalone component. This will force re-calculation of
  8814. * the scope, which could be an expensive operation as it involves aggregating transitive closure.
  8815. *
  8816. * The main application of this method is for test beds where we want to clear the cache to
  8817. * enforce scope update after overriding.
  8818. */
  8819. clearScopeCacheFor(type: Type$1<any>): void;
  8820. /**
  8821. * Returns the scope of NgModule. Mainly to be used by JIT and test bed.
  8822. *
  8823. * The scope value here is memoized. To enforce a new calculation bust the cache by using
  8824. * `clearScopeCacheFor` method.
  8825. */
  8826. getNgModuleScope(type: NgModuleType<any>): NgModuleScope;
  8827. /**
  8828. * Returns the scope of standalone component. Mainly to be used by JIT. This method should be
  8829. * called lazily after the initial parsing so that all the forward refs can be resolved.
  8830. *
  8831. * @param rawImports the imports statement as appears on the component decorate which consists of
  8832. * Type as well as forward refs.
  8833. *
  8834. * The scope value here is memoized. To enforce a new calculation bust the cache by using
  8835. * `clearScopeCacheFor` method.
  8836. */
  8837. getStandaloneComponentScope(type: ComponentType<any>, rawImports: (Type$1<any> | (() => Type$1<any>))[]): StandaloneComponentScope;
  8838. /**
  8839. * Checks if the NgModule declaring the component is not loaded into the browser yet. Always
  8840. * returns false for standalone components.
  8841. */
  8842. isOrphanComponent(cmp: ComponentType<any>): boolean;
  8843. }
  8844. /**
  8845. * An implementation of DepsTrackerApi which will be used for JIT and local compilation.
  8846. */
  8847. declare class DepsTracker implements DepsTrackerApi {
  8848. private ownerNgModule;
  8849. private ngModulesWithSomeUnresolvedDecls;
  8850. private ngModulesScopeCache;
  8851. private standaloneComponentsScopeCache;
  8852. /**
  8853. * Attempts to resolve ng module's forward ref declarations as much as possible and add them to
  8854. * the `ownerNgModule` map. This method normally should be called after the initial parsing when
  8855. * all the forward refs are resolved (e.g., when trying to render a component)
  8856. */
  8857. private resolveNgModulesDecls;
  8858. /** @override */
  8859. getComponentDependencies(type: ComponentType<any>, rawImports?: RawScopeInfoFromDecorator[]): ComponentDependencies;
  8860. /**
  8861. * @override
  8862. * This implementation does not make use of param scopeInfo since it assumes the scope info is
  8863. * already added to the type itself through methods like {@link ɵɵsetNgModuleScope}
  8864. */
  8865. registerNgModule(type: Type$1<any>, scopeInfo: NgModuleScopeInfoFromDecorator): void;
  8866. /** @override */
  8867. clearScopeCacheFor(type: Type$1<any>): void;
  8868. /** @override */
  8869. getNgModuleScope(type: NgModuleType<any>): NgModuleScope;
  8870. /** Compute NgModule scope afresh. */
  8871. private computeNgModuleScope;
  8872. /** @override */
  8873. getStandaloneComponentScope(type: ComponentType<any>, rawImports?: RawScopeInfoFromDecorator[]): StandaloneComponentScope;
  8874. private computeStandaloneComponentScope;
  8875. /** @override */
  8876. isOrphanComponent(cmp: Type$1<any>): boolean;
  8877. }
  8878. /** The deps tracker to be used in the current Angular app in dev mode. */
  8879. declare const depsTracker: DepsTracker;
  8880. /**
  8881. * Creates a `ComponentRef` instance based on provided component type and a set of options.
  8882. *
  8883. * @usageNotes
  8884. *
  8885. * The example below demonstrates how the `createComponent` function can be used
  8886. * to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,
  8887. * so that it gets included into change detection cycles.
  8888. *
  8889. * Note: the example uses standalone components, but the function can also be used for
  8890. * non-standalone components (declared in an NgModule) as well.
  8891. *
  8892. * ```angular-ts
  8893. * @Component({
  8894. * standalone: true,
  8895. * template: `Hello {{ name }}!`
  8896. * })
  8897. * class HelloComponent {
  8898. * name = 'Angular';
  8899. * }
  8900. *
  8901. * @Component({
  8902. * standalone: true,
  8903. * template: `<div id="hello-component-host"></div>`
  8904. * })
  8905. * class RootComponent {}
  8906. *
  8907. * // Bootstrap an application.
  8908. * const applicationRef = await bootstrapApplication(RootComponent);
  8909. *
  8910. * // Locate a DOM node that would be used as a host.
  8911. * const hostElement = document.getElementById('hello-component-host');
  8912. *
  8913. * // Get an `EnvironmentInjector` instance from the `ApplicationRef`.
  8914. * const environmentInjector = applicationRef.injector;
  8915. *
  8916. * // We can now create a `ComponentRef` instance.
  8917. * const componentRef = createComponent(HelloComponent, {hostElement, environmentInjector});
  8918. *
  8919. * // Last step is to register the newly created ref using the `ApplicationRef` instance
  8920. * // to include the component view into change detection cycles.
  8921. * applicationRef.attachView(componentRef.hostView);
  8922. * componentRef.changeDetectorRef.detectChanges();
  8923. * ```
  8924. *
  8925. * @param component Component class reference.
  8926. * @param options Set of options to use:
  8927. * * `environmentInjector`: An `EnvironmentInjector` instance to be used for the component.
  8928. * * `hostElement` (optional): A DOM node that should act as a host node for the component. If not
  8929. * provided, Angular creates one based on the tag name used in the component selector (and falls
  8930. * back to using `div` if selector doesn't have tag name info).
  8931. * * `elementInjector` (optional): An `ElementInjector` instance, see additional info about it
  8932. * [here](guide/di/hierarchical-dependency-injection#elementinjector).
  8933. * * `projectableNodes` (optional): A list of DOM nodes that should be projected through
  8934. * [`<ng-content>`](api/core/ng-content) of the new component instance, e.g.,
  8935. * `[[element1, element2]]`: projects `element1` and `element2` into the same `<ng-content>`.
  8936. * `[[element1, element2], [element3]]`: projects `element1` and `element2` into one `<ng-content>`,
  8937. * and `element3` into a separate `<ng-content>`.
  8938. * * `directives` (optional): Directives that should be applied to the component.
  8939. * * `binding` (optional): Bindings to apply to the root component.
  8940. * @returns ComponentRef instance that represents a given Component.
  8941. *
  8942. * @publicApi
  8943. */
  8944. declare function createComponent<C>(component: Type$1<C>, options: {
  8945. environmentInjector: EnvironmentInjector;
  8946. hostElement?: Element;
  8947. elementInjector?: Injector;
  8948. projectableNodes?: Node[][];
  8949. directives?: (Type$1<unknown> | DirectiveWithBindings<unknown>)[];
  8950. bindings?: Binding[];
  8951. }): ComponentRef$1<C>;
  8952. /**
  8953. * An interface that describes the subset of component metadata
  8954. * that can be retrieved using the `reflectComponentType` function.
  8955. *
  8956. * @publicApi
  8957. */
  8958. interface ComponentMirror<C> {
  8959. /**
  8960. * The component's HTML selector.
  8961. */
  8962. get selector(): string;
  8963. /**
  8964. * The type of component the factory will create.
  8965. */
  8966. get type(): Type$1<C>;
  8967. /**
  8968. * The inputs of the component.
  8969. */
  8970. get inputs(): ReadonlyArray<{
  8971. readonly propName: string;
  8972. readonly templateName: string;
  8973. readonly transform?: (value: any) => any;
  8974. readonly isSignal: boolean;
  8975. }>;
  8976. /**
  8977. * The outputs of the component.
  8978. */
  8979. get outputs(): ReadonlyArray<{
  8980. readonly propName: string;
  8981. readonly templateName: string;
  8982. }>;
  8983. /**
  8984. * Selector for all <ng-content> elements in the component.
  8985. */
  8986. get ngContentSelectors(): ReadonlyArray<string>;
  8987. /**
  8988. * Whether this component is marked as standalone.
  8989. * Note: an extra flag, not present in `ComponentFactory`.
  8990. */
  8991. get isStandalone(): boolean;
  8992. }
  8993. /**
  8994. * Creates an object that allows to retrieve component metadata.
  8995. *
  8996. * @usageNotes
  8997. *
  8998. * The example below demonstrates how to use the function and how the fields
  8999. * of the returned object map to the component metadata.
  9000. *
  9001. * ```angular-ts
  9002. * @Component({
  9003. * standalone: true,
  9004. * selector: 'foo-component',
  9005. * template: `
  9006. * <ng-content></ng-content>
  9007. * <ng-content select="content-selector-a"></ng-content>
  9008. * `,
  9009. * })
  9010. * class FooComponent {
  9011. * @Input('inputName') inputPropName: string;
  9012. * @Output('outputName') outputPropName = new EventEmitter<void>();
  9013. * }
  9014. *
  9015. * const mirror = reflectComponentType(FooComponent);
  9016. * expect(mirror.type).toBe(FooComponent);
  9017. * expect(mirror.selector).toBe('foo-component');
  9018. * expect(mirror.isStandalone).toBe(true);
  9019. * expect(mirror.inputs).toEqual([{propName: 'inputName', templateName: 'inputPropName'}]);
  9020. * expect(mirror.outputs).toEqual([{propName: 'outputName', templateName: 'outputPropName'}]);
  9021. * expect(mirror.ngContentSelectors).toEqual([
  9022. * '*', // first `<ng-content>` in a template, the selector defaults to `*`
  9023. * 'content-selector-a' // second `<ng-content>` in a template
  9024. * ]);
  9025. * ```
  9026. *
  9027. * @param component Component class reference.
  9028. * @returns An object that allows to retrieve component metadata.
  9029. *
  9030. * @publicApi
  9031. */
  9032. declare function reflectComponentType<C>(component: Type$1<C>): ComponentMirror<C> | null;
  9033. /**
  9034. * Set of config options available during the application bootstrap operation.
  9035. *
  9036. * @publicApi
  9037. */
  9038. interface ApplicationConfig {
  9039. /**
  9040. * List of providers that should be available to the root component and all its children.
  9041. */
  9042. providers: Array<Provider | EnvironmentProviders>;
  9043. }
  9044. /**
  9045. * Merge multiple application configurations from left to right.
  9046. *
  9047. * @param configs Two or more configurations to be merged.
  9048. * @returns A merged [ApplicationConfig](api/core/ApplicationConfig).
  9049. *
  9050. * @publicApi
  9051. */
  9052. declare function mergeApplicationConfig(...configs: ApplicationConfig[]): ApplicationConfig;
  9053. /**
  9054. * Injection token representing the current HTTP request object.
  9055. *
  9056. * Use this token to access the current request when handling server-side
  9057. * rendering (SSR).
  9058. *
  9059. * @remarks
  9060. * This token may be `null` in the following scenarios:
  9061. *
  9062. * * During the build processes.
  9063. * * When the application is rendered in the browser (client-side rendering).
  9064. * * When performing static site generation (SSG).
  9065. * * During route extraction in development (at the time of the request).
  9066. *
  9067. * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request `Request` on MDN}
  9068. *
  9069. * @publicApi
  9070. */
  9071. declare const REQUEST: InjectionToken<Request | null>;
  9072. /**
  9073. * Injection token for response initialization options.
  9074. *
  9075. * Use this token to provide response options for configuring or initializing
  9076. * HTTP responses in server-side rendering or API endpoints.
  9077. *
  9078. * @remarks
  9079. * This token may be `null` in the following scenarios:
  9080. *
  9081. * * During the build processes.
  9082. * * When the application is rendered in the browser (client-side rendering).
  9083. * * When performing static site generation (SSG).
  9084. * * During route extraction in development (at the time of the request).
  9085. *
  9086. * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response `ResponseInit` on MDN}
  9087. *
  9088. * @publicApi
  9089. */
  9090. declare const RESPONSE_INIT: InjectionToken<ResponseInit | null>;
  9091. /**
  9092. * Injection token for additional request context.
  9093. *
  9094. * Use this token to pass custom metadata or context related to the current request in server-side rendering.
  9095. *
  9096. * @remarks
  9097. * This token is only available during server-side rendering and will be `null` in other contexts.
  9098. *
  9099. * @publicApi
  9100. */
  9101. declare const REQUEST_CONTEXT: InjectionToken<unknown>;
  9102. /**
  9103. * A DI Token representing the main rendering context.
  9104. * In a browser and SSR this is the DOM Document.
  9105. * When using SSR, that document is created by [Domino](https://github.com/angular/domino).
  9106. *
  9107. * @publicApi
  9108. */
  9109. declare const DOCUMENT: InjectionToken<Document>;
  9110. /**
  9111. * Enables the logic to produce `ng-reflect-*` attributes on elements with bindings.
  9112. *
  9113. * Note: this is a dev-mode only setting and it will have no effect in production mode.
  9114. * In production mode, the `ng-reflect-*` attributes are *never* produced by Angular.
  9115. *
  9116. * Important: using and relying on the `ng-reflect-*` attributes is not recommended,
  9117. * they are deprecated and only present for backwards compatibility. Angular will stop
  9118. * producing them in one of the future versions.
  9119. *
  9120. * @publicApi
  9121. */
  9122. declare function provideNgReflectAttributes(): EnvironmentProviders;
  9123. export { ANIMATION_MODULE_TYPE, APP_ID, APP_INITIALIZER, AfterRenderRef, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, Binding, CSP_NONCE, ChangeDetectionStrategy$1 as ChangeDetectionStrategy, ChangeDetectorRef, ClassProvider, ClassSansProvider, CompilerOptions, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ConstructorProvider, ConstructorSansProvider, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DOCUMENT, DefaultIterableDiffer, Directive, ENVIRONMENT_INITIALIZER, EffectCleanupRegisterFn, ElementRef, EmbeddedViewRef, EnvironmentInjector, EnvironmentProviders, ErrorHandler, ExistingProvider, ExistingSansProvider, FactoryProvider, FactorySansProvider, HOST_TAG_NAME, Host, HostAttributeToken, INJECTOR, Inject, InjectOptions, Injectable, InjectionToken, Injector, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithProviders, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgZone, Optional, OutputRef, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, PendingTasks, Pipe, PlatformRef, Provider, ProviderToken, Query, QueryList, REQUEST, REQUEST_CONTEXT, RESPONSE_INIT, Resource, ResourceOptions, ResourceRef, ResourceStatus, ResourceStreamingLoader, SchemaMetadata, Self, Signal, SimpleChange, SkipSelf, StaticClassProvider, StaticClassSansProvider, StaticProvider, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TransferState, Type$1 as Type, TypeDecorator, TypeProvider, VERSION, ValueEqualityFn, ValueProvider, ValueSansProvider, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef$1 as ViewRef, WritableResource, WritableSignal, afterEveryRender, afterNextRender, afterRenderEffect, assertInInjectionContext, assertNotInReactiveContext, assertPlatform, booleanAttribute, computed, contentChild, contentChildren, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, destroyPlatform, enableProdMode, enableProfiling$1 as enableProfiling, forwardRef, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, input, isDevMode, isSignal, isStandalone, linkedSignal, makeEnvironmentProviders, makeStateKey, mergeApplicationConfig, model, numberAttribute, platformCore, provideAppInitializer, provideBrowserGlobalErrorListeners, provideCheckNoChangesConfig, provideEnvironmentInitializer, provideNgReflectAttributes, providePlatformInitializer, provideZoneChangeDetection, provideZonelessChangeDetection, reflectComponentType, resolveForwardRef, resource, runInInjectionContext, setTestabilityGetter, untracked, viewChild, viewChildren, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, AcxChangeDetectionStrategy as ɵAcxChangeDetectionStrategy, AcxViewEncapsulation as ɵAcxViewEncapsulation, BypassType as ɵBypassType, CLIENT_RENDER_MODE_FLAG as ɵCLIENT_RENDER_MODE_FLAG, ChangeDetectionScheduler as ɵChangeDetectionScheduler, ChangeDetectionSchedulerImpl as ɵChangeDetectionSchedulerImpl, ComponentDef as ɵComponentDef, ComponentFactory$1 as ɵComponentFactory, ComponentType as ɵComponentType, Console as ɵConsole, CssSelectorList as ɵCssSelectorList, CurrencyIndex as ɵCurrencyIndex, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG as ɵDEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR as ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DEHYDRATED_BLOCK_REGISTRY as ɵDEHYDRATED_BLOCK_REGISTRY, DeferBlockConfig as ɵDeferBlockConfig, DeferBlockDependencyInterceptor as ɵDeferBlockDependencyInterceptor, DeferBlockState as ɵDeferBlockState, DirectiveDef as ɵDirectiveDef, DirectiveType as ɵDirectiveType, ENABLE_ROOT_COMPONENT_BOOTSTRAP as ɵENABLE_ROOT_COMPONENT_BOOTSTRAP, ExtraLocaleDataIndex as ɵExtraLocaleDataIndex, Framework as ɵFramework, HydrationStatus as ɵHydrationStatus, IMAGE_CONFIG as ɵIMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS as ɵIMAGE_CONFIG_DEFAULTS, ɵ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, InputSignalNode as ɵInputSignalNode, JSACTION_BLOCK_ELEMENT_MAP as ɵJSACTION_BLOCK_ELEMENT_MAP, LContext as ɵLContext, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NotificationSource as ɵNotificationSource, PERFORMANCE_MARK_PREFIX as ɵPERFORMANCE_MARK_PREFIX, PROVIDED_NG_ZONE as ɵPROVIDED_NG_ZONE, PendingTasksInternal as ɵPendingTasksInternal, ProfilerEvent as ɵProfilerEvent, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, 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, ViewRef as ɵViewRef, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, _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, devModeEqual as ɵdevModeEqual, disableProfiling as ɵdisableProfiling, enableProfiling as ɵenableProfiling, encapsulateResourceError as ɵencapsulateResourceError, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, generateStandaloneInDeclarationsError as ɵgenerateStandaloneInDeclarationsError, getAsyncClassMetadataFn as ɵgetAsyncClassMetadataFn, getClosestComponentName as ɵgetClosestComponentName, getComponentDef as ɵgetComponentDef, getDirectives as ɵgetDirectives, getDocument as ɵgetDocument, getHostElement as ɵgetHostElement, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, internalCreateApplication as ɵinternalCreateApplication, internalProvideZoneChangeDetection as ɵinternalProvideZoneChangeDetection, isComponentDefPendingResolution as ɵisComponentDefPendingResolution, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, isViewDirty as ɵisViewDirty, markForRefresh as ɵmarkForRefresh, 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, withDomHydration as ɵwithDomHydration, withEventReplay as ɵwithEventReplay, withI18nSupport as ɵwithI18nSupport, withIncrementalHydration as ɵwithIncrementalHydration, ɵɵCopyDefinitionFeature, ɵɵExternalStylesFeature, __FactoryDeclaration as ɵɵFactoryDeclaration, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, __InjectableDeclaration as ɵɵInjectableDeclaration, __InjectorDeclaration as ɵɵInjectorDeclaration, __NgModuleDeclaration as ɵɵNgModuleDeclaration, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵadvance, ɵɵattachSourceLocations, ɵɵattribute, ɵɵclassMap, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵconditionalBranchCreate, ɵɵconditionalCreate, ɵɵ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, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵdomElement, ɵɵdomElementContainer, ɵɵdomElementContainerEnd, ɵɵdomElementContainerStart, ɵɵdomElementEnd, ɵɵdomElementStart, ɵɵdomListener, ɵɵdomProperty, ɵɵdomTemplate, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵgetReplaceMetadataURL, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinterpolate, ɵɵinterpolate1, ɵɵinterpolate2, ɵɵinterpolate3, ɵɵinterpolate4, ɵɵinterpolate5, ɵɵinterpolate6, ɵɵinterpolate7, ɵɵinterpolate8, ɵɵinterpolateV, ɵɵ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, ɵɵ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, ɵɵstyleProp, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵtwoWayBindingSet, ɵɵtwoWayListener, ɵɵtwoWayProperty, ɵɵvalidateIframeAttribute, ɵɵviewQuery, ɵɵviewQuerySignal };
  9124. export type { AfterContentChecked, AfterContentInit, AfterRenderOptions, AfterViewChecked, AfterViewInit, ApplicationConfig, AttributeDecorator, ComponentMirror, ContentChildDecorator, ContentChildFunction, ContentChildrenDecorator, CreateComputedOptions, DoBootstrap, DoCheck, ForwardRefFn, GetTestability, HostDecorator, ImportProvidersSource, InjectDecorator, InjectableDecorator, InjectableProvider, InputFunction, InputOptions, InputOptionsWithTransform, InputOptionsWithoutTransform, InputSignal, InputSignalWithTransform, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory, ModelFunction, ModelOptions, ModelSignal, NgIterable, NgZoneOptions, OnChanges, OnDestroy, OnInit, OptionalDecorator, PipeTransform, SelfDecorator, SimpleChanges, SkipSelfDecorator, StateKey, TrackByFunction, ViewChildDecorator, ViewChildFunction, ViewChildrenDecorator, AcxComponentDebugMetadata as ɵAcxComponentDebugMetadata, AcxDirectiveDebugMetadata as ɵAcxDirectiveDebugMetadata, AngularComponentDebugMetadata as ɵAngularComponentDebugMetadata, AngularDirectiveDebugMetadata as ɵAngularDirectiveDebugMetadata, BaseDirectiveDebugMetadata as ɵBaseDirectiveDebugMetadata, DeferBlockData as ɵDeferBlockData, DirectiveDebugMetadata as ɵDirectiveDebugMetadata, ɵFirstAvailable, ɵFirstAvailableSignal, FrameworkAgnosticGlobalUtils as ɵFrameworkAgnosticGlobalUtils, GlobalDevModeUtils as ɵGlobalDevModeUtils, HydratedNode as ɵHydratedNode, HydrationInfo as ɵHydrationInfo, ImageConfig as ɵImageConfig, InjectorProfilerContext as ɵInjectorProfilerContext, NgModuleDef as ɵNgModuleDef, NgModuleTransitiveScopes as ɵNgModuleTransitiveScopes, NgModuleType as ɵNgModuleType, Profiler as ɵProfiler, ProviderRecord as ɵProviderRecord, SafeHtml as ɵSafeHtml, SafeResourceUrl as ɵSafeResourceUrl, SafeScript as ɵSafeScript, SafeStyle as ɵSafeStyle, SafeUrl as ɵSafeUrl, SafeValue as ɵSafeValue, ɵUnwrapDirectiveSignalInputs, WizComponentDebugMetadata as ɵWizComponentDebugMetadata };