index.d.ts 222 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369
  1. /**
  2. * @license Angular v19.2.4
  3. * (c) 2010-2025 Google LLC. https://angular.io/
  4. * License: MIT
  5. */
  6. declare const emitDistinctChangesOnlyDefaultValue = true;
  7. declare enum ViewEncapsulation {
  8. Emulated = 0,
  9. None = 2,
  10. ShadowDom = 3
  11. }
  12. declare enum ChangeDetectionStrategy {
  13. OnPush = 0,
  14. Default = 1
  15. }
  16. interface Input {
  17. alias?: string;
  18. required?: boolean;
  19. transform?: (value: any) => any;
  20. isSignal: boolean;
  21. }
  22. /** Flags describing an input for a directive. */
  23. declare enum InputFlags {
  24. None = 0,
  25. SignalBased = 1,
  26. HasDecoratorInputTransform = 2
  27. }
  28. interface Output {
  29. alias?: string;
  30. }
  31. interface HostBinding {
  32. hostPropertyName?: string;
  33. }
  34. interface HostListener {
  35. eventName?: string;
  36. args?: string[];
  37. }
  38. interface SchemaMetadata {
  39. name: string;
  40. }
  41. declare const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata;
  42. declare const NO_ERRORS_SCHEMA: SchemaMetadata;
  43. interface Type$1 extends Function {
  44. new (...args: any[]): any;
  45. }
  46. declare const Type$1: FunctionConstructor;
  47. declare enum SecurityContext {
  48. NONE = 0,
  49. HTML = 1,
  50. STYLE = 2,
  51. SCRIPT = 3,
  52. URL = 4,
  53. RESOURCE_URL = 5
  54. }
  55. /**
  56. * Injection flags for DI.
  57. */
  58. declare const enum InjectFlags {
  59. Default = 0,
  60. /**
  61. * Specifies that an injector should retrieve a dependency from any injector until reaching the
  62. * host element of the current component. (Only used with Element Injector)
  63. */
  64. Host = 1,
  65. /** Don't descend into ancestors of the node requesting injection. */
  66. Self = 2,
  67. /** Skip the node that is requesting injection. */
  68. SkipSelf = 4,
  69. /** Inject `defaultValue` instead if token not found. */
  70. Optional = 8
  71. }
  72. declare enum MissingTranslationStrategy {
  73. Error = 0,
  74. Warning = 1,
  75. Ignore = 2
  76. }
  77. /**
  78. * Flags used to generate R3-style CSS Selectors. They are pasted from
  79. * core/src/render3/projection.ts because they cannot be referenced directly.
  80. */
  81. declare const enum SelectorFlags {
  82. /** Indicates this is the beginning of a new negative selector */
  83. NOT = 1,
  84. /** Mode for matching attributes */
  85. ATTRIBUTE = 2,
  86. /** Mode for matching tag names */
  87. ELEMENT = 4,
  88. /** Mode for matching class names */
  89. CLASS = 8
  90. }
  91. type R3CssSelector = (string | SelectorFlags)[];
  92. type R3CssSelectorList = R3CssSelector[];
  93. declare function parseSelectorToR3Selector(selector: string | null): R3CssSelectorList;
  94. /**
  95. * Flags passed into template functions to determine which blocks (i.e. creation, update)
  96. * should be executed.
  97. *
  98. * Typically, a template runs both the creation block and the update block on initialization and
  99. * subsequent runs only execute the update block. However, dynamically created views require that
  100. * the creation block be executed separately from the update block (for backwards compat).
  101. */
  102. declare const enum RenderFlags {
  103. Create = 1,
  104. Update = 2
  105. }
  106. /**
  107. * A set of marker values to be used in the attributes arrays. These markers indicate that some
  108. * items are not regular attributes and the processing should be adapted accordingly.
  109. */
  110. declare const enum AttributeMarker {
  111. /**
  112. * Marker indicates that the following 3 values in the attributes array are:
  113. * namespaceUri, attributeName, attributeValue
  114. * in that order.
  115. */
  116. NamespaceURI = 0,
  117. /**
  118. * Signals class declaration.
  119. *
  120. * Each value following `Classes` designates a class name to include on the element.
  121. * ## Example:
  122. *
  123. * Given:
  124. * ```html
  125. * <div class="foo bar baz">...</div>
  126. * ```
  127. *
  128. * the generated code is:
  129. * ```ts
  130. * var _c1 = [AttributeMarker.Classes, 'foo', 'bar', 'baz'];
  131. * ```
  132. */
  133. Classes = 1,
  134. /**
  135. * Signals style declaration.
  136. *
  137. * Each pair of values following `Styles` designates a style name and value to include on the
  138. * element.
  139. * ## Example:
  140. *
  141. * Given:
  142. * ```html
  143. * <div style="width:100px; height:200px; color:red">...</div>
  144. * ```
  145. *
  146. * the generated code is:
  147. * ```ts
  148. * var _c1 = [AttributeMarker.Styles, 'width', '100px', 'height'. '200px', 'color', 'red'];
  149. * ```
  150. */
  151. Styles = 2,
  152. /**
  153. * Signals that the following attribute names were extracted from input or output bindings.
  154. *
  155. * For example, given the following HTML:
  156. *
  157. * ```html
  158. * <div moo="car" [foo]="exp" (bar)="doSth()">
  159. * ```
  160. *
  161. * the generated code is:
  162. *
  163. * ```ts
  164. * var _c1 = ['moo', 'car', AttributeMarker.Bindings, 'foo', 'bar'];
  165. * ```
  166. */
  167. Bindings = 3,
  168. /**
  169. * Signals that the following attribute names were hoisted from an inline-template declaration.
  170. *
  171. * For example, given the following HTML:
  172. *
  173. * ```html
  174. * <div *ngFor="let value of values; trackBy:trackBy" dirA [dirB]="value">
  175. * ```
  176. *
  177. * the generated code for the `template()` instruction would include:
  178. *
  179. * ```
  180. * ['dirA', '', AttributeMarker.Bindings, 'dirB', AttributeMarker.Template, 'ngFor', 'ngForOf',
  181. * 'ngForTrackBy', 'let-value']
  182. * ```
  183. *
  184. * while the generated code for the `element()` instruction inside the template function would
  185. * include:
  186. *
  187. * ```
  188. * ['dirA', '', AttributeMarker.Bindings, 'dirB']
  189. * ```
  190. */
  191. Template = 4,
  192. /**
  193. * Signals that the following attribute is `ngProjectAs` and its value is a parsed `CssSelector`.
  194. *
  195. * For example, given the following HTML:
  196. *
  197. * ```html
  198. * <h1 attr="value" ngProjectAs="[title]">
  199. * ```
  200. *
  201. * the generated code for the `element()` instruction would include:
  202. *
  203. * ```
  204. * ['attr', 'value', AttributeMarker.ProjectAs, ['', 'title', '']]
  205. * ```
  206. */
  207. ProjectAs = 5,
  208. /**
  209. * Signals that the following attribute will be translated by runtime i18n
  210. *
  211. * For example, given the following HTML:
  212. *
  213. * ```html
  214. * <div moo="car" foo="value" i18n-foo [bar]="binding" i18n-bar>
  215. * ```
  216. *
  217. * the generated code is:
  218. *
  219. * ```ts
  220. * var _c1 = ['moo', 'car', AttributeMarker.I18n, 'foo', 'bar'];
  221. * ```
  222. */
  223. I18n = 6
  224. }
  225. type core_d_AttributeMarker = AttributeMarker;
  226. declare const core_d_AttributeMarker: typeof AttributeMarker;
  227. declare const core_d_CUSTOM_ELEMENTS_SCHEMA: typeof CUSTOM_ELEMENTS_SCHEMA;
  228. type core_d_ChangeDetectionStrategy = ChangeDetectionStrategy;
  229. declare const core_d_ChangeDetectionStrategy: typeof ChangeDetectionStrategy;
  230. type core_d_HostBinding = HostBinding;
  231. type core_d_HostListener = HostListener;
  232. type core_d_InjectFlags = InjectFlags;
  233. declare const core_d_InjectFlags: typeof InjectFlags;
  234. type core_d_Input = Input;
  235. type core_d_InputFlags = InputFlags;
  236. declare const core_d_InputFlags: typeof InputFlags;
  237. type core_d_MissingTranslationStrategy = MissingTranslationStrategy;
  238. declare const core_d_MissingTranslationStrategy: typeof MissingTranslationStrategy;
  239. declare const core_d_NO_ERRORS_SCHEMA: typeof NO_ERRORS_SCHEMA;
  240. type core_d_Output = Output;
  241. type core_d_R3CssSelector = R3CssSelector;
  242. type core_d_R3CssSelectorList = R3CssSelectorList;
  243. type core_d_RenderFlags = RenderFlags;
  244. declare const core_d_RenderFlags: typeof RenderFlags;
  245. type core_d_SchemaMetadata = SchemaMetadata;
  246. type core_d_SecurityContext = SecurityContext;
  247. declare const core_d_SecurityContext: typeof SecurityContext;
  248. type core_d_SelectorFlags = SelectorFlags;
  249. declare const core_d_SelectorFlags: typeof SelectorFlags;
  250. type core_d_ViewEncapsulation = ViewEncapsulation;
  251. declare const core_d_ViewEncapsulation: typeof ViewEncapsulation;
  252. declare const core_d_emitDistinctChangesOnlyDefaultValue: typeof emitDistinctChangesOnlyDefaultValue;
  253. declare const core_d_parseSelectorToR3Selector: typeof parseSelectorToR3Selector;
  254. declare namespace core_d {
  255. export { core_d_AttributeMarker as AttributeMarker, core_d_CUSTOM_ELEMENTS_SCHEMA as CUSTOM_ELEMENTS_SCHEMA, core_d_ChangeDetectionStrategy as ChangeDetectionStrategy, type core_d_HostBinding as HostBinding, type core_d_HostListener as HostListener, core_d_InjectFlags as InjectFlags, type core_d_Input as Input, core_d_InputFlags as InputFlags, core_d_MissingTranslationStrategy as MissingTranslationStrategy, core_d_NO_ERRORS_SCHEMA as NO_ERRORS_SCHEMA, type core_d_Output as Output, type core_d_R3CssSelector as R3CssSelector, type core_d_R3CssSelectorList as R3CssSelectorList, core_d_RenderFlags as RenderFlags, type core_d_SchemaMetadata as SchemaMetadata, core_d_SecurityContext as SecurityContext, core_d_SelectorFlags as SelectorFlags, Type$1 as Type, core_d_ViewEncapsulation as ViewEncapsulation, core_d_emitDistinctChangesOnlyDefaultValue as emitDistinctChangesOnlyDefaultValue, core_d_parseSelectorToR3Selector as parseSelectorToR3Selector };
  256. }
  257. declare class Version {
  258. full: string;
  259. readonly major: string;
  260. readonly minor: string;
  261. readonly patch: string;
  262. constructor(full: string);
  263. }
  264. interface Console {
  265. log(message: string): void;
  266. warn(message: string): void;
  267. }
  268. /**
  269. * @module
  270. * @description
  271. * Entry point for all public APIs of the compiler package.
  272. */
  273. declare const VERSION: Version;
  274. declare class CompilerConfig {
  275. defaultEncapsulation: ViewEncapsulation | null;
  276. preserveWhitespaces: boolean;
  277. strictInjectionParameters: boolean;
  278. constructor({ defaultEncapsulation, preserveWhitespaces, strictInjectionParameters, }?: {
  279. defaultEncapsulation?: ViewEncapsulation;
  280. preserveWhitespaces?: boolean;
  281. strictInjectionParameters?: boolean;
  282. });
  283. }
  284. declare function preserveWhitespacesDefault(preserveWhitespacesOption: boolean | null, defaultSetting?: boolean): boolean;
  285. /**
  286. * An interface for retrieving documents by URL that the compiler uses to
  287. * load templates.
  288. *
  289. * This is an abstract class, rather than an interface, so that it can be used
  290. * as injection token.
  291. */
  292. declare abstract class ResourceLoader {
  293. abstract get(url: string): Promise<string> | string;
  294. }
  295. declare class ParseLocation {
  296. file: ParseSourceFile;
  297. offset: number;
  298. line: number;
  299. col: number;
  300. constructor(file: ParseSourceFile, offset: number, line: number, col: number);
  301. toString(): string;
  302. moveBy(delta: number): ParseLocation;
  303. getContext(maxChars: number, maxLines: number): {
  304. before: string;
  305. after: string;
  306. } | null;
  307. }
  308. declare class ParseSourceFile {
  309. content: string;
  310. url: string;
  311. constructor(content: string, url: string);
  312. }
  313. declare class ParseSourceSpan {
  314. start: ParseLocation;
  315. end: ParseLocation;
  316. fullStart: ParseLocation;
  317. details: string | null;
  318. /**
  319. * Create an object that holds information about spans of tokens/nodes captured during
  320. * lexing/parsing of text.
  321. *
  322. * @param start
  323. * The location of the start of the span (having skipped leading trivia).
  324. * Skipping leading trivia makes source-spans more "user friendly", since things like HTML
  325. * elements will appear to begin at the start of the opening tag, rather than at the start of any
  326. * leading trivia, which could include newlines.
  327. *
  328. * @param end
  329. * The location of the end of the span.
  330. *
  331. * @param fullStart
  332. * The start of the token without skipping the leading trivia.
  333. * This is used by tooling that splits tokens further, such as extracting Angular interpolations
  334. * from text tokens. Such tooling creates new source-spans relative to the original token's
  335. * source-span. If leading trivia characters have been skipped then the new source-spans may be
  336. * incorrectly offset.
  337. *
  338. * @param details
  339. * Additional information (such as identifier names) that should be associated with the span.
  340. */
  341. constructor(start: ParseLocation, end: ParseLocation, fullStart?: ParseLocation, details?: string | null);
  342. toString(): string;
  343. }
  344. declare enum ParseErrorLevel {
  345. WARNING = 0,
  346. ERROR = 1
  347. }
  348. declare class ParseError {
  349. /** Location of the error. */
  350. readonly span: ParseSourceSpan;
  351. /** Error message. */
  352. readonly msg: string;
  353. /** Severity level of the error. */
  354. readonly level: ParseErrorLevel;
  355. /**
  356. * Error that caused the error to be surfaced. For example, an error in a sub-expression that
  357. * couldn't be parsed. Not guaranteed to be defined, but can be used to provide more context.
  358. */
  359. readonly relatedError?: unknown | undefined;
  360. constructor(
  361. /** Location of the error. */
  362. span: ParseSourceSpan,
  363. /** Error message. */
  364. msg: string,
  365. /** Severity level of the error. */
  366. level?: ParseErrorLevel,
  367. /**
  368. * Error that caused the error to be surfaced. For example, an error in a sub-expression that
  369. * couldn't be parsed. Not guaranteed to be defined, but can be used to provide more context.
  370. */
  371. relatedError?: unknown | undefined);
  372. contextualMessage(): string;
  373. toString(): string;
  374. }
  375. /**
  376. * Generates Source Span object for a given R3 Type for JIT mode.
  377. *
  378. * @param kind Component or Directive.
  379. * @param typeName name of the Component or Directive.
  380. * @param sourceUrl reference to Component or Directive source.
  381. * @returns instance of ParseSourceSpan that represent a given Component or Directive.
  382. */
  383. declare function r3JitTypeSourceSpan(kind: string, typeName: string, sourceUrl: string): ParseSourceSpan;
  384. declare function identifierName(compileIdentifier: CompileIdentifierMetadata | null | undefined): string | null;
  385. interface CompileIdentifierMetadata {
  386. reference: any;
  387. }
  388. declare function sanitizeIdentifier(name: string): string;
  389. /**
  390. * Describes the text contents of a placeholder as it appears in an ICU expression, including its
  391. * source span information.
  392. */
  393. interface MessagePlaceholder {
  394. /** The text contents of the placeholder */
  395. text: string;
  396. /** The source span of the placeholder */
  397. sourceSpan: ParseSourceSpan;
  398. }
  399. declare class Message {
  400. nodes: Node$2[];
  401. placeholders: {
  402. [phName: string]: MessagePlaceholder;
  403. };
  404. placeholderToMessage: {
  405. [phName: string]: Message;
  406. };
  407. meaning: string;
  408. description: string;
  409. customId: string;
  410. sources: MessageSpan[];
  411. id: string;
  412. /** The ids to use if there are no custom id and if `i18nLegacyMessageIdFormat` is not empty */
  413. legacyIds: string[];
  414. messageString: string;
  415. /**
  416. * @param nodes message AST
  417. * @param placeholders maps placeholder names to static content and their source spans
  418. * @param placeholderToMessage maps placeholder names to messages (used for nested ICU messages)
  419. * @param meaning
  420. * @param description
  421. * @param customId
  422. */
  423. constructor(nodes: Node$2[], placeholders: {
  424. [phName: string]: MessagePlaceholder;
  425. }, placeholderToMessage: {
  426. [phName: string]: Message;
  427. }, meaning: string, description: string, customId: string);
  428. }
  429. interface MessageSpan {
  430. filePath: string;
  431. startLine: number;
  432. startCol: number;
  433. endLine: number;
  434. endCol: number;
  435. }
  436. interface Node$2 {
  437. sourceSpan: ParseSourceSpan;
  438. visit(visitor: Visitor$2, context?: any): any;
  439. }
  440. declare class Text$2 implements Node$2 {
  441. value: string;
  442. sourceSpan: ParseSourceSpan;
  443. constructor(value: string, sourceSpan: ParseSourceSpan);
  444. visit(visitor: Visitor$2, context?: any): any;
  445. }
  446. declare class Container implements Node$2 {
  447. children: Node$2[];
  448. sourceSpan: ParseSourceSpan;
  449. constructor(children: Node$2[], sourceSpan: ParseSourceSpan);
  450. visit(visitor: Visitor$2, context?: any): any;
  451. }
  452. declare class Icu$1 implements Node$2 {
  453. expression: string;
  454. type: string;
  455. cases: {
  456. [k: string]: Node$2;
  457. };
  458. sourceSpan: ParseSourceSpan;
  459. expressionPlaceholder?: string | undefined;
  460. constructor(expression: string, type: string, cases: {
  461. [k: string]: Node$2;
  462. }, sourceSpan: ParseSourceSpan, expressionPlaceholder?: string | undefined);
  463. visit(visitor: Visitor$2, context?: any): any;
  464. }
  465. declare class TagPlaceholder implements Node$2 {
  466. tag: string;
  467. attrs: {
  468. [k: string]: string;
  469. };
  470. startName: string;
  471. closeName: string;
  472. children: Node$2[];
  473. isVoid: boolean;
  474. sourceSpan: ParseSourceSpan;
  475. startSourceSpan: ParseSourceSpan | null;
  476. endSourceSpan: ParseSourceSpan | null;
  477. constructor(tag: string, attrs: {
  478. [k: string]: string;
  479. }, startName: string, closeName: string, children: Node$2[], isVoid: boolean, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan | null, endSourceSpan: ParseSourceSpan | null);
  480. visit(visitor: Visitor$2, context?: any): any;
  481. }
  482. declare class Placeholder implements Node$2 {
  483. value: string;
  484. name: string;
  485. sourceSpan: ParseSourceSpan;
  486. constructor(value: string, name: string, sourceSpan: ParseSourceSpan);
  487. visit(visitor: Visitor$2, context?: any): any;
  488. }
  489. declare class IcuPlaceholder implements Node$2 {
  490. value: Icu$1;
  491. name: string;
  492. sourceSpan: ParseSourceSpan;
  493. /** Used to capture a message computed from a previous processing pass (see `setI18nRefs()`). */
  494. previousMessage?: Message;
  495. constructor(value: Icu$1, name: string, sourceSpan: ParseSourceSpan);
  496. visit(visitor: Visitor$2, context?: any): any;
  497. }
  498. declare class BlockPlaceholder implements Node$2 {
  499. name: string;
  500. parameters: string[];
  501. startName: string;
  502. closeName: string;
  503. children: Node$2[];
  504. sourceSpan: ParseSourceSpan;
  505. startSourceSpan: ParseSourceSpan | null;
  506. endSourceSpan: ParseSourceSpan | null;
  507. constructor(name: string, parameters: string[], startName: string, closeName: string, children: Node$2[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan | null, endSourceSpan: ParseSourceSpan | null);
  508. visit(visitor: Visitor$2, context?: any): any;
  509. }
  510. /**
  511. * Each HTML node that is affect by an i18n tag will also have an `i18n` property that is of type
  512. * `I18nMeta`.
  513. * This information is either a `Message`, which indicates it is the root of an i18n message, or a
  514. * `Node`, which indicates is it part of a containing `Message`.
  515. */
  516. type I18nMeta$1 = Message | Node$2;
  517. interface Visitor$2 {
  518. visitText(text: Text$2, context?: any): any;
  519. visitContainer(container: Container, context?: any): any;
  520. visitIcu(icu: Icu$1, context?: any): any;
  521. visitTagPlaceholder(ph: TagPlaceholder, context?: any): any;
  522. visitPlaceholder(ph: Placeholder, context?: any): any;
  523. visitIcuPlaceholder(ph: IcuPlaceholder, context?: any): any;
  524. visitBlockPlaceholder(ph: BlockPlaceholder, context?: any): any;
  525. }
  526. declare const enum TokenType$1 {
  527. TAG_OPEN_START = 0,
  528. TAG_OPEN_END = 1,
  529. TAG_OPEN_END_VOID = 2,
  530. TAG_CLOSE = 3,
  531. INCOMPLETE_TAG_OPEN = 4,
  532. TEXT = 5,
  533. ESCAPABLE_RAW_TEXT = 6,
  534. RAW_TEXT = 7,
  535. INTERPOLATION = 8,
  536. ENCODED_ENTITY = 9,
  537. COMMENT_START = 10,
  538. COMMENT_END = 11,
  539. CDATA_START = 12,
  540. CDATA_END = 13,
  541. ATTR_NAME = 14,
  542. ATTR_QUOTE = 15,
  543. ATTR_VALUE_TEXT = 16,
  544. ATTR_VALUE_INTERPOLATION = 17,
  545. DOC_TYPE = 18,
  546. EXPANSION_FORM_START = 19,
  547. EXPANSION_CASE_VALUE = 20,
  548. EXPANSION_CASE_EXP_START = 21,
  549. EXPANSION_CASE_EXP_END = 22,
  550. EXPANSION_FORM_END = 23,
  551. BLOCK_OPEN_START = 24,
  552. BLOCK_OPEN_END = 25,
  553. BLOCK_CLOSE = 26,
  554. BLOCK_PARAMETER = 27,
  555. INCOMPLETE_BLOCK_OPEN = 28,
  556. LET_START = 29,
  557. LET_VALUE = 30,
  558. LET_END = 31,
  559. INCOMPLETE_LET = 32,
  560. EOF = 33
  561. }
  562. type InterpolatedTextToken = TextToken | InterpolationToken | EncodedEntityToken;
  563. type InterpolatedAttributeToken = AttributeValueTextToken | AttributeValueInterpolationToken | EncodedEntityToken;
  564. interface TokenBase {
  565. type: TokenType$1;
  566. parts: string[];
  567. sourceSpan: ParseSourceSpan;
  568. }
  569. interface TextToken extends TokenBase {
  570. type: TokenType$1.TEXT | TokenType$1.ESCAPABLE_RAW_TEXT | TokenType$1.RAW_TEXT;
  571. parts: [text: string];
  572. }
  573. interface InterpolationToken extends TokenBase {
  574. type: TokenType$1.INTERPOLATION;
  575. parts: [startMarker: string, expression: string, endMarker: string] | [startMarker: string, expression: string];
  576. }
  577. interface EncodedEntityToken extends TokenBase {
  578. type: TokenType$1.ENCODED_ENTITY;
  579. parts: [decoded: string, encoded: string];
  580. }
  581. interface AttributeValueTextToken extends TokenBase {
  582. type: TokenType$1.ATTR_VALUE_TEXT;
  583. parts: [value: string];
  584. }
  585. interface AttributeValueInterpolationToken extends TokenBase {
  586. type: TokenType$1.ATTR_VALUE_INTERPOLATION;
  587. parts: [startMarker: string, expression: string, endMarker: string] | [startMarker: string, expression: string];
  588. }
  589. interface BaseNode {
  590. sourceSpan: ParseSourceSpan;
  591. visit(visitor: Visitor$1, context: any): any;
  592. }
  593. type Node$1 = Attribute | Comment$1 | Element$1 | Expansion | ExpansionCase | Text$1 | Block | BlockParameter;
  594. declare abstract class NodeWithI18n implements BaseNode {
  595. sourceSpan: ParseSourceSpan;
  596. i18n?: I18nMeta$1 | undefined;
  597. constructor(sourceSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined);
  598. abstract visit(visitor: Visitor$1, context: any): any;
  599. }
  600. declare class Text$1 extends NodeWithI18n {
  601. value: string;
  602. tokens: InterpolatedTextToken[];
  603. constructor(value: string, sourceSpan: ParseSourceSpan, tokens: InterpolatedTextToken[], i18n?: I18nMeta$1);
  604. visit(visitor: Visitor$1, context: any): any;
  605. }
  606. declare class Expansion extends NodeWithI18n {
  607. switchValue: string;
  608. type: string;
  609. cases: ExpansionCase[];
  610. switchValueSourceSpan: ParseSourceSpan;
  611. constructor(switchValue: string, type: string, cases: ExpansionCase[], sourceSpan: ParseSourceSpan, switchValueSourceSpan: ParseSourceSpan, i18n?: I18nMeta$1);
  612. visit(visitor: Visitor$1, context: any): any;
  613. }
  614. declare class ExpansionCase implements BaseNode {
  615. value: string;
  616. expression: Node$1[];
  617. sourceSpan: ParseSourceSpan;
  618. valueSourceSpan: ParseSourceSpan;
  619. expSourceSpan: ParseSourceSpan;
  620. constructor(value: string, expression: Node$1[], sourceSpan: ParseSourceSpan, valueSourceSpan: ParseSourceSpan, expSourceSpan: ParseSourceSpan);
  621. visit(visitor: Visitor$1, context: any): any;
  622. }
  623. declare class Attribute extends NodeWithI18n {
  624. name: string;
  625. value: string;
  626. readonly keySpan: ParseSourceSpan | undefined;
  627. valueSpan: ParseSourceSpan | undefined;
  628. valueTokens: InterpolatedAttributeToken[] | undefined;
  629. constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan | undefined, valueSpan: ParseSourceSpan | undefined, valueTokens: InterpolatedAttributeToken[] | undefined, i18n: I18nMeta$1 | undefined);
  630. visit(visitor: Visitor$1, context: any): any;
  631. }
  632. declare class Element$1 extends NodeWithI18n {
  633. name: string;
  634. attrs: Attribute[];
  635. children: Node$1[];
  636. startSourceSpan: ParseSourceSpan;
  637. endSourceSpan: ParseSourceSpan | null;
  638. constructor(name: string, attrs: Attribute[], children: Node$1[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan?: ParseSourceSpan | null, i18n?: I18nMeta$1);
  639. visit(visitor: Visitor$1, context: any): any;
  640. }
  641. declare class Comment$1 implements BaseNode {
  642. value: string | null;
  643. sourceSpan: ParseSourceSpan;
  644. constructor(value: string | null, sourceSpan: ParseSourceSpan);
  645. visit(visitor: Visitor$1, context: any): any;
  646. }
  647. declare class Block extends NodeWithI18n {
  648. name: string;
  649. parameters: BlockParameter[];
  650. children: Node$1[];
  651. nameSpan: ParseSourceSpan;
  652. startSourceSpan: ParseSourceSpan;
  653. endSourceSpan: ParseSourceSpan | null;
  654. constructor(name: string, parameters: BlockParameter[], children: Node$1[], sourceSpan: ParseSourceSpan, nameSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan?: ParseSourceSpan | null, i18n?: I18nMeta$1);
  655. visit(visitor: Visitor$1, context: any): any;
  656. }
  657. declare class BlockParameter implements BaseNode {
  658. expression: string;
  659. sourceSpan: ParseSourceSpan;
  660. constructor(expression: string, sourceSpan: ParseSourceSpan);
  661. visit(visitor: Visitor$1, context: any): any;
  662. }
  663. declare class LetDeclaration$1 implements BaseNode {
  664. name: string;
  665. value: string;
  666. sourceSpan: ParseSourceSpan;
  667. readonly nameSpan: ParseSourceSpan;
  668. valueSpan: ParseSourceSpan;
  669. constructor(name: string, value: string, sourceSpan: ParseSourceSpan, nameSpan: ParseSourceSpan, valueSpan: ParseSourceSpan);
  670. visit(visitor: Visitor$1, context: any): any;
  671. }
  672. interface Visitor$1 {
  673. visit?(node: Node$1, context: any): any;
  674. visitElement(element: Element$1, context: any): any;
  675. visitAttribute(attribute: Attribute, context: any): any;
  676. visitText(text: Text$1, context: any): any;
  677. visitComment(comment: Comment$1, context: any): any;
  678. visitExpansion(expansion: Expansion, context: any): any;
  679. visitExpansionCase(expansionCase: ExpansionCase, context: any): any;
  680. visitBlock(block: Block, context: any): any;
  681. visitBlockParameter(parameter: BlockParameter, context: any): any;
  682. visitLetDeclaration(decl: LetDeclaration$1, context: any): any;
  683. }
  684. declare function visitAll$1(visitor: Visitor$1, nodes: Node$1[], context?: any): any[];
  685. declare class RecursiveVisitor$1 implements Visitor$1 {
  686. constructor();
  687. visitElement(ast: Element$1, context: any): any;
  688. visitAttribute(ast: Attribute, context: any): any;
  689. visitText(ast: Text$1, context: any): any;
  690. visitComment(ast: Comment$1, context: any): any;
  691. visitExpansion(ast: Expansion, context: any): any;
  692. visitExpansionCase(ast: ExpansionCase, context: any): any;
  693. visitBlock(block: Block, context: any): any;
  694. visitBlockParameter(ast: BlockParameter, context: any): any;
  695. visitLetDeclaration(decl: LetDeclaration$1, context: any): void;
  696. private visitChildren;
  697. }
  698. declare class InterpolationConfig {
  699. start: string;
  700. end: string;
  701. static fromArray(markers: [string, string] | null): InterpolationConfig;
  702. constructor(start: string, end: string);
  703. }
  704. declare const DEFAULT_INTERPOLATION_CONFIG: InterpolationConfig;
  705. declare enum TagContentType {
  706. RAW_TEXT = 0,
  707. ESCAPABLE_RAW_TEXT = 1,
  708. PARSABLE_DATA = 2
  709. }
  710. interface TagDefinition {
  711. closedByParent: boolean;
  712. implicitNamespacePrefix: string | null;
  713. isVoid: boolean;
  714. ignoreFirstLf: boolean;
  715. canSelfClose: boolean;
  716. preventNamespaceInheritance: boolean;
  717. isClosedByChild(name: string): boolean;
  718. getContentType(prefix?: string): TagContentType;
  719. }
  720. declare function splitNsName(elementName: string, fatal?: boolean): [string | null, string];
  721. declare function isNgContainer(tagName: string): boolean;
  722. declare function isNgContent(tagName: string): boolean;
  723. declare function isNgTemplate(tagName: string): boolean;
  724. declare function getNsPrefix(fullName: string): string;
  725. declare function getNsPrefix(fullName: null): null;
  726. declare function mergeNsAndName(prefix: string, localName: string): string;
  727. interface LexerRange {
  728. startPos: number;
  729. startLine: number;
  730. startCol: number;
  731. endPos: number;
  732. }
  733. /**
  734. * Options that modify how the text is tokenized.
  735. */
  736. interface TokenizeOptions {
  737. /** Whether to tokenize ICU messages (considered as text nodes when false). */
  738. tokenizeExpansionForms?: boolean;
  739. /** How to tokenize interpolation markers. */
  740. interpolationConfig?: InterpolationConfig;
  741. /**
  742. * The start and end point of the text to parse within the `source` string.
  743. * The entire `source` string is parsed if this is not provided.
  744. * */
  745. range?: LexerRange;
  746. /**
  747. * If this text is stored in a JavaScript string, then we have to deal with escape sequences.
  748. *
  749. * **Example 1:**
  750. *
  751. * ```
  752. * "abc\"def\nghi"
  753. * ```
  754. *
  755. * - The `\"` must be converted to `"`.
  756. * - The `\n` must be converted to a new line character in a token,
  757. * but it should not increment the current line for source mapping.
  758. *
  759. * **Example 2:**
  760. *
  761. * ```
  762. * "abc\
  763. * def"
  764. * ```
  765. *
  766. * The line continuation (`\` followed by a newline) should be removed from a token
  767. * but the new line should increment the current line for source mapping.
  768. */
  769. escapedString?: boolean;
  770. /**
  771. * If this text is stored in an external template (e.g. via `templateUrl`) then we need to decide
  772. * whether or not to normalize the line-endings (from `\r\n` to `\n`) when processing ICU
  773. * expressions.
  774. *
  775. * If `true` then we will normalize ICU expression line endings.
  776. * The default is `false`, but this will be switched in a future major release.
  777. */
  778. i18nNormalizeLineEndingsInICUs?: boolean;
  779. /**
  780. * An array of characters that should be considered as leading trivia.
  781. * Leading trivia are characters that are not important to the developer, and so should not be
  782. * included in source-map segments. A common example is whitespace.
  783. */
  784. leadingTriviaChars?: string[];
  785. /**
  786. * If true, do not convert CRLF to LF.
  787. */
  788. preserveLineEndings?: boolean;
  789. /**
  790. * Whether to tokenize @ block syntax. Otherwise considered text,
  791. * or ICU tokens if `tokenizeExpansionForms` is enabled.
  792. */
  793. tokenizeBlocks?: boolean;
  794. /**
  795. * Whether to tokenize the `@let` syntax. Otherwise will be considered either
  796. * text or an incomplete block, depending on whether `tokenizeBlocks` is enabled.
  797. */
  798. tokenizeLet?: boolean;
  799. }
  800. declare class TreeError extends ParseError {
  801. elementName: string | null;
  802. static create(elementName: string | null, span: ParseSourceSpan, msg: string): TreeError;
  803. constructor(elementName: string | null, span: ParseSourceSpan, msg: string);
  804. }
  805. declare class ParseTreeResult {
  806. rootNodes: Node$1[];
  807. errors: ParseError[];
  808. constructor(rootNodes: Node$1[], errors: ParseError[]);
  809. }
  810. declare class Parser$1 {
  811. getTagDefinition: (tagName: string) => TagDefinition;
  812. constructor(getTagDefinition: (tagName: string) => TagDefinition);
  813. parse(source: string, url: string, options?: TokenizeOptions): ParseTreeResult;
  814. }
  815. type I18nMeta = {
  816. id?: string;
  817. customId?: string;
  818. legacyIds?: string[];
  819. description?: string;
  820. meaning?: string;
  821. };
  822. declare enum TypeModifier {
  823. None = 0,
  824. Const = 1
  825. }
  826. declare abstract class Type {
  827. modifiers: TypeModifier;
  828. constructor(modifiers?: TypeModifier);
  829. abstract visitType(visitor: TypeVisitor, context: any): any;
  830. hasModifier(modifier: TypeModifier): boolean;
  831. }
  832. declare enum BuiltinTypeName {
  833. Dynamic = 0,
  834. Bool = 1,
  835. String = 2,
  836. Int = 3,
  837. Number = 4,
  838. Function = 5,
  839. Inferred = 6,
  840. None = 7
  841. }
  842. declare class BuiltinType extends Type {
  843. name: BuiltinTypeName;
  844. constructor(name: BuiltinTypeName, modifiers?: TypeModifier);
  845. visitType(visitor: TypeVisitor, context: any): any;
  846. }
  847. declare class ExpressionType extends Type {
  848. value: Expression;
  849. typeParams: Type[] | null;
  850. constructor(value: Expression, modifiers?: TypeModifier, typeParams?: Type[] | null);
  851. visitType(visitor: TypeVisitor, context: any): any;
  852. }
  853. declare class ArrayType extends Type {
  854. of: Type;
  855. constructor(of: Type, modifiers?: TypeModifier);
  856. visitType(visitor: TypeVisitor, context: any): any;
  857. }
  858. declare class MapType extends Type {
  859. valueType: Type | null;
  860. constructor(valueType: Type | null | undefined, modifiers?: TypeModifier);
  861. visitType(visitor: TypeVisitor, context: any): any;
  862. }
  863. declare class TransplantedType<T> extends Type {
  864. readonly type: T;
  865. constructor(type: T, modifiers?: TypeModifier);
  866. visitType(visitor: TypeVisitor, context: any): any;
  867. }
  868. declare const DYNAMIC_TYPE: BuiltinType;
  869. declare const INFERRED_TYPE: BuiltinType;
  870. declare const BOOL_TYPE: BuiltinType;
  871. declare const INT_TYPE: BuiltinType;
  872. declare const NUMBER_TYPE: BuiltinType;
  873. declare const STRING_TYPE: BuiltinType;
  874. declare const FUNCTION_TYPE: BuiltinType;
  875. declare const NONE_TYPE: BuiltinType;
  876. interface TypeVisitor {
  877. visitBuiltinType(type: BuiltinType, context: any): any;
  878. visitExpressionType(type: ExpressionType, context: any): any;
  879. visitArrayType(type: ArrayType, context: any): any;
  880. visitMapType(type: MapType, context: any): any;
  881. visitTransplantedType(type: TransplantedType<unknown>, context: any): any;
  882. }
  883. declare enum UnaryOperator {
  884. Minus = 0,
  885. Plus = 1
  886. }
  887. declare enum BinaryOperator {
  888. Equals = 0,
  889. NotEquals = 1,
  890. Identical = 2,
  891. NotIdentical = 3,
  892. Minus = 4,
  893. Plus = 5,
  894. Divide = 6,
  895. Multiply = 7,
  896. Modulo = 8,
  897. And = 9,
  898. Or = 10,
  899. BitwiseOr = 11,
  900. BitwiseAnd = 12,
  901. Lower = 13,
  902. LowerEquals = 14,
  903. Bigger = 15,
  904. BiggerEquals = 16,
  905. NullishCoalesce = 17
  906. }
  907. declare function nullSafeIsEquivalent<T extends {
  908. isEquivalent(other: T): boolean;
  909. }>(base: T | null, other: T | null): boolean;
  910. declare function areAllEquivalent<T extends {
  911. isEquivalent(other: T): boolean;
  912. }>(base: T[], other: T[]): boolean;
  913. declare abstract class Expression {
  914. type: Type | null;
  915. sourceSpan: ParseSourceSpan | null;
  916. constructor(type: Type | null | undefined, sourceSpan?: ParseSourceSpan | null);
  917. abstract visitExpression(visitor: ExpressionVisitor, context: any): any;
  918. /**
  919. * Calculates whether this expression produces the same value as the given expression.
  920. * Note: We don't check Types nor ParseSourceSpans nor function arguments.
  921. */
  922. abstract isEquivalent(e: Expression): boolean;
  923. /**
  924. * Return true if the expression is constant.
  925. */
  926. abstract isConstant(): boolean;
  927. abstract clone(): Expression;
  928. prop(name: string, sourceSpan?: ParseSourceSpan | null): ReadPropExpr;
  929. key(index: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null): ReadKeyExpr;
  930. callFn(params: Expression[], sourceSpan?: ParseSourceSpan | null, pure?: boolean): InvokeFunctionExpr;
  931. instantiate(params: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): InstantiateExpr;
  932. conditional(trueCase: Expression, falseCase?: Expression | null, sourceSpan?: ParseSourceSpan | null): ConditionalExpr;
  933. equals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  934. notEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  935. identical(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  936. notIdentical(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  937. minus(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  938. plus(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  939. divide(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  940. multiply(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  941. modulo(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  942. and(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  943. bitwiseOr(rhs: Expression, sourceSpan?: ParseSourceSpan | null, parens?: boolean): BinaryOperatorExpr;
  944. bitwiseAnd(rhs: Expression, sourceSpan?: ParseSourceSpan | null, parens?: boolean): BinaryOperatorExpr;
  945. or(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  946. lower(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  947. lowerEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  948. bigger(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  949. biggerEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  950. isBlank(sourceSpan?: ParseSourceSpan | null): Expression;
  951. nullishCoalesce(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
  952. toStmt(): Statement;
  953. }
  954. declare class ReadVarExpr extends Expression {
  955. name: string;
  956. constructor(name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  957. isEquivalent(e: Expression): boolean;
  958. isConstant(): boolean;
  959. visitExpression(visitor: ExpressionVisitor, context: any): any;
  960. clone(): ReadVarExpr;
  961. set(value: Expression): WriteVarExpr;
  962. }
  963. declare class TypeofExpr extends Expression {
  964. expr: Expression;
  965. constructor(expr: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  966. visitExpression(visitor: ExpressionVisitor, context: any): any;
  967. isEquivalent(e: Expression): boolean;
  968. isConstant(): boolean;
  969. clone(): TypeofExpr;
  970. }
  971. declare class WrappedNodeExpr<T> extends Expression {
  972. node: T;
  973. constructor(node: T, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  974. isEquivalent(e: Expression): boolean;
  975. isConstant(): boolean;
  976. visitExpression(visitor: ExpressionVisitor, context: any): any;
  977. clone(): WrappedNodeExpr<T>;
  978. }
  979. declare class WriteVarExpr extends Expression {
  980. name: string;
  981. value: Expression;
  982. constructor(name: string, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  983. isEquivalent(e: Expression): boolean;
  984. isConstant(): boolean;
  985. visitExpression(visitor: ExpressionVisitor, context: any): any;
  986. clone(): WriteVarExpr;
  987. toDeclStmt(type?: Type | null, modifiers?: StmtModifier): DeclareVarStmt;
  988. toConstDecl(): DeclareVarStmt;
  989. }
  990. declare class WriteKeyExpr extends Expression {
  991. receiver: Expression;
  992. index: Expression;
  993. value: Expression;
  994. constructor(receiver: Expression, index: Expression, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  995. isEquivalent(e: Expression): boolean;
  996. isConstant(): boolean;
  997. visitExpression(visitor: ExpressionVisitor, context: any): any;
  998. clone(): WriteKeyExpr;
  999. }
  1000. declare class WritePropExpr extends Expression {
  1001. receiver: Expression;
  1002. name: string;
  1003. value: Expression;
  1004. constructor(receiver: Expression, name: string, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  1005. isEquivalent(e: Expression): boolean;
  1006. isConstant(): boolean;
  1007. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1008. clone(): WritePropExpr;
  1009. }
  1010. declare class InvokeFunctionExpr extends Expression {
  1011. fn: Expression;
  1012. args: Expression[];
  1013. pure: boolean;
  1014. constructor(fn: Expression, args: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null, pure?: boolean);
  1015. get receiver(): Expression;
  1016. isEquivalent(e: Expression): boolean;
  1017. isConstant(): boolean;
  1018. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1019. clone(): InvokeFunctionExpr;
  1020. }
  1021. declare class TaggedTemplateLiteralExpr extends Expression {
  1022. tag: Expression;
  1023. template: TemplateLiteralExpr;
  1024. constructor(tag: Expression, template: TemplateLiteralExpr, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  1025. isEquivalent(e: Expression): boolean;
  1026. isConstant(): boolean;
  1027. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1028. clone(): TaggedTemplateLiteralExpr;
  1029. }
  1030. declare class InstantiateExpr extends Expression {
  1031. classExpr: Expression;
  1032. args: Expression[];
  1033. constructor(classExpr: Expression, args: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  1034. isEquivalent(e: Expression): boolean;
  1035. isConstant(): boolean;
  1036. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1037. clone(): InstantiateExpr;
  1038. }
  1039. declare class LiteralExpr extends Expression {
  1040. value: number | string | boolean | null | undefined;
  1041. constructor(value: number | string | boolean | null | undefined, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  1042. isEquivalent(e: Expression): boolean;
  1043. isConstant(): boolean;
  1044. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1045. clone(): LiteralExpr;
  1046. }
  1047. declare class TemplateLiteralExpr extends Expression {
  1048. elements: TemplateLiteralElementExpr[];
  1049. expressions: Expression[];
  1050. constructor(elements: TemplateLiteralElementExpr[], expressions: Expression[], sourceSpan?: ParseSourceSpan | null);
  1051. isEquivalent(e: Expression): boolean;
  1052. isConstant(): boolean;
  1053. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1054. clone(): TemplateLiteralExpr;
  1055. }
  1056. declare class TemplateLiteralElementExpr extends Expression {
  1057. text: string;
  1058. rawText: string;
  1059. constructor(text: string, sourceSpan?: ParseSourceSpan | null, rawText?: string);
  1060. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1061. isEquivalent(e: Expression): boolean;
  1062. isConstant(): boolean;
  1063. clone(): TemplateLiteralElementExpr;
  1064. }
  1065. declare class LiteralPiece {
  1066. text: string;
  1067. sourceSpan: ParseSourceSpan;
  1068. constructor(text: string, sourceSpan: ParseSourceSpan);
  1069. }
  1070. declare class PlaceholderPiece {
  1071. text: string;
  1072. sourceSpan: ParseSourceSpan;
  1073. associatedMessage?: Message | undefined;
  1074. /**
  1075. * Create a new instance of a `PlaceholderPiece`.
  1076. *
  1077. * @param text the name of this placeholder (e.g. `PH_1`).
  1078. * @param sourceSpan the location of this placeholder in its localized message the source code.
  1079. * @param associatedMessage reference to another message that this placeholder is associated with.
  1080. * The `associatedMessage` is mainly used to provide a relationship to an ICU message that has
  1081. * been extracted out from the message containing the placeholder.
  1082. */
  1083. constructor(text: string, sourceSpan: ParseSourceSpan, associatedMessage?: Message | undefined);
  1084. }
  1085. type MessagePiece = LiteralPiece | PlaceholderPiece;
  1086. declare class LocalizedString extends Expression {
  1087. readonly metaBlock: I18nMeta;
  1088. readonly messageParts: LiteralPiece[];
  1089. readonly placeHolderNames: PlaceholderPiece[];
  1090. readonly expressions: Expression[];
  1091. constructor(metaBlock: I18nMeta, messageParts: LiteralPiece[], placeHolderNames: PlaceholderPiece[], expressions: Expression[], sourceSpan?: ParseSourceSpan | null);
  1092. isEquivalent(e: Expression): boolean;
  1093. isConstant(): boolean;
  1094. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1095. clone(): LocalizedString;
  1096. /**
  1097. * Serialize the given `meta` and `messagePart` into "cooked" and "raw" strings that can be used
  1098. * in a `$localize` tagged string. The format of the metadata is the same as that parsed by
  1099. * `parseI18nMeta()`.
  1100. *
  1101. * @param meta The metadata to serialize
  1102. * @param messagePart The first part of the tagged string
  1103. */
  1104. serializeI18nHead(): CookedRawString;
  1105. getMessagePartSourceSpan(i: number): ParseSourceSpan | null;
  1106. getPlaceholderSourceSpan(i: number): ParseSourceSpan;
  1107. /**
  1108. * Serialize the given `placeholderName` and `messagePart` into "cooked" and "raw" strings that
  1109. * can be used in a `$localize` tagged string.
  1110. *
  1111. * The format is `:<placeholder-name>[@@<associated-id>]:`.
  1112. *
  1113. * The `associated-id` is the message id of the (usually an ICU) message to which this placeholder
  1114. * refers.
  1115. *
  1116. * @param partIndex The index of the message part to serialize.
  1117. */
  1118. serializeI18nTemplatePart(partIndex: number): CookedRawString;
  1119. }
  1120. /**
  1121. * A structure to hold the cooked and raw strings of a template literal element, along with its
  1122. * source-span range.
  1123. */
  1124. interface CookedRawString {
  1125. cooked: string;
  1126. raw: string;
  1127. range: ParseSourceSpan | null;
  1128. }
  1129. declare class ExternalExpr extends Expression {
  1130. value: ExternalReference;
  1131. typeParams: Type[] | null;
  1132. constructor(value: ExternalReference, type?: Type | null, typeParams?: Type[] | null, sourceSpan?: ParseSourceSpan | null);
  1133. isEquivalent(e: Expression): boolean;
  1134. isConstant(): boolean;
  1135. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1136. clone(): ExternalExpr;
  1137. }
  1138. declare class ExternalReference {
  1139. moduleName: string | null;
  1140. name: string | null;
  1141. constructor(moduleName: string | null, name: string | null);
  1142. }
  1143. declare class ConditionalExpr extends Expression {
  1144. condition: Expression;
  1145. falseCase: Expression | null;
  1146. trueCase: Expression;
  1147. constructor(condition: Expression, trueCase: Expression, falseCase?: Expression | null, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  1148. isEquivalent(e: Expression): boolean;
  1149. isConstant(): boolean;
  1150. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1151. clone(): ConditionalExpr;
  1152. }
  1153. declare class DynamicImportExpr extends Expression {
  1154. url: string | Expression;
  1155. urlComment?: string | undefined;
  1156. constructor(url: string | Expression, sourceSpan?: ParseSourceSpan | null, urlComment?: string | undefined);
  1157. isEquivalent(e: Expression): boolean;
  1158. isConstant(): boolean;
  1159. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1160. clone(): DynamicImportExpr;
  1161. }
  1162. declare class NotExpr extends Expression {
  1163. condition: Expression;
  1164. constructor(condition: Expression, sourceSpan?: ParseSourceSpan | null);
  1165. isEquivalent(e: Expression): boolean;
  1166. isConstant(): boolean;
  1167. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1168. clone(): NotExpr;
  1169. }
  1170. declare class FnParam {
  1171. name: string;
  1172. type: Type | null;
  1173. constructor(name: string, type?: Type | null);
  1174. isEquivalent(param: FnParam): boolean;
  1175. clone(): FnParam;
  1176. }
  1177. declare class FunctionExpr extends Expression {
  1178. params: FnParam[];
  1179. statements: Statement[];
  1180. name?: string | null | undefined;
  1181. constructor(params: FnParam[], statements: Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null, name?: string | null | undefined);
  1182. isEquivalent(e: Expression | Statement): boolean;
  1183. isConstant(): boolean;
  1184. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1185. toDeclStmt(name: string, modifiers?: StmtModifier): DeclareFunctionStmt;
  1186. clone(): FunctionExpr;
  1187. }
  1188. declare class ArrowFunctionExpr extends Expression {
  1189. params: FnParam[];
  1190. body: Expression | Statement[];
  1191. constructor(params: FnParam[], body: Expression | Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  1192. isEquivalent(e: Expression): boolean;
  1193. isConstant(): boolean;
  1194. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1195. clone(): Expression;
  1196. toDeclStmt(name: string, modifiers?: StmtModifier): DeclareVarStmt;
  1197. }
  1198. declare class UnaryOperatorExpr extends Expression {
  1199. operator: UnaryOperator;
  1200. expr: Expression;
  1201. parens: boolean;
  1202. constructor(operator: UnaryOperator, expr: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null, parens?: boolean);
  1203. isEquivalent(e: Expression): boolean;
  1204. isConstant(): boolean;
  1205. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1206. clone(): UnaryOperatorExpr;
  1207. }
  1208. declare class BinaryOperatorExpr extends Expression {
  1209. operator: BinaryOperator;
  1210. rhs: Expression;
  1211. parens: boolean;
  1212. lhs: Expression;
  1213. constructor(operator: BinaryOperator, lhs: Expression, rhs: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null, parens?: boolean);
  1214. isEquivalent(e: Expression): boolean;
  1215. isConstant(): boolean;
  1216. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1217. clone(): BinaryOperatorExpr;
  1218. }
  1219. declare class ReadPropExpr extends Expression {
  1220. receiver: Expression;
  1221. name: string;
  1222. constructor(receiver: Expression, name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  1223. get index(): string;
  1224. isEquivalent(e: Expression): boolean;
  1225. isConstant(): boolean;
  1226. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1227. set(value: Expression): WritePropExpr;
  1228. clone(): ReadPropExpr;
  1229. }
  1230. declare class ReadKeyExpr extends Expression {
  1231. receiver: Expression;
  1232. index: Expression;
  1233. constructor(receiver: Expression, index: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  1234. isEquivalent(e: Expression): boolean;
  1235. isConstant(): boolean;
  1236. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1237. set(value: Expression): WriteKeyExpr;
  1238. clone(): ReadKeyExpr;
  1239. }
  1240. declare class LiteralArrayExpr extends Expression {
  1241. entries: Expression[];
  1242. constructor(entries: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null);
  1243. isConstant(): boolean;
  1244. isEquivalent(e: Expression): boolean;
  1245. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1246. clone(): LiteralArrayExpr;
  1247. }
  1248. declare class LiteralMapEntry {
  1249. key: string;
  1250. value: Expression;
  1251. quoted: boolean;
  1252. constructor(key: string, value: Expression, quoted: boolean);
  1253. isEquivalent(e: LiteralMapEntry): boolean;
  1254. clone(): LiteralMapEntry;
  1255. }
  1256. declare class LiteralMapExpr extends Expression {
  1257. entries: LiteralMapEntry[];
  1258. valueType: Type | null;
  1259. constructor(entries: LiteralMapEntry[], type?: MapType | null, sourceSpan?: ParseSourceSpan | null);
  1260. isEquivalent(e: Expression): boolean;
  1261. isConstant(): boolean;
  1262. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1263. clone(): LiteralMapExpr;
  1264. }
  1265. declare class CommaExpr extends Expression {
  1266. parts: Expression[];
  1267. constructor(parts: Expression[], sourceSpan?: ParseSourceSpan | null);
  1268. isEquivalent(e: Expression): boolean;
  1269. isConstant(): boolean;
  1270. visitExpression(visitor: ExpressionVisitor, context: any): any;
  1271. clone(): CommaExpr;
  1272. }
  1273. interface ExpressionVisitor {
  1274. visitReadVarExpr(ast: ReadVarExpr, context: any): any;
  1275. visitWriteVarExpr(expr: WriteVarExpr, context: any): any;
  1276. visitWriteKeyExpr(expr: WriteKeyExpr, context: any): any;
  1277. visitWritePropExpr(expr: WritePropExpr, context: any): any;
  1278. visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any;
  1279. visitTaggedTemplateLiteralExpr(ast: TaggedTemplateLiteralExpr, context: any): any;
  1280. visitTemplateLiteralExpr(ast: TemplateLiteralExpr, context: any): any;
  1281. visitTemplateLiteralElementExpr(ast: TemplateLiteralElementExpr, context: any): any;
  1282. visitInstantiateExpr(ast: InstantiateExpr, context: any): any;
  1283. visitLiteralExpr(ast: LiteralExpr, context: any): any;
  1284. visitLocalizedString(ast: LocalizedString, context: any): any;
  1285. visitExternalExpr(ast: ExternalExpr, context: any): any;
  1286. visitConditionalExpr(ast: ConditionalExpr, context: any): any;
  1287. visitDynamicImportExpr(ast: DynamicImportExpr, context: any): any;
  1288. visitNotExpr(ast: NotExpr, context: any): any;
  1289. visitFunctionExpr(ast: FunctionExpr, context: any): any;
  1290. visitUnaryOperatorExpr(ast: UnaryOperatorExpr, context: any): any;
  1291. visitBinaryOperatorExpr(ast: BinaryOperatorExpr, context: any): any;
  1292. visitReadPropExpr(ast: ReadPropExpr, context: any): any;
  1293. visitReadKeyExpr(ast: ReadKeyExpr, context: any): any;
  1294. visitLiteralArrayExpr(ast: LiteralArrayExpr, context: any): any;
  1295. visitLiteralMapExpr(ast: LiteralMapExpr, context: any): any;
  1296. visitCommaExpr(ast: CommaExpr, context: any): any;
  1297. visitWrappedNodeExpr(ast: WrappedNodeExpr<any>, context: any): any;
  1298. visitTypeofExpr(ast: TypeofExpr, context: any): any;
  1299. visitArrowFunctionExpr(ast: ArrowFunctionExpr, context: any): any;
  1300. }
  1301. declare const NULL_EXPR: LiteralExpr;
  1302. declare const TYPED_NULL_EXPR: LiteralExpr;
  1303. declare enum StmtModifier {
  1304. None = 0,
  1305. Final = 1,
  1306. Private = 2,
  1307. Exported = 4,
  1308. Static = 8
  1309. }
  1310. declare class LeadingComment {
  1311. text: string;
  1312. multiline: boolean;
  1313. trailingNewline: boolean;
  1314. constructor(text: string, multiline: boolean, trailingNewline: boolean);
  1315. toString(): string;
  1316. }
  1317. declare class JSDocComment extends LeadingComment {
  1318. tags: JSDocTag[];
  1319. constructor(tags: JSDocTag[]);
  1320. toString(): string;
  1321. }
  1322. declare abstract class Statement {
  1323. modifiers: StmtModifier;
  1324. sourceSpan: ParseSourceSpan | null;
  1325. leadingComments?: LeadingComment[] | undefined;
  1326. constructor(modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[] | undefined);
  1327. /**
  1328. * Calculates whether this statement produces the same value as the given statement.
  1329. * Note: We don't check Types nor ParseSourceSpans nor function arguments.
  1330. */
  1331. abstract isEquivalent(stmt: Statement): boolean;
  1332. abstract visitStatement(visitor: StatementVisitor, context: any): any;
  1333. hasModifier(modifier: StmtModifier): boolean;
  1334. addLeadingComment(leadingComment: LeadingComment): void;
  1335. }
  1336. declare class DeclareVarStmt extends Statement {
  1337. name: string;
  1338. value?: Expression | undefined;
  1339. type: Type | null;
  1340. constructor(name: string, value?: Expression | undefined, type?: Type | null, modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
  1341. isEquivalent(stmt: Statement): boolean;
  1342. visitStatement(visitor: StatementVisitor, context: any): any;
  1343. }
  1344. declare class DeclareFunctionStmt extends Statement {
  1345. name: string;
  1346. params: FnParam[];
  1347. statements: Statement[];
  1348. type: Type | null;
  1349. constructor(name: string, params: FnParam[], statements: Statement[], type?: Type | null, modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
  1350. isEquivalent(stmt: Statement): boolean;
  1351. visitStatement(visitor: StatementVisitor, context: any): any;
  1352. }
  1353. declare class ExpressionStatement extends Statement {
  1354. expr: Expression;
  1355. constructor(expr: Expression, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
  1356. isEquivalent(stmt: Statement): boolean;
  1357. visitStatement(visitor: StatementVisitor, context: any): any;
  1358. }
  1359. declare class ReturnStatement extends Statement {
  1360. value: Expression;
  1361. constructor(value: Expression, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
  1362. isEquivalent(stmt: Statement): boolean;
  1363. visitStatement(visitor: StatementVisitor, context: any): any;
  1364. }
  1365. declare class IfStmt extends Statement {
  1366. condition: Expression;
  1367. trueCase: Statement[];
  1368. falseCase: Statement[];
  1369. constructor(condition: Expression, trueCase: Statement[], falseCase?: Statement[], sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
  1370. isEquivalent(stmt: Statement): boolean;
  1371. visitStatement(visitor: StatementVisitor, context: any): any;
  1372. }
  1373. interface StatementVisitor {
  1374. visitDeclareVarStmt(stmt: DeclareVarStmt, context: any): any;
  1375. visitDeclareFunctionStmt(stmt: DeclareFunctionStmt, context: any): any;
  1376. visitExpressionStmt(stmt: ExpressionStatement, context: any): any;
  1377. visitReturnStmt(stmt: ReturnStatement, context: any): any;
  1378. visitIfStmt(stmt: IfStmt, context: any): any;
  1379. }
  1380. declare class RecursiveAstVisitor$1 implements StatementVisitor, ExpressionVisitor {
  1381. visitType(ast: Type, context: any): any;
  1382. visitExpression(ast: Expression, context: any): any;
  1383. visitBuiltinType(type: BuiltinType, context: any): any;
  1384. visitExpressionType(type: ExpressionType, context: any): any;
  1385. visitArrayType(type: ArrayType, context: any): any;
  1386. visitMapType(type: MapType, context: any): any;
  1387. visitTransplantedType(type: TransplantedType<unknown>, context: any): any;
  1388. visitWrappedNodeExpr(ast: WrappedNodeExpr<any>, context: any): any;
  1389. visitTypeofExpr(ast: TypeofExpr, context: any): any;
  1390. visitReadVarExpr(ast: ReadVarExpr, context: any): any;
  1391. visitWriteVarExpr(ast: WriteVarExpr, context: any): any;
  1392. visitWriteKeyExpr(ast: WriteKeyExpr, context: any): any;
  1393. visitWritePropExpr(ast: WritePropExpr, context: any): any;
  1394. visitDynamicImportExpr(ast: DynamicImportExpr, context: any): any;
  1395. visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any;
  1396. visitTaggedTemplateLiteralExpr(ast: TaggedTemplateLiteralExpr, context: any): any;
  1397. visitInstantiateExpr(ast: InstantiateExpr, context: any): any;
  1398. visitLiteralExpr(ast: LiteralExpr, context: any): any;
  1399. visitLocalizedString(ast: LocalizedString, context: any): any;
  1400. visitExternalExpr(ast: ExternalExpr, context: any): any;
  1401. visitConditionalExpr(ast: ConditionalExpr, context: any): any;
  1402. visitNotExpr(ast: NotExpr, context: any): any;
  1403. visitFunctionExpr(ast: FunctionExpr, context: any): any;
  1404. visitArrowFunctionExpr(ast: ArrowFunctionExpr, context: any): any;
  1405. visitUnaryOperatorExpr(ast: UnaryOperatorExpr, context: any): any;
  1406. visitBinaryOperatorExpr(ast: BinaryOperatorExpr, context: any): any;
  1407. visitReadPropExpr(ast: ReadPropExpr, context: any): any;
  1408. visitReadKeyExpr(ast: ReadKeyExpr, context: any): any;
  1409. visitLiteralArrayExpr(ast: LiteralArrayExpr, context: any): any;
  1410. visitLiteralMapExpr(ast: LiteralMapExpr, context: any): any;
  1411. visitCommaExpr(ast: CommaExpr, context: any): any;
  1412. visitTemplateLiteralExpr(ast: TemplateLiteralExpr, context: any): any;
  1413. visitTemplateLiteralElementExpr(ast: TemplateLiteralElementExpr, context: any): any;
  1414. visitAllExpressions(exprs: Expression[], context: any): void;
  1415. visitDeclareVarStmt(stmt: DeclareVarStmt, context: any): any;
  1416. visitDeclareFunctionStmt(stmt: DeclareFunctionStmt, context: any): any;
  1417. visitExpressionStmt(stmt: ExpressionStatement, context: any): any;
  1418. visitReturnStmt(stmt: ReturnStatement, context: any): any;
  1419. visitIfStmt(stmt: IfStmt, context: any): any;
  1420. visitAllStatements(stmts: Statement[], context: any): void;
  1421. }
  1422. declare function leadingComment(text: string, multiline?: boolean, trailingNewline?: boolean): LeadingComment;
  1423. declare function jsDocComment(tags?: JSDocTag[]): JSDocComment;
  1424. declare function variable(name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null): ReadVarExpr;
  1425. declare function importExpr(id: ExternalReference, typeParams?: Type[] | null, sourceSpan?: ParseSourceSpan | null): ExternalExpr;
  1426. declare function importType(id: ExternalReference, typeParams?: Type[] | null, typeModifiers?: TypeModifier): ExpressionType | null;
  1427. declare function expressionType(expr: Expression, typeModifiers?: TypeModifier, typeParams?: Type[] | null): ExpressionType;
  1428. declare function transplantedType<T>(type: T, typeModifiers?: TypeModifier): TransplantedType<T>;
  1429. declare function typeofExpr(expr: Expression): TypeofExpr;
  1430. declare function literalArr(values: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): LiteralArrayExpr;
  1431. declare function literalMap(values: {
  1432. key: string;
  1433. quoted: boolean;
  1434. value: Expression;
  1435. }[], type?: MapType | null): LiteralMapExpr;
  1436. declare function unary(operator: UnaryOperator, expr: Expression, type?: Type, sourceSpan?: ParseSourceSpan | null): UnaryOperatorExpr;
  1437. declare function not(expr: Expression, sourceSpan?: ParseSourceSpan | null): NotExpr;
  1438. declare function fn(params: FnParam[], body: Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null, name?: string | null): FunctionExpr;
  1439. declare function arrowFn(params: FnParam[], body: Expression | Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): ArrowFunctionExpr;
  1440. declare function ifStmt(condition: Expression, thenClause: Statement[], elseClause?: Statement[], sourceSpan?: ParseSourceSpan, leadingComments?: LeadingComment[]): IfStmt;
  1441. declare function taggedTemplate(tag: Expression, template: TemplateLiteralExpr, type?: Type | null, sourceSpan?: ParseSourceSpan | null): TaggedTemplateLiteralExpr;
  1442. declare function literal(value: any, type?: Type | null, sourceSpan?: ParseSourceSpan | null): LiteralExpr;
  1443. declare function localizedString(metaBlock: I18nMeta, messageParts: LiteralPiece[], placeholderNames: PlaceholderPiece[], expressions: Expression[], sourceSpan?: ParseSourceSpan | null): LocalizedString;
  1444. declare function isNull(exp: Expression): boolean;
  1445. declare const enum JSDocTagName {
  1446. Desc = "desc",
  1447. Id = "id",
  1448. Meaning = "meaning",
  1449. Suppress = "suppress"
  1450. }
  1451. type JSDocTag = {
  1452. tagName: JSDocTagName | string;
  1453. text?: string;
  1454. } | {
  1455. tagName?: undefined;
  1456. text: string;
  1457. };
  1458. type output_ast_d_ArrayType = ArrayType;
  1459. declare const output_ast_d_ArrayType: typeof ArrayType;
  1460. type output_ast_d_ArrowFunctionExpr = ArrowFunctionExpr;
  1461. declare const output_ast_d_ArrowFunctionExpr: typeof ArrowFunctionExpr;
  1462. declare const output_ast_d_BOOL_TYPE: typeof BOOL_TYPE;
  1463. type output_ast_d_BinaryOperator = BinaryOperator;
  1464. declare const output_ast_d_BinaryOperator: typeof BinaryOperator;
  1465. type output_ast_d_BinaryOperatorExpr = BinaryOperatorExpr;
  1466. declare const output_ast_d_BinaryOperatorExpr: typeof BinaryOperatorExpr;
  1467. type output_ast_d_BuiltinType = BuiltinType;
  1468. declare const output_ast_d_BuiltinType: typeof BuiltinType;
  1469. type output_ast_d_BuiltinTypeName = BuiltinTypeName;
  1470. declare const output_ast_d_BuiltinTypeName: typeof BuiltinTypeName;
  1471. type output_ast_d_CommaExpr = CommaExpr;
  1472. declare const output_ast_d_CommaExpr: typeof CommaExpr;
  1473. type output_ast_d_ConditionalExpr = ConditionalExpr;
  1474. declare const output_ast_d_ConditionalExpr: typeof ConditionalExpr;
  1475. type output_ast_d_CookedRawString = CookedRawString;
  1476. declare const output_ast_d_DYNAMIC_TYPE: typeof DYNAMIC_TYPE;
  1477. type output_ast_d_DeclareFunctionStmt = DeclareFunctionStmt;
  1478. declare const output_ast_d_DeclareFunctionStmt: typeof DeclareFunctionStmt;
  1479. type output_ast_d_DeclareVarStmt = DeclareVarStmt;
  1480. declare const output_ast_d_DeclareVarStmt: typeof DeclareVarStmt;
  1481. type output_ast_d_DynamicImportExpr = DynamicImportExpr;
  1482. declare const output_ast_d_DynamicImportExpr: typeof DynamicImportExpr;
  1483. type output_ast_d_Expression = Expression;
  1484. declare const output_ast_d_Expression: typeof Expression;
  1485. type output_ast_d_ExpressionStatement = ExpressionStatement;
  1486. declare const output_ast_d_ExpressionStatement: typeof ExpressionStatement;
  1487. type output_ast_d_ExpressionType = ExpressionType;
  1488. declare const output_ast_d_ExpressionType: typeof ExpressionType;
  1489. type output_ast_d_ExpressionVisitor = ExpressionVisitor;
  1490. type output_ast_d_ExternalExpr = ExternalExpr;
  1491. declare const output_ast_d_ExternalExpr: typeof ExternalExpr;
  1492. type output_ast_d_ExternalReference = ExternalReference;
  1493. declare const output_ast_d_ExternalReference: typeof ExternalReference;
  1494. declare const output_ast_d_FUNCTION_TYPE: typeof FUNCTION_TYPE;
  1495. type output_ast_d_FnParam = FnParam;
  1496. declare const output_ast_d_FnParam: typeof FnParam;
  1497. type output_ast_d_FunctionExpr = FunctionExpr;
  1498. declare const output_ast_d_FunctionExpr: typeof FunctionExpr;
  1499. declare const output_ast_d_INFERRED_TYPE: typeof INFERRED_TYPE;
  1500. declare const output_ast_d_INT_TYPE: typeof INT_TYPE;
  1501. type output_ast_d_IfStmt = IfStmt;
  1502. declare const output_ast_d_IfStmt: typeof IfStmt;
  1503. type output_ast_d_InstantiateExpr = InstantiateExpr;
  1504. declare const output_ast_d_InstantiateExpr: typeof InstantiateExpr;
  1505. type output_ast_d_InvokeFunctionExpr = InvokeFunctionExpr;
  1506. declare const output_ast_d_InvokeFunctionExpr: typeof InvokeFunctionExpr;
  1507. type output_ast_d_JSDocComment = JSDocComment;
  1508. declare const output_ast_d_JSDocComment: typeof JSDocComment;
  1509. type output_ast_d_JSDocTag = JSDocTag;
  1510. type output_ast_d_JSDocTagName = JSDocTagName;
  1511. declare const output_ast_d_JSDocTagName: typeof JSDocTagName;
  1512. type output_ast_d_LeadingComment = LeadingComment;
  1513. declare const output_ast_d_LeadingComment: typeof LeadingComment;
  1514. type output_ast_d_LiteralArrayExpr = LiteralArrayExpr;
  1515. declare const output_ast_d_LiteralArrayExpr: typeof LiteralArrayExpr;
  1516. type output_ast_d_LiteralExpr = LiteralExpr;
  1517. declare const output_ast_d_LiteralExpr: typeof LiteralExpr;
  1518. type output_ast_d_LiteralMapEntry = LiteralMapEntry;
  1519. declare const output_ast_d_LiteralMapEntry: typeof LiteralMapEntry;
  1520. type output_ast_d_LiteralMapExpr = LiteralMapExpr;
  1521. declare const output_ast_d_LiteralMapExpr: typeof LiteralMapExpr;
  1522. type output_ast_d_LiteralPiece = LiteralPiece;
  1523. declare const output_ast_d_LiteralPiece: typeof LiteralPiece;
  1524. type output_ast_d_LocalizedString = LocalizedString;
  1525. declare const output_ast_d_LocalizedString: typeof LocalizedString;
  1526. type output_ast_d_MapType = MapType;
  1527. declare const output_ast_d_MapType: typeof MapType;
  1528. type output_ast_d_MessagePiece = MessagePiece;
  1529. declare const output_ast_d_NONE_TYPE: typeof NONE_TYPE;
  1530. declare const output_ast_d_NULL_EXPR: typeof NULL_EXPR;
  1531. declare const output_ast_d_NUMBER_TYPE: typeof NUMBER_TYPE;
  1532. type output_ast_d_NotExpr = NotExpr;
  1533. declare const output_ast_d_NotExpr: typeof NotExpr;
  1534. type output_ast_d_PlaceholderPiece = PlaceholderPiece;
  1535. declare const output_ast_d_PlaceholderPiece: typeof PlaceholderPiece;
  1536. type output_ast_d_ReadKeyExpr = ReadKeyExpr;
  1537. declare const output_ast_d_ReadKeyExpr: typeof ReadKeyExpr;
  1538. type output_ast_d_ReadPropExpr = ReadPropExpr;
  1539. declare const output_ast_d_ReadPropExpr: typeof ReadPropExpr;
  1540. type output_ast_d_ReadVarExpr = ReadVarExpr;
  1541. declare const output_ast_d_ReadVarExpr: typeof ReadVarExpr;
  1542. type output_ast_d_ReturnStatement = ReturnStatement;
  1543. declare const output_ast_d_ReturnStatement: typeof ReturnStatement;
  1544. declare const output_ast_d_STRING_TYPE: typeof STRING_TYPE;
  1545. type output_ast_d_Statement = Statement;
  1546. declare const output_ast_d_Statement: typeof Statement;
  1547. type output_ast_d_StatementVisitor = StatementVisitor;
  1548. type output_ast_d_StmtModifier = StmtModifier;
  1549. declare const output_ast_d_StmtModifier: typeof StmtModifier;
  1550. declare const output_ast_d_TYPED_NULL_EXPR: typeof TYPED_NULL_EXPR;
  1551. type output_ast_d_TaggedTemplateLiteralExpr = TaggedTemplateLiteralExpr;
  1552. declare const output_ast_d_TaggedTemplateLiteralExpr: typeof TaggedTemplateLiteralExpr;
  1553. type output_ast_d_TemplateLiteralElementExpr = TemplateLiteralElementExpr;
  1554. declare const output_ast_d_TemplateLiteralElementExpr: typeof TemplateLiteralElementExpr;
  1555. type output_ast_d_TemplateLiteralExpr = TemplateLiteralExpr;
  1556. declare const output_ast_d_TemplateLiteralExpr: typeof TemplateLiteralExpr;
  1557. type output_ast_d_TransplantedType<T> = TransplantedType<T>;
  1558. declare const output_ast_d_TransplantedType: typeof TransplantedType;
  1559. type output_ast_d_Type = Type;
  1560. declare const output_ast_d_Type: typeof Type;
  1561. type output_ast_d_TypeModifier = TypeModifier;
  1562. declare const output_ast_d_TypeModifier: typeof TypeModifier;
  1563. type output_ast_d_TypeVisitor = TypeVisitor;
  1564. type output_ast_d_TypeofExpr = TypeofExpr;
  1565. declare const output_ast_d_TypeofExpr: typeof TypeofExpr;
  1566. type output_ast_d_UnaryOperator = UnaryOperator;
  1567. declare const output_ast_d_UnaryOperator: typeof UnaryOperator;
  1568. type output_ast_d_UnaryOperatorExpr = UnaryOperatorExpr;
  1569. declare const output_ast_d_UnaryOperatorExpr: typeof UnaryOperatorExpr;
  1570. type output_ast_d_WrappedNodeExpr<T> = WrappedNodeExpr<T>;
  1571. declare const output_ast_d_WrappedNodeExpr: typeof WrappedNodeExpr;
  1572. type output_ast_d_WriteKeyExpr = WriteKeyExpr;
  1573. declare const output_ast_d_WriteKeyExpr: typeof WriteKeyExpr;
  1574. type output_ast_d_WritePropExpr = WritePropExpr;
  1575. declare const output_ast_d_WritePropExpr: typeof WritePropExpr;
  1576. type output_ast_d_WriteVarExpr = WriteVarExpr;
  1577. declare const output_ast_d_WriteVarExpr: typeof WriteVarExpr;
  1578. declare const output_ast_d_areAllEquivalent: typeof areAllEquivalent;
  1579. declare const output_ast_d_arrowFn: typeof arrowFn;
  1580. declare const output_ast_d_expressionType: typeof expressionType;
  1581. declare const output_ast_d_fn: typeof fn;
  1582. declare const output_ast_d_ifStmt: typeof ifStmt;
  1583. declare const output_ast_d_importExpr: typeof importExpr;
  1584. declare const output_ast_d_importType: typeof importType;
  1585. declare const output_ast_d_isNull: typeof isNull;
  1586. declare const output_ast_d_jsDocComment: typeof jsDocComment;
  1587. declare const output_ast_d_leadingComment: typeof leadingComment;
  1588. declare const output_ast_d_literal: typeof literal;
  1589. declare const output_ast_d_literalArr: typeof literalArr;
  1590. declare const output_ast_d_literalMap: typeof literalMap;
  1591. declare const output_ast_d_localizedString: typeof localizedString;
  1592. declare const output_ast_d_not: typeof not;
  1593. declare const output_ast_d_nullSafeIsEquivalent: typeof nullSafeIsEquivalent;
  1594. declare const output_ast_d_taggedTemplate: typeof taggedTemplate;
  1595. declare const output_ast_d_transplantedType: typeof transplantedType;
  1596. declare const output_ast_d_typeofExpr: typeof typeofExpr;
  1597. declare const output_ast_d_unary: typeof unary;
  1598. declare const output_ast_d_variable: typeof variable;
  1599. declare namespace output_ast_d {
  1600. export { output_ast_d_ArrayType as ArrayType, output_ast_d_ArrowFunctionExpr as ArrowFunctionExpr, output_ast_d_BOOL_TYPE as BOOL_TYPE, output_ast_d_BinaryOperator as BinaryOperator, output_ast_d_BinaryOperatorExpr as BinaryOperatorExpr, output_ast_d_BuiltinType as BuiltinType, output_ast_d_BuiltinTypeName as BuiltinTypeName, output_ast_d_CommaExpr as CommaExpr, output_ast_d_ConditionalExpr as ConditionalExpr, type output_ast_d_CookedRawString as CookedRawString, output_ast_d_DYNAMIC_TYPE as DYNAMIC_TYPE, output_ast_d_DeclareFunctionStmt as DeclareFunctionStmt, output_ast_d_DeclareVarStmt as DeclareVarStmt, output_ast_d_DynamicImportExpr as DynamicImportExpr, output_ast_d_Expression as Expression, output_ast_d_ExpressionStatement as ExpressionStatement, output_ast_d_ExpressionType as ExpressionType, type output_ast_d_ExpressionVisitor as ExpressionVisitor, output_ast_d_ExternalExpr as ExternalExpr, output_ast_d_ExternalReference as ExternalReference, output_ast_d_FUNCTION_TYPE as FUNCTION_TYPE, output_ast_d_FnParam as FnParam, output_ast_d_FunctionExpr as FunctionExpr, output_ast_d_INFERRED_TYPE as INFERRED_TYPE, output_ast_d_INT_TYPE as INT_TYPE, output_ast_d_IfStmt as IfStmt, output_ast_d_InstantiateExpr as InstantiateExpr, output_ast_d_InvokeFunctionExpr as InvokeFunctionExpr, output_ast_d_JSDocComment as JSDocComment, type output_ast_d_JSDocTag as JSDocTag, output_ast_d_JSDocTagName as JSDocTagName, output_ast_d_LeadingComment as LeadingComment, output_ast_d_LiteralArrayExpr as LiteralArrayExpr, output_ast_d_LiteralExpr as LiteralExpr, output_ast_d_LiteralMapEntry as LiteralMapEntry, output_ast_d_LiteralMapExpr as LiteralMapExpr, output_ast_d_LiteralPiece as LiteralPiece, output_ast_d_LocalizedString as LocalizedString, output_ast_d_MapType as MapType, type output_ast_d_MessagePiece as MessagePiece, output_ast_d_NONE_TYPE as NONE_TYPE, output_ast_d_NULL_EXPR as NULL_EXPR, output_ast_d_NUMBER_TYPE as NUMBER_TYPE, output_ast_d_NotExpr as NotExpr, output_ast_d_PlaceholderPiece as PlaceholderPiece, output_ast_d_ReadKeyExpr as ReadKeyExpr, output_ast_d_ReadPropExpr as ReadPropExpr, output_ast_d_ReadVarExpr as ReadVarExpr, RecursiveAstVisitor$1 as RecursiveAstVisitor, output_ast_d_ReturnStatement as ReturnStatement, output_ast_d_STRING_TYPE as STRING_TYPE, output_ast_d_Statement as Statement, type output_ast_d_StatementVisitor as StatementVisitor, output_ast_d_StmtModifier as StmtModifier, output_ast_d_TYPED_NULL_EXPR as TYPED_NULL_EXPR, output_ast_d_TaggedTemplateLiteralExpr as TaggedTemplateLiteralExpr, output_ast_d_TemplateLiteralElementExpr as TemplateLiteralElementExpr, output_ast_d_TemplateLiteralExpr as TemplateLiteralExpr, output_ast_d_TransplantedType as TransplantedType, output_ast_d_Type as Type, output_ast_d_TypeModifier as TypeModifier, type output_ast_d_TypeVisitor as TypeVisitor, output_ast_d_TypeofExpr as TypeofExpr, output_ast_d_UnaryOperator as UnaryOperator, output_ast_d_UnaryOperatorExpr as UnaryOperatorExpr, output_ast_d_WrappedNodeExpr as WrappedNodeExpr, output_ast_d_WriteKeyExpr as WriteKeyExpr, output_ast_d_WritePropExpr as WritePropExpr, output_ast_d_WriteVarExpr as WriteVarExpr, output_ast_d_areAllEquivalent as areAllEquivalent, output_ast_d_arrowFn as arrowFn, output_ast_d_expressionType as expressionType, output_ast_d_fn as fn, output_ast_d_ifStmt as ifStmt, output_ast_d_importExpr as importExpr, output_ast_d_importType as importType, output_ast_d_isNull as isNull, output_ast_d_jsDocComment as jsDocComment, output_ast_d_leadingComment as leadingComment, output_ast_d_literal as literal, output_ast_d_literalArr as literalArr, output_ast_d_literalMap as literalMap, output_ast_d_localizedString as localizedString, output_ast_d_not as not, output_ast_d_nullSafeIsEquivalent as nullSafeIsEquivalent, output_ast_d_taggedTemplate as taggedTemplate, output_ast_d_transplantedType as transplantedType, output_ast_d_typeofExpr as typeofExpr, output_ast_d_unary as unary, output_ast_d_variable as variable };
  1601. }
  1602. /**
  1603. * A constant pool allows a code emitter to share constant in an output context.
  1604. *
  1605. * The constant pool also supports sharing access to ivy definitions references.
  1606. */
  1607. declare class ConstantPool {
  1608. private readonly isClosureCompilerEnabled;
  1609. statements: Statement[];
  1610. private literals;
  1611. private literalFactories;
  1612. private sharedConstants;
  1613. /**
  1614. * Constant pool also tracks claimed names from {@link uniqueName}.
  1615. * This is useful to avoid collisions if variables are intended to be
  1616. * named a certain way- but may conflict. We wouldn't want to always suffix
  1617. * them with unique numbers.
  1618. */
  1619. private _claimedNames;
  1620. private nextNameIndex;
  1621. constructor(isClosureCompilerEnabled?: boolean);
  1622. getConstLiteral(literal: Expression, forceShared?: boolean): Expression;
  1623. getSharedConstant(def: SharedConstantDefinition, expr: Expression): Expression;
  1624. getLiteralFactory(literal: LiteralArrayExpr | LiteralMapExpr): {
  1625. literalFactory: Expression;
  1626. literalFactoryArguments: Expression[];
  1627. };
  1628. getSharedFunctionReference(fn: Expression, prefix: string, useUniqueName?: boolean): Expression;
  1629. private _getLiteralFactory;
  1630. /**
  1631. * Produce a unique name in the context of this pool.
  1632. *
  1633. * The name might be unique among different prefixes if any of the prefixes end in
  1634. * a digit so the prefix should be a constant string (not based on user input) and
  1635. * must not end in a digit.
  1636. */
  1637. uniqueName(name: string, alwaysIncludeSuffix?: boolean): string;
  1638. private freshName;
  1639. }
  1640. interface ExpressionKeyFn {
  1641. keyOf(expr: Expression): string;
  1642. }
  1643. interface SharedConstantDefinition extends ExpressionKeyFn {
  1644. toSharedConstantDeclaration(declName: string, keyExpr: Expression): Statement;
  1645. }
  1646. declare abstract class ElementSchemaRegistry {
  1647. abstract hasProperty(tagName: string, propName: string, schemaMetas: SchemaMetadata[]): boolean;
  1648. abstract hasElement(tagName: string, schemaMetas: SchemaMetadata[]): boolean;
  1649. abstract securityContext(elementName: string, propName: string, isAttribute: boolean): SecurityContext;
  1650. abstract allKnownElementNames(): string[];
  1651. abstract getMappedPropName(propName: string): string;
  1652. abstract getDefaultComponentElementName(): string;
  1653. abstract validateProperty(name: string): {
  1654. error: boolean;
  1655. msg?: string;
  1656. };
  1657. abstract validateAttribute(name: string): {
  1658. error: boolean;
  1659. msg?: string;
  1660. };
  1661. abstract normalizeAnimationStyleProperty(propName: string): string;
  1662. abstract normalizeAnimationStyleValue(camelCaseProp: string, userProvidedProp: string, val: string | number): {
  1663. error: string;
  1664. value: string;
  1665. };
  1666. }
  1667. declare function computeMsgId(msg: string, meaning?: string): string;
  1668. declare class HtmlParser extends Parser$1 {
  1669. constructor();
  1670. parse(source: string, url: string, options?: TokenizeOptions): ParseTreeResult;
  1671. }
  1672. declare class I18NHtmlParser implements HtmlParser {
  1673. private _htmlParser;
  1674. getTagDefinition: any;
  1675. private _translationBundle;
  1676. constructor(_htmlParser: HtmlParser, translations?: string, translationsFormat?: string, missingTranslation?: MissingTranslationStrategy, console?: Console);
  1677. parse(source: string, url: string, options?: TokenizeOptions): ParseTreeResult;
  1678. }
  1679. declare abstract class Serializer {
  1680. abstract write(messages: Message[], locale: string | null): string;
  1681. abstract load(content: string, url: string): {
  1682. locale: string | null;
  1683. i18nNodesByMsgId: {
  1684. [msgId: string]: Node$2[];
  1685. };
  1686. };
  1687. abstract digest(message: Message): string;
  1688. createNameMapper(message: Message): PlaceholderMapper | null;
  1689. }
  1690. /**
  1691. * A `PlaceholderMapper` converts placeholder names from internal to serialized representation and
  1692. * back.
  1693. *
  1694. * It should be used for serialization format that put constraints on the placeholder names.
  1695. */
  1696. interface PlaceholderMapper {
  1697. toPublicName(internalName: string): string | null;
  1698. toInternalName(publicName: string): string | null;
  1699. }
  1700. /**
  1701. * A container for message extracted from the templates.
  1702. */
  1703. declare class MessageBundle {
  1704. private _htmlParser;
  1705. private _implicitTags;
  1706. private _implicitAttrs;
  1707. private _locale;
  1708. private readonly _preserveWhitespace;
  1709. private _messages;
  1710. constructor(_htmlParser: HtmlParser, _implicitTags: string[], _implicitAttrs: {
  1711. [k: string]: string[];
  1712. }, _locale?: string | null, _preserveWhitespace?: boolean);
  1713. updateFromTemplate(source: string, url: string, interpolationConfig: InterpolationConfig): ParseError[];
  1714. getMessages(): Message[];
  1715. write(serializer: Serializer, filterSources?: (path: string) => string): string;
  1716. }
  1717. declare class Xliff extends Serializer {
  1718. write(messages: Message[], locale: string | null): string;
  1719. load(content: string, url: string): {
  1720. locale: string;
  1721. i18nNodesByMsgId: {
  1722. [msgId: string]: Node$2[];
  1723. };
  1724. };
  1725. digest(message: Message): string;
  1726. }
  1727. declare class Xliff2 extends Serializer {
  1728. write(messages: Message[], locale: string | null): string;
  1729. load(content: string, url: string): {
  1730. locale: string;
  1731. i18nNodesByMsgId: {
  1732. [msgId: string]: Node$2[];
  1733. };
  1734. };
  1735. digest(message: Message): string;
  1736. }
  1737. declare class Xmb extends Serializer {
  1738. write(messages: Message[], locale: string | null): string;
  1739. load(content: string, url: string): {
  1740. locale: string;
  1741. i18nNodesByMsgId: {
  1742. [msgId: string]: Node$2[];
  1743. };
  1744. };
  1745. digest(message: Message): string;
  1746. createNameMapper(message: Message): PlaceholderMapper;
  1747. }
  1748. declare class Xtb extends Serializer {
  1749. write(messages: Message[], locale: string | null): string;
  1750. load(content: string, url: string): {
  1751. locale: string;
  1752. i18nNodesByMsgId: {
  1753. [msgId: string]: Node$2[];
  1754. };
  1755. };
  1756. digest(message: Message): string;
  1757. createNameMapper(message: Message): PlaceholderMapper;
  1758. }
  1759. declare class ParserError {
  1760. input: string;
  1761. errLocation: string;
  1762. ctxLocation?: any | undefined;
  1763. message: string;
  1764. constructor(message: string, input: string, errLocation: string, ctxLocation?: any | undefined);
  1765. }
  1766. declare class ParseSpan {
  1767. start: number;
  1768. end: number;
  1769. constructor(start: number, end: number);
  1770. toAbsolute(absoluteOffset: number): AbsoluteSourceSpan;
  1771. }
  1772. declare abstract class AST {
  1773. span: ParseSpan;
  1774. /**
  1775. * Absolute location of the expression AST in a source code file.
  1776. */
  1777. sourceSpan: AbsoluteSourceSpan;
  1778. constructor(span: ParseSpan,
  1779. /**
  1780. * Absolute location of the expression AST in a source code file.
  1781. */
  1782. sourceSpan: AbsoluteSourceSpan);
  1783. abstract visit(visitor: AstVisitor, context?: any): any;
  1784. toString(): string;
  1785. }
  1786. declare abstract class ASTWithName extends AST {
  1787. nameSpan: AbsoluteSourceSpan;
  1788. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, nameSpan: AbsoluteSourceSpan);
  1789. }
  1790. declare class EmptyExpr extends AST {
  1791. visit(visitor: AstVisitor, context?: any): void;
  1792. }
  1793. declare class ImplicitReceiver extends AST {
  1794. visit(visitor: AstVisitor, context?: any): any;
  1795. }
  1796. /**
  1797. * Receiver when something is accessed through `this` (e.g. `this.foo`). Note that this class
  1798. * inherits from `ImplicitReceiver`, because accessing something through `this` is treated the
  1799. * same as accessing it implicitly inside of an Angular template (e.g. `[attr.title]="this.title"`
  1800. * is the same as `[attr.title]="title"`.). Inheriting allows for the `this` accesses to be treated
  1801. * the same as implicit ones, except for a couple of exceptions like `$event` and `$any`.
  1802. * TODO: we should find a way for this class not to extend from `ImplicitReceiver` in the future.
  1803. */
  1804. declare class ThisReceiver extends ImplicitReceiver {
  1805. visit(visitor: AstVisitor, context?: any): any;
  1806. }
  1807. /**
  1808. * Multiple expressions separated by a semicolon.
  1809. */
  1810. declare class Chain extends AST {
  1811. expressions: any[];
  1812. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expressions: any[]);
  1813. visit(visitor: AstVisitor, context?: any): any;
  1814. }
  1815. declare class Conditional extends AST {
  1816. condition: AST;
  1817. trueExp: AST;
  1818. falseExp: AST;
  1819. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, condition: AST, trueExp: AST, falseExp: AST);
  1820. visit(visitor: AstVisitor, context?: any): any;
  1821. }
  1822. declare class PropertyRead extends ASTWithName {
  1823. receiver: AST;
  1824. name: string;
  1825. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, nameSpan: AbsoluteSourceSpan, receiver: AST, name: string);
  1826. visit(visitor: AstVisitor, context?: any): any;
  1827. }
  1828. declare class PropertyWrite extends ASTWithName {
  1829. receiver: AST;
  1830. name: string;
  1831. value: AST;
  1832. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, nameSpan: AbsoluteSourceSpan, receiver: AST, name: string, value: AST);
  1833. visit(visitor: AstVisitor, context?: any): any;
  1834. }
  1835. declare class SafePropertyRead extends ASTWithName {
  1836. receiver: AST;
  1837. name: string;
  1838. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, nameSpan: AbsoluteSourceSpan, receiver: AST, name: string);
  1839. visit(visitor: AstVisitor, context?: any): any;
  1840. }
  1841. declare class KeyedRead extends AST {
  1842. receiver: AST;
  1843. key: AST;
  1844. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, receiver: AST, key: AST);
  1845. visit(visitor: AstVisitor, context?: any): any;
  1846. }
  1847. declare class SafeKeyedRead extends AST {
  1848. receiver: AST;
  1849. key: AST;
  1850. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, receiver: AST, key: AST);
  1851. visit(visitor: AstVisitor, context?: any): any;
  1852. }
  1853. declare class KeyedWrite extends AST {
  1854. receiver: AST;
  1855. key: AST;
  1856. value: AST;
  1857. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, receiver: AST, key: AST, value: AST);
  1858. visit(visitor: AstVisitor, context?: any): any;
  1859. }
  1860. declare class BindingPipe extends ASTWithName {
  1861. exp: AST;
  1862. name: string;
  1863. args: any[];
  1864. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, exp: AST, name: string, args: any[], nameSpan: AbsoluteSourceSpan);
  1865. visit(visitor: AstVisitor, context?: any): any;
  1866. }
  1867. declare class LiteralPrimitive extends AST {
  1868. value: any;
  1869. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, value: any);
  1870. visit(visitor: AstVisitor, context?: any): any;
  1871. }
  1872. declare class LiteralArray extends AST {
  1873. expressions: any[];
  1874. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expressions: any[]);
  1875. visit(visitor: AstVisitor, context?: any): any;
  1876. }
  1877. type LiteralMapKey = {
  1878. key: string;
  1879. quoted: boolean;
  1880. isShorthandInitialized?: boolean;
  1881. };
  1882. declare class LiteralMap extends AST {
  1883. keys: LiteralMapKey[];
  1884. values: any[];
  1885. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, keys: LiteralMapKey[], values: any[]);
  1886. visit(visitor: AstVisitor, context?: any): any;
  1887. }
  1888. declare class Interpolation extends AST {
  1889. strings: string[];
  1890. expressions: AST[];
  1891. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, strings: string[], expressions: AST[]);
  1892. visit(visitor: AstVisitor, context?: any): any;
  1893. }
  1894. declare class Binary extends AST {
  1895. operation: string;
  1896. left: AST;
  1897. right: AST;
  1898. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, operation: string, left: AST, right: AST);
  1899. visit(visitor: AstVisitor, context?: any): any;
  1900. }
  1901. /**
  1902. * For backwards compatibility reasons, `Unary` inherits from `Binary` and mimics the binary AST
  1903. * node that was originally used. This inheritance relation can be deleted in some future major,
  1904. * after consumers have been given a chance to fully support Unary.
  1905. */
  1906. declare class Unary extends Binary {
  1907. operator: string;
  1908. expr: AST;
  1909. left: never;
  1910. right: never;
  1911. operation: never;
  1912. /**
  1913. * Creates a unary minus expression "-x", represented as `Binary` using "0 - x".
  1914. */
  1915. static createMinus(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expr: AST): Unary;
  1916. /**
  1917. * Creates a unary plus expression "+x", represented as `Binary` using "x - 0".
  1918. */
  1919. static createPlus(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expr: AST): Unary;
  1920. /**
  1921. * During the deprecation period this constructor is private, to avoid consumers from creating
  1922. * a `Unary` with the fallback properties for `Binary`.
  1923. */
  1924. private constructor();
  1925. visit(visitor: AstVisitor, context?: any): any;
  1926. }
  1927. declare class PrefixNot extends AST {
  1928. expression: AST;
  1929. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expression: AST);
  1930. visit(visitor: AstVisitor, context?: any): any;
  1931. }
  1932. declare class TypeofExpression extends AST {
  1933. expression: AST;
  1934. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expression: AST);
  1935. visit(visitor: AstVisitor, context?: any): any;
  1936. }
  1937. declare class NonNullAssert extends AST {
  1938. expression: AST;
  1939. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expression: AST);
  1940. visit(visitor: AstVisitor, context?: any): any;
  1941. }
  1942. declare class Call extends AST {
  1943. receiver: AST;
  1944. args: AST[];
  1945. argumentSpan: AbsoluteSourceSpan;
  1946. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, receiver: AST, args: AST[], argumentSpan: AbsoluteSourceSpan);
  1947. visit(visitor: AstVisitor, context?: any): any;
  1948. }
  1949. declare class SafeCall extends AST {
  1950. receiver: AST;
  1951. args: AST[];
  1952. argumentSpan: AbsoluteSourceSpan;
  1953. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, receiver: AST, args: AST[], argumentSpan: AbsoluteSourceSpan);
  1954. visit(visitor: AstVisitor, context?: any): any;
  1955. }
  1956. declare class TemplateLiteral extends AST {
  1957. elements: TemplateLiteralElement[];
  1958. expressions: AST[];
  1959. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, elements: TemplateLiteralElement[], expressions: AST[]);
  1960. visit(visitor: AstVisitor, context?: any): any;
  1961. }
  1962. declare class TemplateLiteralElement extends AST {
  1963. text: string;
  1964. constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, text: string);
  1965. visit(visitor: AstVisitor, context?: any): any;
  1966. }
  1967. /**
  1968. * Records the absolute position of a text span in a source file, where `start` and `end` are the
  1969. * starting and ending byte offsets, respectively, of the text span in a source file.
  1970. */
  1971. declare class AbsoluteSourceSpan {
  1972. readonly start: number;
  1973. readonly end: number;
  1974. constructor(start: number, end: number);
  1975. }
  1976. declare class ASTWithSource<T extends AST = AST> extends AST {
  1977. ast: T;
  1978. source: string | null;
  1979. location: string;
  1980. errors: ParserError[];
  1981. constructor(ast: T, source: string | null, location: string, absoluteOffset: number, errors: ParserError[]);
  1982. visit(visitor: AstVisitor, context?: any): any;
  1983. toString(): string;
  1984. }
  1985. /**
  1986. * TemplateBinding refers to a particular key-value pair in a microsyntax
  1987. * expression. A few examples are:
  1988. *
  1989. * |---------------------|--------------|---------|--------------|
  1990. * | expression | key | value | binding type |
  1991. * |---------------------|--------------|---------|--------------|
  1992. * | 1. let item | item | null | variable |
  1993. * | 2. of items | ngForOf | items | expression |
  1994. * | 3. let x = y | x | y | variable |
  1995. * | 4. index as i | i | index | variable |
  1996. * | 5. trackBy: func | ngForTrackBy | func | expression |
  1997. * | 6. *ngIf="cond" | ngIf | cond | expression |
  1998. * |---------------------|--------------|---------|--------------|
  1999. *
  2000. * (6) is a notable exception because it is a binding from the template key in
  2001. * the LHS of a HTML attribute to the expression in the RHS. All other bindings
  2002. * in the example above are derived solely from the RHS.
  2003. */
  2004. type TemplateBinding = VariableBinding | ExpressionBinding;
  2005. declare class VariableBinding {
  2006. readonly sourceSpan: AbsoluteSourceSpan;
  2007. readonly key: TemplateBindingIdentifier;
  2008. readonly value: TemplateBindingIdentifier | null;
  2009. /**
  2010. * @param sourceSpan entire span of the binding.
  2011. * @param key name of the LHS along with its span.
  2012. * @param value optional value for the RHS along with its span.
  2013. */
  2014. constructor(sourceSpan: AbsoluteSourceSpan, key: TemplateBindingIdentifier, value: TemplateBindingIdentifier | null);
  2015. }
  2016. declare class ExpressionBinding {
  2017. readonly sourceSpan: AbsoluteSourceSpan;
  2018. readonly key: TemplateBindingIdentifier;
  2019. readonly value: ASTWithSource | null;
  2020. /**
  2021. * @param sourceSpan entire span of the binding.
  2022. * @param key binding name, like ngForOf, ngForTrackBy, ngIf, along with its
  2023. * span. Note that the length of the span may not be the same as
  2024. * `key.source.length`. For example,
  2025. * 1. key.source = ngFor, key.span is for "ngFor"
  2026. * 2. key.source = ngForOf, key.span is for "of"
  2027. * 3. key.source = ngForTrackBy, key.span is for "trackBy"
  2028. * @param value optional expression for the RHS.
  2029. */
  2030. constructor(sourceSpan: AbsoluteSourceSpan, key: TemplateBindingIdentifier, value: ASTWithSource | null);
  2031. }
  2032. interface TemplateBindingIdentifier {
  2033. source: string;
  2034. span: AbsoluteSourceSpan;
  2035. }
  2036. interface AstVisitor {
  2037. /**
  2038. * The `visitUnary` method is declared as optional for backwards compatibility. In an upcoming
  2039. * major release, this method will be made required.
  2040. */
  2041. visitUnary?(ast: Unary, context: any): any;
  2042. visitBinary(ast: Binary, context: any): any;
  2043. visitChain(ast: Chain, context: any): any;
  2044. visitConditional(ast: Conditional, context: any): any;
  2045. /**
  2046. * The `visitThisReceiver` method is declared as optional for backwards compatibility.
  2047. * In an upcoming major release, this method will be made required.
  2048. */
  2049. visitThisReceiver?(ast: ThisReceiver, context: any): any;
  2050. visitImplicitReceiver(ast: ImplicitReceiver, context: any): any;
  2051. visitInterpolation(ast: Interpolation, context: any): any;
  2052. visitKeyedRead(ast: KeyedRead, context: any): any;
  2053. visitKeyedWrite(ast: KeyedWrite, context: any): any;
  2054. visitLiteralArray(ast: LiteralArray, context: any): any;
  2055. visitLiteralMap(ast: LiteralMap, context: any): any;
  2056. visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any;
  2057. visitPipe(ast: BindingPipe, context: any): any;
  2058. visitPrefixNot(ast: PrefixNot, context: any): any;
  2059. visitTypeofExpression(ast: TypeofExpression, context: any): any;
  2060. visitNonNullAssert(ast: NonNullAssert, context: any): any;
  2061. visitPropertyRead(ast: PropertyRead, context: any): any;
  2062. visitPropertyWrite(ast: PropertyWrite, context: any): any;
  2063. visitSafePropertyRead(ast: SafePropertyRead, context: any): any;
  2064. visitSafeKeyedRead(ast: SafeKeyedRead, context: any): any;
  2065. visitCall(ast: Call, context: any): any;
  2066. visitSafeCall(ast: SafeCall, context: any): any;
  2067. visitTemplateLiteral(ast: TemplateLiteral, context: any): any;
  2068. visitTemplateLiteralElement(ast: TemplateLiteralElement, context: any): any;
  2069. visitASTWithSource?(ast: ASTWithSource, context: any): any;
  2070. /**
  2071. * This function is optionally defined to allow classes that implement this
  2072. * interface to selectively decide if the specified `ast` should be visited.
  2073. * @param ast node to visit
  2074. * @param context context that gets passed to the node and all its children
  2075. */
  2076. visit?(ast: AST, context?: any): any;
  2077. }
  2078. declare class RecursiveAstVisitor implements AstVisitor {
  2079. visit(ast: AST, context?: any): any;
  2080. visitUnary(ast: Unary, context: any): any;
  2081. visitBinary(ast: Binary, context: any): any;
  2082. visitChain(ast: Chain, context: any): any;
  2083. visitConditional(ast: Conditional, context: any): any;
  2084. visitPipe(ast: BindingPipe, context: any): any;
  2085. visitImplicitReceiver(ast: ThisReceiver, context: any): any;
  2086. visitThisReceiver(ast: ThisReceiver, context: any): any;
  2087. visitInterpolation(ast: Interpolation, context: any): any;
  2088. visitKeyedRead(ast: KeyedRead, context: any): any;
  2089. visitKeyedWrite(ast: KeyedWrite, context: any): any;
  2090. visitLiteralArray(ast: LiteralArray, context: any): any;
  2091. visitLiteralMap(ast: LiteralMap, context: any): any;
  2092. visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any;
  2093. visitPrefixNot(ast: PrefixNot, context: any): any;
  2094. visitTypeofExpression(ast: TypeofExpression, context: any): void;
  2095. visitNonNullAssert(ast: NonNullAssert, context: any): any;
  2096. visitPropertyRead(ast: PropertyRead, context: any): any;
  2097. visitPropertyWrite(ast: PropertyWrite, context: any): any;
  2098. visitSafePropertyRead(ast: SafePropertyRead, context: any): any;
  2099. visitSafeKeyedRead(ast: SafeKeyedRead, context: any): any;
  2100. visitCall(ast: Call, context: any): any;
  2101. visitSafeCall(ast: SafeCall, context: any): any;
  2102. visitTemplateLiteral(ast: TemplateLiteral, context: any): void;
  2103. visitTemplateLiteralElement(ast: TemplateLiteralElement, context: any): void;
  2104. visitAll(asts: AST[], context: any): any;
  2105. }
  2106. declare class ParsedProperty {
  2107. name: string;
  2108. expression: ASTWithSource;
  2109. type: ParsedPropertyType;
  2110. sourceSpan: ParseSourceSpan;
  2111. readonly keySpan: ParseSourceSpan;
  2112. valueSpan: ParseSourceSpan | undefined;
  2113. readonly isLiteral: boolean;
  2114. readonly isAnimation: boolean;
  2115. constructor(name: string, expression: ASTWithSource, type: ParsedPropertyType, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan, valueSpan: ParseSourceSpan | undefined);
  2116. }
  2117. declare enum ParsedPropertyType {
  2118. DEFAULT = 0,
  2119. LITERAL_ATTR = 1,
  2120. ANIMATION = 2,
  2121. TWO_WAY = 3
  2122. }
  2123. declare enum ParsedEventType {
  2124. Regular = 0,
  2125. Animation = 1,
  2126. TwoWay = 2
  2127. }
  2128. declare class ParsedEvent {
  2129. name: string;
  2130. targetOrPhase: string;
  2131. type: ParsedEventType;
  2132. handler: ASTWithSource;
  2133. sourceSpan: ParseSourceSpan;
  2134. handlerSpan: ParseSourceSpan;
  2135. readonly keySpan: ParseSourceSpan;
  2136. constructor(name: string, targetOrPhase: string, type: ParsedEventType.TwoWay, handler: ASTWithSource<NonNullAssert | PropertyRead | KeyedRead>, sourceSpan: ParseSourceSpan, handlerSpan: ParseSourceSpan, keySpan: ParseSourceSpan);
  2137. constructor(name: string, targetOrPhase: string, type: ParsedEventType, handler: ASTWithSource, sourceSpan: ParseSourceSpan, handlerSpan: ParseSourceSpan, keySpan: ParseSourceSpan);
  2138. }
  2139. /**
  2140. * ParsedVariable represents a variable declaration in a microsyntax expression.
  2141. */
  2142. declare class ParsedVariable {
  2143. readonly name: string;
  2144. readonly value: string;
  2145. readonly sourceSpan: ParseSourceSpan;
  2146. readonly keySpan: ParseSourceSpan;
  2147. readonly valueSpan?: ParseSourceSpan | undefined;
  2148. constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan, valueSpan?: ParseSourceSpan | undefined);
  2149. }
  2150. declare enum BindingType {
  2151. Property = 0,
  2152. Attribute = 1,
  2153. Class = 2,
  2154. Style = 3,
  2155. Animation = 4,
  2156. TwoWay = 5
  2157. }
  2158. declare class BoundElementProperty {
  2159. name: string;
  2160. type: BindingType;
  2161. securityContext: SecurityContext;
  2162. value: ASTWithSource;
  2163. unit: string | null;
  2164. sourceSpan: ParseSourceSpan;
  2165. readonly keySpan: ParseSourceSpan | undefined;
  2166. valueSpan: ParseSourceSpan | undefined;
  2167. constructor(name: string, type: BindingType, securityContext: SecurityContext, value: ASTWithSource, unit: string | null, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan | undefined, valueSpan: ParseSourceSpan | undefined);
  2168. }
  2169. declare enum TokenType {
  2170. Character = 0,
  2171. Identifier = 1,
  2172. PrivateIdentifier = 2,
  2173. Keyword = 3,
  2174. String = 4,
  2175. Operator = 5,
  2176. Number = 6,
  2177. Error = 7
  2178. }
  2179. declare enum StringTokenKind {
  2180. Plain = 0,
  2181. TemplateLiteralPart = 1,
  2182. TemplateLiteralEnd = 2
  2183. }
  2184. declare class Lexer {
  2185. tokenize(text: string): Token[];
  2186. }
  2187. declare class Token {
  2188. index: number;
  2189. end: number;
  2190. type: TokenType;
  2191. numValue: number;
  2192. strValue: string;
  2193. constructor(index: number, end: number, type: TokenType, numValue: number, strValue: string);
  2194. isCharacter(code: number): boolean;
  2195. isNumber(): boolean;
  2196. isString(): this is StringToken;
  2197. isOperator(operator: string): boolean;
  2198. isIdentifier(): boolean;
  2199. isPrivateIdentifier(): boolean;
  2200. isKeyword(): boolean;
  2201. isKeywordLet(): boolean;
  2202. isKeywordAs(): boolean;
  2203. isKeywordNull(): boolean;
  2204. isKeywordUndefined(): boolean;
  2205. isKeywordTrue(): boolean;
  2206. isKeywordFalse(): boolean;
  2207. isKeywordThis(): boolean;
  2208. isKeywordTypeof(): boolean;
  2209. isError(): boolean;
  2210. toNumber(): number;
  2211. isTemplateLiteralPart(): this is StringToken;
  2212. isTemplateLiteralEnd(): this is StringToken;
  2213. isTemplateLiteralInterpolationStart(): boolean;
  2214. isTemplateLiteralInterpolationEnd(): boolean;
  2215. toString(): string | null;
  2216. }
  2217. declare class StringToken extends Token {
  2218. readonly kind: StringTokenKind;
  2219. constructor(index: number, end: number, strValue: string, kind: StringTokenKind);
  2220. }
  2221. declare const EOF: Token;
  2222. interface InterpolationPiece {
  2223. text: string;
  2224. start: number;
  2225. end: number;
  2226. }
  2227. declare class SplitInterpolation {
  2228. strings: InterpolationPiece[];
  2229. expressions: InterpolationPiece[];
  2230. offsets: number[];
  2231. constructor(strings: InterpolationPiece[], expressions: InterpolationPiece[], offsets: number[]);
  2232. }
  2233. declare class TemplateBindingParseResult {
  2234. templateBindings: TemplateBinding[];
  2235. warnings: string[];
  2236. errors: ParserError[];
  2237. constructor(templateBindings: TemplateBinding[], warnings: string[], errors: ParserError[]);
  2238. }
  2239. /**
  2240. * Represents the possible parse modes to be used as a bitmask.
  2241. */
  2242. declare const enum ParseFlags {
  2243. None = 0,
  2244. /**
  2245. * Whether an output binding is being parsed.
  2246. */
  2247. Action = 1
  2248. }
  2249. declare class Parser {
  2250. private _lexer;
  2251. private errors;
  2252. constructor(_lexer: Lexer);
  2253. parseAction(input: string, location: string, absoluteOffset: number, interpolationConfig?: InterpolationConfig): ASTWithSource;
  2254. parseBinding(input: string, location: string, absoluteOffset: number, interpolationConfig?: InterpolationConfig): ASTWithSource;
  2255. private checkSimpleExpression;
  2256. parseSimpleBinding(input: string, location: string, absoluteOffset: number, interpolationConfig?: InterpolationConfig): ASTWithSource;
  2257. private _reportError;
  2258. private _parseBindingAst;
  2259. /**
  2260. * Parse microsyntax template expression and return a list of bindings or
  2261. * parsing errors in case the given expression is invalid.
  2262. *
  2263. * For example,
  2264. * ```html
  2265. * <div *ngFor="let item of items">
  2266. * ^ ^ absoluteValueOffset for `templateValue`
  2267. * absoluteKeyOffset for `templateKey`
  2268. * ```
  2269. * contains three bindings:
  2270. * 1. ngFor -> null
  2271. * 2. item -> NgForOfContext.$implicit
  2272. * 3. ngForOf -> items
  2273. *
  2274. * This is apparent from the de-sugared template:
  2275. * ```html
  2276. * <ng-template ngFor let-item [ngForOf]="items">
  2277. * ```
  2278. *
  2279. * @param templateKey name of directive, without the * prefix. For example: ngIf, ngFor
  2280. * @param templateValue RHS of the microsyntax attribute
  2281. * @param templateUrl template filename if it's external, component filename if it's inline
  2282. * @param absoluteKeyOffset start of the `templateKey`
  2283. * @param absoluteValueOffset start of the `templateValue`
  2284. */
  2285. parseTemplateBindings(templateKey: string, templateValue: string, templateUrl: string, absoluteKeyOffset: number, absoluteValueOffset: number): TemplateBindingParseResult;
  2286. parseInterpolation(input: string, location: string, absoluteOffset: number, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null, interpolationConfig?: InterpolationConfig): ASTWithSource | null;
  2287. /**
  2288. * Similar to `parseInterpolation`, but treats the provided string as a single expression
  2289. * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).
  2290. * This is used for parsing the switch expression in ICUs.
  2291. */
  2292. parseInterpolationExpression(expression: string, location: string, absoluteOffset: number): ASTWithSource;
  2293. private createInterpolationAst;
  2294. /**
  2295. * Splits a string of text into "raw" text segments and expressions present in interpolations in
  2296. * the string.
  2297. * Returns `null` if there are no interpolations, otherwise a
  2298. * `SplitInterpolation` with splits that look like
  2299. * <raw text> <expression> <raw text> ... <raw text> <expression> <raw text>
  2300. */
  2301. splitInterpolation(input: string, location: string, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null, interpolationConfig?: InterpolationConfig): SplitInterpolation;
  2302. wrapLiteralPrimitive(input: string | null, location: string, absoluteOffset: number): ASTWithSource;
  2303. private _stripComments;
  2304. private _commentStart;
  2305. private _checkNoInterpolation;
  2306. /**
  2307. * Finds the index of the end of an interpolation expression
  2308. * while ignoring comments and quoted content.
  2309. */
  2310. private _getInterpolationEndIndex;
  2311. /**
  2312. * Generator used to iterate over the character indexes of a string that are outside of quotes.
  2313. * @param input String to loop through.
  2314. * @param start Index within the string at which to start.
  2315. */
  2316. private _forEachUnquotedChar;
  2317. }
  2318. declare class HtmlTagDefinition implements TagDefinition {
  2319. private closedByChildren;
  2320. private contentType;
  2321. closedByParent: boolean;
  2322. implicitNamespacePrefix: string | null;
  2323. isVoid: boolean;
  2324. ignoreFirstLf: boolean;
  2325. canSelfClose: boolean;
  2326. preventNamespaceInheritance: boolean;
  2327. constructor({ closedByChildren, implicitNamespacePrefix, contentType, closedByParent, isVoid, ignoreFirstLf, preventNamespaceInheritance, canSelfClose, }?: {
  2328. closedByChildren?: string[];
  2329. closedByParent?: boolean;
  2330. implicitNamespacePrefix?: string;
  2331. contentType?: TagContentType | {
  2332. default: TagContentType;
  2333. [namespace: string]: TagContentType;
  2334. };
  2335. isVoid?: boolean;
  2336. ignoreFirstLf?: boolean;
  2337. preventNamespaceInheritance?: boolean;
  2338. canSelfClose?: boolean;
  2339. });
  2340. isClosedByChild(name: string): boolean;
  2341. getContentType(prefix?: string): TagContentType;
  2342. }
  2343. declare function getHtmlTagDefinition(tagName: string): HtmlTagDefinition;
  2344. declare class XmlParser extends Parser$1 {
  2345. constructor();
  2346. parse(source: string, url: string, options?: TokenizeOptions): ParseTreeResult;
  2347. }
  2348. type SourceMap = {
  2349. version: number;
  2350. file?: string;
  2351. sourceRoot: string;
  2352. sources: string[];
  2353. sourcesContent: (string | null)[];
  2354. mappings: string;
  2355. };
  2356. declare class SourceMapGenerator {
  2357. private file;
  2358. private sourcesContent;
  2359. private lines;
  2360. private lastCol0;
  2361. private hasMappings;
  2362. constructor(file?: string | null);
  2363. addSource(url: string, content?: string | null): this;
  2364. addLine(): this;
  2365. addMapping(col0: number, sourceUrl?: string, sourceLine0?: number, sourceCol0?: number): this;
  2366. toJSON(): SourceMap | null;
  2367. toJsComment(): string;
  2368. }
  2369. declare class EmitterVisitorContext {
  2370. private _indent;
  2371. static createRoot(): EmitterVisitorContext;
  2372. private _lines;
  2373. constructor(_indent: number);
  2374. println(from?: {
  2375. sourceSpan: ParseSourceSpan | null;
  2376. } | null, lastPart?: string): void;
  2377. lineIsEmpty(): boolean;
  2378. lineLength(): number;
  2379. print(from: {
  2380. sourceSpan: ParseSourceSpan | null;
  2381. } | null, part: string, newLine?: boolean): void;
  2382. removeEmptyLastLine(): void;
  2383. incIndent(): void;
  2384. decIndent(): void;
  2385. toSource(): string;
  2386. toSourceMapGenerator(genFilePath: string, startsAtLine?: number): SourceMapGenerator;
  2387. spanOf(line: number, column: number): ParseSourceSpan | null;
  2388. }
  2389. interface ExternalReferenceResolver {
  2390. resolveExternalReference(ref: ExternalReference): unknown;
  2391. }
  2392. /**
  2393. * A helper class to manage the evaluation of JIT generated code.
  2394. */
  2395. declare class JitEvaluator {
  2396. /**
  2397. *
  2398. * @param sourceUrl The URL of the generated code.
  2399. * @param statements An array of Angular statement AST nodes to be evaluated.
  2400. * @param refResolver Resolves `o.ExternalReference`s into values.
  2401. * @param createSourceMaps If true then create a source-map for the generated code and include it
  2402. * inline as a source-map comment.
  2403. * @returns A map of all the variables in the generated code.
  2404. */
  2405. evaluateStatements(sourceUrl: string, statements: Statement[], refResolver: ExternalReferenceResolver, createSourceMaps: boolean): {
  2406. [key: string]: any;
  2407. };
  2408. /**
  2409. * Evaluate a piece of JIT generated code.
  2410. * @param sourceUrl The URL of this generated code.
  2411. * @param ctx A context object that contains an AST of the code to be evaluated.
  2412. * @param vars A map containing the names and values of variables that the evaluated code might
  2413. * reference.
  2414. * @param createSourceMap If true then create a source-map for the generated code and include it
  2415. * inline as a source-map comment.
  2416. * @returns The result of evaluating the code.
  2417. */
  2418. evaluateCode(sourceUrl: string, ctx: EmitterVisitorContext, vars: {
  2419. [key: string]: any;
  2420. }, createSourceMap: boolean): any;
  2421. /**
  2422. * Execute a JIT generated function by calling it.
  2423. *
  2424. * This method can be overridden in tests to capture the functions that are generated
  2425. * by this `JitEvaluator` class.
  2426. *
  2427. * @param fn A function to execute.
  2428. * @param args The arguments to pass to the function being executed.
  2429. * @returns The return value of the executed function.
  2430. */
  2431. executeFunction(fn: Function, args: any[]): any;
  2432. }
  2433. declare class DomElementSchemaRegistry extends ElementSchemaRegistry {
  2434. private _schema;
  2435. private _eventSchema;
  2436. constructor();
  2437. hasProperty(tagName: string, propName: string, schemaMetas: SchemaMetadata[]): boolean;
  2438. hasElement(tagName: string, schemaMetas: SchemaMetadata[]): boolean;
  2439. /**
  2440. * securityContext returns the security context for the given property on the given DOM tag.
  2441. *
  2442. * Tag and property name are statically known and cannot change at runtime, i.e. it is not
  2443. * possible to bind a value into a changing attribute or tag name.
  2444. *
  2445. * The filtering is based on a list of allowed tags|attributes. All attributes in the schema
  2446. * above are assumed to have the 'NONE' security context, i.e. that they are safe inert
  2447. * string values. Only specific well known attack vectors are assigned their appropriate context.
  2448. */
  2449. securityContext(tagName: string, propName: string, isAttribute: boolean): SecurityContext;
  2450. getMappedPropName(propName: string): string;
  2451. getDefaultComponentElementName(): string;
  2452. validateProperty(name: string): {
  2453. error: boolean;
  2454. msg?: string;
  2455. };
  2456. validateAttribute(name: string): {
  2457. error: boolean;
  2458. msg?: string;
  2459. };
  2460. allKnownElementNames(): string[];
  2461. allKnownAttributesOfElement(tagName: string): string[];
  2462. allKnownEventsOfElement(tagName: string): string[];
  2463. normalizeAnimationStyleProperty(propName: string): string;
  2464. normalizeAnimationStyleValue(camelCaseProp: string, userProvidedProp: string, val: string | number): {
  2465. error: string;
  2466. value: string;
  2467. };
  2468. }
  2469. /**
  2470. * A css selector contains an element name,
  2471. * css classes and attribute/value pairs with the purpose
  2472. * of selecting subsets out of them.
  2473. */
  2474. declare class CssSelector {
  2475. element: string | null;
  2476. classNames: string[];
  2477. /**
  2478. * The selectors are encoded in pairs where:
  2479. * - even locations are attribute names
  2480. * - odd locations are attribute values.
  2481. *
  2482. * Example:
  2483. * Selector: `[key1=value1][key2]` would parse to:
  2484. * ```
  2485. * ['key1', 'value1', 'key2', '']
  2486. * ```
  2487. */
  2488. attrs: string[];
  2489. notSelectors: CssSelector[];
  2490. static parse(selector: string): CssSelector[];
  2491. /**
  2492. * Unescape `\$` sequences from the CSS attribute selector.
  2493. *
  2494. * This is needed because `$` can have a special meaning in CSS selectors,
  2495. * but we might want to match an attribute that contains `$`.
  2496. * [MDN web link for more
  2497. * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors).
  2498. * @param attr the attribute to unescape.
  2499. * @returns the unescaped string.
  2500. */
  2501. unescapeAttribute(attr: string): string;
  2502. /**
  2503. * Escape `$` sequences from the CSS attribute selector.
  2504. *
  2505. * This is needed because `$` can have a special meaning in CSS selectors,
  2506. * with this method we are escaping `$` with `\$'.
  2507. * [MDN web link for more
  2508. * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors).
  2509. * @param attr the attribute to escape.
  2510. * @returns the escaped string.
  2511. */
  2512. escapeAttribute(attr: string): string;
  2513. isElementSelector(): boolean;
  2514. hasElementSelector(): boolean;
  2515. setElement(element?: string | null): void;
  2516. getAttrs(): string[];
  2517. addAttribute(name: string, value?: string): void;
  2518. addClassName(name: string): void;
  2519. toString(): string;
  2520. }
  2521. /**
  2522. * Reads a list of CssSelectors and allows to calculate which ones
  2523. * are contained in a given CssSelector.
  2524. */
  2525. declare class SelectorMatcher<T = any> {
  2526. static createNotMatcher(notSelectors: CssSelector[]): SelectorMatcher<null>;
  2527. private _elementMap;
  2528. private _elementPartialMap;
  2529. private _classMap;
  2530. private _classPartialMap;
  2531. private _attrValueMap;
  2532. private _attrValuePartialMap;
  2533. private _listContexts;
  2534. addSelectables(cssSelectors: CssSelector[], callbackCtxt?: T): void;
  2535. /**
  2536. * Add an object that can be found later on by calling `match`.
  2537. * @param cssSelector A css selector
  2538. * @param callbackCtxt An opaque object that will be given to the callback of the `match` function
  2539. */
  2540. private _addSelectable;
  2541. private _addTerminal;
  2542. private _addPartial;
  2543. /**
  2544. * Find the objects that have been added via `addSelectable`
  2545. * whose css selector is contained in the given css selector.
  2546. * @param cssSelector A css selector
  2547. * @param matchedCallback This callback will be called with the object handed into `addSelectable`
  2548. * @return boolean true if a match was found
  2549. */
  2550. match(cssSelector: CssSelector, matchedCallback: ((c: CssSelector, a: T) => void) | null): boolean;
  2551. }
  2552. declare class SelectorListContext {
  2553. selectors: CssSelector[];
  2554. alreadyMatched: boolean;
  2555. constructor(selectors: CssSelector[]);
  2556. }
  2557. declare class SelectorContext<T = any> {
  2558. selector: CssSelector;
  2559. cbContext: T;
  2560. listContext: SelectorListContext;
  2561. notSelectors: CssSelector[];
  2562. constructor(selector: CssSelector, cbContext: T, listContext: SelectorListContext);
  2563. finalize(cssSelector: CssSelector, callback: ((c: CssSelector, a: T) => void) | null): boolean;
  2564. }
  2565. interface R3Reference {
  2566. value: Expression;
  2567. type: Expression;
  2568. }
  2569. /**
  2570. * Result of compilation of a render3 code unit, e.g. component, directive, pipe, etc.
  2571. */
  2572. interface R3CompiledExpression {
  2573. expression: Expression;
  2574. type: Type;
  2575. statements: Statement[];
  2576. }
  2577. declare function getSafePropertyAccessString(accessor: string, name: string): string;
  2578. declare function devOnlyGuardedExpression(expr: Expression): Expression;
  2579. /**
  2580. * Describes an expression that may have been wrapped in a `forwardRef()` guard.
  2581. *
  2582. * This is used when describing expressions that can refer to types that may eagerly reference types
  2583. * that have not yet been defined.
  2584. */
  2585. interface MaybeForwardRefExpression<T extends Expression = Expression> {
  2586. /**
  2587. * The unwrapped expression.
  2588. */
  2589. expression: T;
  2590. /**
  2591. * Specified whether the `expression` contains a reference to something that has not yet been
  2592. * defined, and whether the expression is still wrapped in a `forwardRef()` call.
  2593. *
  2594. * If this value is `ForwardRefHandling.None` then the `expression` is safe to use as-is.
  2595. *
  2596. * Otherwise the `expression` was wrapped in a call to `forwardRef()` and must not be eagerly
  2597. * evaluated. Instead it must be wrapped in a function closure that will be evaluated lazily to
  2598. * allow the definition of the expression to be evaluated first.
  2599. *
  2600. * In full AOT compilation it can be safe to unwrap the `forwardRef()` call up front if the
  2601. * expression will actually be evaluated lazily inside a function call after the value of
  2602. * `expression` has been defined.
  2603. *
  2604. * But in other cases, such as partial AOT compilation or JIT compilation the expression will be
  2605. * evaluated eagerly in top level code so will need to continue to be wrapped in a `forwardRef()`
  2606. * call.
  2607. *
  2608. */
  2609. forwardRef: ForwardRefHandling;
  2610. }
  2611. declare function createMayBeForwardRefExpression<T extends Expression>(expression: T, forwardRef: ForwardRefHandling): MaybeForwardRefExpression<T>;
  2612. /**
  2613. * Specifies how a forward ref has been handled in a MaybeForwardRefExpression
  2614. */
  2615. declare const enum ForwardRefHandling {
  2616. /** The expression was not wrapped in a `forwardRef()` call in the first place. */
  2617. None = 0,
  2618. /** The expression is still wrapped in a `forwardRef()` call. */
  2619. Wrapped = 1,
  2620. /** The expression was wrapped in a `forwardRef()` call but has since been unwrapped. */
  2621. Unwrapped = 2
  2622. }
  2623. /**
  2624. * Metadata required by the factory generator to generate a `factory` function for a type.
  2625. */
  2626. interface R3ConstructorFactoryMetadata {
  2627. /**
  2628. * String name of the type being generated (used to name the factory function).
  2629. */
  2630. name: string;
  2631. /**
  2632. * An expression representing the interface type being constructed.
  2633. */
  2634. type: R3Reference;
  2635. /** Number of arguments for the `type`. */
  2636. typeArgumentCount: number;
  2637. /**
  2638. * Regardless of whether `fnOrClass` is a constructor function or a user-defined factory, it
  2639. * may have 0 or more parameters, which will be injected according to the `R3DependencyMetadata`
  2640. * for those parameters. If this is `null`, then the type's constructor is nonexistent and will
  2641. * be inherited from `fnOrClass` which is interpreted as the current type. If this is `'invalid'`,
  2642. * then one or more of the parameters wasn't resolvable and any attempt to use these deps will
  2643. * result in a runtime error.
  2644. */
  2645. deps: R3DependencyMetadata[] | 'invalid' | null;
  2646. /**
  2647. * Type of the target being created by the factory.
  2648. */
  2649. target: FactoryTarget$1;
  2650. }
  2651. declare enum R3FactoryDelegateType {
  2652. Class = 0,
  2653. Function = 1
  2654. }
  2655. interface R3DelegatedFnOrClassMetadata extends R3ConstructorFactoryMetadata {
  2656. delegate: Expression;
  2657. delegateType: R3FactoryDelegateType;
  2658. delegateDeps: R3DependencyMetadata[];
  2659. }
  2660. interface R3ExpressionFactoryMetadata extends R3ConstructorFactoryMetadata {
  2661. expression: Expression;
  2662. }
  2663. type R3FactoryMetadata = R3ConstructorFactoryMetadata | R3DelegatedFnOrClassMetadata | R3ExpressionFactoryMetadata;
  2664. declare enum FactoryTarget$1 {
  2665. Directive = 0,
  2666. Component = 1,
  2667. Injectable = 2,
  2668. Pipe = 3,
  2669. NgModule = 4
  2670. }
  2671. interface R3DependencyMetadata {
  2672. /**
  2673. * An expression representing the token or value to be injected.
  2674. * Or `null` if the dependency could not be resolved - making it invalid.
  2675. */
  2676. token: Expression | null;
  2677. /**
  2678. * If an @Attribute decorator is present, this is the literal type of the attribute name, or
  2679. * the unknown type if no literal type is available (e.g. the attribute name is an expression).
  2680. * Otherwise it is null;
  2681. */
  2682. attributeNameType: Expression | null;
  2683. /**
  2684. * Whether the dependency has an @Host qualifier.
  2685. */
  2686. host: boolean;
  2687. /**
  2688. * Whether the dependency has an @Optional qualifier.
  2689. */
  2690. optional: boolean;
  2691. /**
  2692. * Whether the dependency has an @Self qualifier.
  2693. */
  2694. self: boolean;
  2695. /**
  2696. * Whether the dependency has an @SkipSelf qualifier.
  2697. */
  2698. skipSelf: boolean;
  2699. }
  2700. /**
  2701. * Construct a factory function expression for the given `R3FactoryMetadata`.
  2702. */
  2703. declare function compileFactoryFunction(meta: R3FactoryMetadata): R3CompiledExpression;
  2704. interface R3InjectableMetadata {
  2705. name: string;
  2706. type: R3Reference;
  2707. typeArgumentCount: number;
  2708. providedIn: MaybeForwardRefExpression;
  2709. useClass?: MaybeForwardRefExpression;
  2710. useFactory?: Expression;
  2711. useExisting?: MaybeForwardRefExpression;
  2712. useValue?: MaybeForwardRefExpression;
  2713. deps?: R3DependencyMetadata[];
  2714. }
  2715. declare function compileInjectable(meta: R3InjectableMetadata, resolveForwardRefs: boolean): R3CompiledExpression;
  2716. declare function createInjectableType(meta: R3InjectableMetadata): ExpressionType;
  2717. interface R3PartialDeclaration {
  2718. /**
  2719. * The minimum version of the compiler that can process this partial declaration.
  2720. */
  2721. minVersion: string;
  2722. /**
  2723. * Version number of the Angular compiler that was used to compile this declaration. The linker
  2724. * will be able to detect which version a library is using and interpret its metadata accordingly.
  2725. */
  2726. version: string;
  2727. /**
  2728. * A reference to the `@angular/core` ES module, which allows access
  2729. * to all Angular exports, including Ivy instructions.
  2730. */
  2731. ngImport: Expression;
  2732. /**
  2733. * Reference to the decorated class, which is subject to this partial declaration.
  2734. */
  2735. type: Expression;
  2736. }
  2737. type LegacyInputPartialMapping = string | [bindingPropertyName: string, classPropertyName: string, transformFunction?: Expression];
  2738. /**
  2739. * Describes the shape of the object that the `ɵɵngDeclareDirective()` function accepts.
  2740. */
  2741. interface R3DeclareDirectiveMetadata extends R3PartialDeclaration {
  2742. /**
  2743. * Unparsed selector of the directive.
  2744. */
  2745. selector?: string;
  2746. /**
  2747. * A mapping of inputs from class property names to binding property names, or to a tuple of
  2748. * binding property name and class property name if the names are different.
  2749. */
  2750. inputs?: {
  2751. [fieldName: string]: {
  2752. classPropertyName: string;
  2753. publicName: string;
  2754. isSignal: boolean;
  2755. isRequired: boolean;
  2756. transformFunction: Expression | null;
  2757. } | LegacyInputPartialMapping;
  2758. };
  2759. /**
  2760. * A mapping of outputs from class property names to binding property names.
  2761. */
  2762. outputs?: {
  2763. [classPropertyName: string]: string;
  2764. };
  2765. /**
  2766. * Information about host bindings present on the component.
  2767. */
  2768. host?: {
  2769. /**
  2770. * A mapping of attribute names to their value expression.
  2771. */
  2772. attributes?: {
  2773. [key: string]: Expression;
  2774. };
  2775. /**
  2776. * A mapping of event names to their unparsed event handler expression.
  2777. */
  2778. listeners: {
  2779. [key: string]: string;
  2780. };
  2781. /**
  2782. * A mapping of bound properties to their unparsed binding expression.
  2783. */
  2784. properties?: {
  2785. [key: string]: string;
  2786. };
  2787. /**
  2788. * The value of the class attribute, if present. This is stored outside of `attributes` as its
  2789. * string value must be known statically.
  2790. */
  2791. classAttribute?: string;
  2792. /**
  2793. * The value of the style attribute, if present. This is stored outside of `attributes` as its
  2794. * string value must be known statically.
  2795. */
  2796. styleAttribute?: string;
  2797. };
  2798. /**
  2799. * Information about the content queries made by the directive.
  2800. */
  2801. queries?: R3DeclareQueryMetadata[];
  2802. /**
  2803. * Information about the view queries made by the directive.
  2804. */
  2805. viewQueries?: R3DeclareQueryMetadata[];
  2806. /**
  2807. * The list of providers provided by the directive.
  2808. */
  2809. providers?: Expression;
  2810. /**
  2811. * The names by which the directive is exported.
  2812. */
  2813. exportAs?: string[];
  2814. /**
  2815. * Whether the directive has an inheritance clause. Defaults to false.
  2816. */
  2817. usesInheritance?: boolean;
  2818. /**
  2819. * Whether the directive implements the `ngOnChanges` hook. Defaults to false.
  2820. */
  2821. usesOnChanges?: boolean;
  2822. /**
  2823. * Whether the directive is standalone. Defaults to false.
  2824. */
  2825. isStandalone?: boolean;
  2826. /**
  2827. * Whether the directive is a signal-based directive. Defaults to false.
  2828. */
  2829. isSignal?: boolean;
  2830. /**
  2831. * Additional directives applied to the directive host.
  2832. */
  2833. hostDirectives?: R3DeclareHostDirectiveMetadata[];
  2834. }
  2835. /**
  2836. * Describes the shape of the object that the `ɵɵngDeclareComponent()` function accepts.
  2837. */
  2838. interface R3DeclareComponentMetadata extends R3DeclareDirectiveMetadata {
  2839. /**
  2840. * The component's unparsed template string as opaque expression. The template is represented
  2841. * using either a string literal or template literal without substitutions, but its value is
  2842. * not read directly. Instead, the template parser is given the full source file's text and
  2843. * the range of this expression to parse directly from source.
  2844. */
  2845. template: Expression;
  2846. /**
  2847. * Whether the template was inline (using `template`) or external (using `templateUrl`).
  2848. * Defaults to false.
  2849. */
  2850. isInline?: boolean;
  2851. /**
  2852. * CSS from inline styles and included styleUrls.
  2853. */
  2854. styles?: string[];
  2855. /**
  2856. * List of components which matched in the template, including sufficient
  2857. * metadata for each directive to attribute bindings and references within
  2858. * the template to each directive specifically, if the runtime instructions
  2859. * support this.
  2860. */
  2861. components?: R3DeclareDirectiveDependencyMetadata[];
  2862. /**
  2863. * List of directives which matched in the template, including sufficient
  2864. * metadata for each directive to attribute bindings and references within
  2865. * the template to each directive specifically, if the runtime instructions
  2866. * support this.
  2867. */
  2868. directives?: R3DeclareDirectiveDependencyMetadata[];
  2869. /**
  2870. * List of dependencies which matched in the template, including sufficient
  2871. * metadata for each directive/pipe to attribute bindings and references within
  2872. * the template to each directive specifically, if the runtime instructions
  2873. * support this.
  2874. */
  2875. dependencies?: R3DeclareTemplateDependencyMetadata[];
  2876. /**
  2877. * List of defer block dependency functions, ordered by the appearance
  2878. * of the corresponding deferred block in the template.
  2879. */
  2880. deferBlockDependencies?: Expression[];
  2881. /**
  2882. * A map of pipe names to an expression referencing the pipe type (possibly a forward reference
  2883. * wrapped in a `forwardRef` invocation) which are used in the template.
  2884. */
  2885. pipes?: {
  2886. [pipeName: string]: Expression | (() => Expression);
  2887. };
  2888. /**
  2889. * The list of view providers defined in the component.
  2890. */
  2891. viewProviders?: Expression;
  2892. /**
  2893. * A collection of animation triggers that will be used in the component template.
  2894. */
  2895. animations?: Expression;
  2896. /**
  2897. * Strategy used for detecting changes in the component.
  2898. * Defaults to `ChangeDetectionStrategy.Default`.
  2899. */
  2900. changeDetection?: ChangeDetectionStrategy;
  2901. /**
  2902. * An encapsulation policy for the component's styling.
  2903. * Defaults to `ViewEncapsulation.Emulated`.
  2904. */
  2905. encapsulation?: ViewEncapsulation;
  2906. /**
  2907. * Overrides the default interpolation start and end delimiters. Defaults to {{ and }}.
  2908. */
  2909. interpolation?: [string, string];
  2910. /**
  2911. * Whether whitespace in the template should be preserved. Defaults to false.
  2912. */
  2913. preserveWhitespaces?: boolean;
  2914. }
  2915. type R3DeclareTemplateDependencyMetadata = R3DeclareDirectiveDependencyMetadata | R3DeclarePipeDependencyMetadata | R3DeclareNgModuleDependencyMetadata;
  2916. interface R3DeclareDirectiveDependencyMetadata {
  2917. kind: 'directive' | 'component';
  2918. /**
  2919. * Selector of the directive.
  2920. */
  2921. selector: string;
  2922. /**
  2923. * Reference to the directive class (possibly a forward reference wrapped in a `forwardRef`
  2924. * invocation).
  2925. */
  2926. type: Expression | (() => Expression);
  2927. /**
  2928. * Property names of the directive's inputs.
  2929. */
  2930. inputs?: string[];
  2931. /**
  2932. * Event names of the directive's outputs.
  2933. */
  2934. outputs?: string[];
  2935. /**
  2936. * Names by which this directive exports itself for references.
  2937. */
  2938. exportAs?: string[];
  2939. }
  2940. interface R3DeclarePipeDependencyMetadata {
  2941. kind: 'pipe';
  2942. name: string;
  2943. /**
  2944. * Reference to the pipe class (possibly a forward reference wrapped in a `forwardRef`
  2945. * invocation).
  2946. */
  2947. type: Expression | (() => Expression);
  2948. }
  2949. interface R3DeclareNgModuleDependencyMetadata {
  2950. kind: 'ngmodule';
  2951. type: Expression | (() => Expression);
  2952. }
  2953. interface R3DeclareQueryMetadata {
  2954. /**
  2955. * Name of the property on the class to update with query results.
  2956. */
  2957. propertyName: string;
  2958. /**
  2959. * Whether to read only the first matching result, or an array of results. Defaults to false.
  2960. */
  2961. first?: boolean;
  2962. /**
  2963. * Either an expression representing a type (possibly wrapped in a `forwardRef()`) or
  2964. * `InjectionToken` for the query predicate, or a set of string selectors.
  2965. */
  2966. predicate: Expression | string[];
  2967. /**
  2968. * Whether to include only direct children or all descendants. Defaults to false.
  2969. */
  2970. descendants?: boolean;
  2971. /**
  2972. * True to only fire changes if there are underlying changes to the query.
  2973. */
  2974. emitDistinctChangesOnly?: boolean;
  2975. /**
  2976. * An expression representing a type to read from each matched node, or null if the default value
  2977. * for a given node is to be returned.
  2978. */
  2979. read?: Expression;
  2980. /**
  2981. * Whether or not this query should collect only static results. Defaults to false.
  2982. *
  2983. * If static is true, the query's results will be set on the component after nodes are created,
  2984. * but before change detection runs. This means that any results that relied upon change detection
  2985. * to run (e.g. results inside *ngIf or *ngFor views) will not be collected. Query results are
  2986. * available in the ngOnInit hook.
  2987. *
  2988. * If static is false, the query's results will be set on the component after change detection
  2989. * runs. This means that the query results can contain nodes inside *ngIf or *ngFor views, but
  2990. * the results will not be available in the ngOnInit hook (only in the ngAfterContentInit for
  2991. * content hooks and ngAfterViewInit for view hooks).
  2992. */
  2993. static?: boolean;
  2994. /** Whether the query is signal-based. */
  2995. isSignal: boolean;
  2996. }
  2997. /**
  2998. * Describes the shape of the objects that the `ɵɵngDeclareNgModule()` accepts.
  2999. */
  3000. interface R3DeclareNgModuleMetadata extends R3PartialDeclaration {
  3001. /**
  3002. * An array of expressions representing the bootstrap components specified by the module.
  3003. */
  3004. bootstrap?: Expression[];
  3005. /**
  3006. * An array of expressions representing the directives and pipes declared by the module.
  3007. */
  3008. declarations?: Expression[];
  3009. /**
  3010. * An array of expressions representing the imports of the module.
  3011. */
  3012. imports?: Expression[];
  3013. /**
  3014. * An array of expressions representing the exports of the module.
  3015. */
  3016. exports?: Expression[];
  3017. /**
  3018. * The set of schemas that declare elements to be allowed in the NgModule.
  3019. */
  3020. schemas?: Expression[];
  3021. /** Unique ID or expression representing the unique ID of an NgModule. */
  3022. id?: Expression;
  3023. }
  3024. /**
  3025. * Describes the shape of the objects that the `ɵɵngDeclareInjector()` accepts.
  3026. */
  3027. interface R3DeclareInjectorMetadata extends R3PartialDeclaration {
  3028. /**
  3029. * The list of providers provided by the injector.
  3030. */
  3031. providers?: Expression;
  3032. /**
  3033. * The list of imports into the injector.
  3034. */
  3035. imports?: Expression[];
  3036. }
  3037. /**
  3038. * Describes the shape of the object that the `ɵɵngDeclarePipe()` function accepts.
  3039. *
  3040. * This interface serves primarily as documentation, as conformance to this interface is not
  3041. * enforced during linking.
  3042. */
  3043. interface R3DeclarePipeMetadata extends R3PartialDeclaration {
  3044. /**
  3045. * The name to use in templates to refer to this pipe.
  3046. */
  3047. name: string;
  3048. /**
  3049. * Whether this pipe is "pure".
  3050. *
  3051. * A pure pipe's `transform()` method is only invoked when its input arguments change.
  3052. *
  3053. * Default: true.
  3054. */
  3055. pure?: boolean;
  3056. /**
  3057. * Whether the pipe is standalone.
  3058. *
  3059. * Default: false.
  3060. */
  3061. isStandalone?: boolean;
  3062. }
  3063. /**
  3064. * Describes the shape of the object that the `ɵɵngDeclareFactory()` function accepts.
  3065. *
  3066. * This interface serves primarily as documentation, as conformance to this interface is not
  3067. * enforced during linking.
  3068. */
  3069. interface R3DeclareFactoryMetadata extends R3PartialDeclaration {
  3070. /**
  3071. * A collection of dependencies that this factory relies upon.
  3072. *
  3073. * If this is `null`, then the type's constructor is nonexistent and will be inherited from an
  3074. * ancestor of the type.
  3075. *
  3076. * If this is `'invalid'`, then one or more of the parameters wasn't resolvable and any attempt to
  3077. * use these deps will result in a runtime error.
  3078. */
  3079. deps: R3DeclareDependencyMetadata[] | 'invalid' | null;
  3080. /**
  3081. * Type of the target being created by the factory.
  3082. */
  3083. target: FactoryTarget;
  3084. }
  3085. declare enum FactoryTarget {
  3086. Directive = 0,
  3087. Component = 1,
  3088. Injectable = 2,
  3089. Pipe = 3,
  3090. NgModule = 4
  3091. }
  3092. /**
  3093. * Describes the shape of the object that the `ɵɵngDeclareInjectable()` function accepts.
  3094. *
  3095. * This interface serves primarily as documentation, as conformance to this interface is not
  3096. * enforced during linking.
  3097. */
  3098. interface R3DeclareInjectableMetadata extends R3PartialDeclaration {
  3099. /**
  3100. * If provided, specifies that the declared injectable belongs to a particular injector:
  3101. * - `InjectorType` such as `NgModule`,
  3102. * - `'root'` the root injector
  3103. * - `'any'` all injectors.
  3104. * If not provided, then it does not belong to any injector. Must be explicitly listed in the
  3105. * providers of an injector.
  3106. */
  3107. providedIn?: Expression;
  3108. /**
  3109. * If provided, an expression that evaluates to a class to use when creating an instance of this
  3110. * injectable.
  3111. */
  3112. useClass?: Expression;
  3113. /**
  3114. * If provided, an expression that evaluates to a function to use when creating an instance of
  3115. * this injectable.
  3116. */
  3117. useFactory?: Expression;
  3118. /**
  3119. * If provided, an expression that evaluates to a token of another injectable that this injectable
  3120. * aliases.
  3121. */
  3122. useExisting?: Expression;
  3123. /**
  3124. * If provided, an expression that evaluates to the value of the instance of this injectable.
  3125. */
  3126. useValue?: Expression;
  3127. /**
  3128. * An array of dependencies to support instantiating this injectable via `useClass` or
  3129. * `useFactory`.
  3130. */
  3131. deps?: R3DeclareDependencyMetadata[];
  3132. }
  3133. /**
  3134. * Metadata indicating how a dependency should be injected into a factory.
  3135. */
  3136. interface R3DeclareDependencyMetadata {
  3137. /**
  3138. * An expression representing the token or value to be injected, or `null` if the dependency is
  3139. * not valid.
  3140. *
  3141. * If this dependency is due to the `@Attribute()` decorator, then this is an expression
  3142. * evaluating to the name of the attribute.
  3143. */
  3144. token: Expression | null;
  3145. /**
  3146. * Whether the dependency is injecting an attribute value.
  3147. * Default: false.
  3148. */
  3149. attribute?: boolean;
  3150. /**
  3151. * Whether the dependency has an @Host qualifier.
  3152. * Default: false,
  3153. */
  3154. host?: boolean;
  3155. /**
  3156. * Whether the dependency has an @Optional qualifier.
  3157. * Default: false,
  3158. */
  3159. optional?: boolean;
  3160. /**
  3161. * Whether the dependency has an @Self qualifier.
  3162. * Default: false,
  3163. */
  3164. self?: boolean;
  3165. /**
  3166. * Whether the dependency has an @SkipSelf qualifier.
  3167. * Default: false,
  3168. */
  3169. skipSelf?: boolean;
  3170. }
  3171. /**
  3172. * Describes the shape of the object that the `ɵɵngDeclareClassMetadata()` function accepts.
  3173. *
  3174. * This interface serves primarily as documentation, as conformance to this interface is not
  3175. * enforced during linking.
  3176. */
  3177. interface R3DeclareClassMetadata extends R3PartialDeclaration {
  3178. /**
  3179. * The Angular decorators of the class.
  3180. */
  3181. decorators: Expression;
  3182. /**
  3183. * Optionally specifies the constructor parameters, their types and the Angular decorators of each
  3184. * parameter. This property is omitted if the class does not have a constructor.
  3185. */
  3186. ctorParameters?: Expression;
  3187. /**
  3188. * Optionally specifies the Angular decorators applied to the class properties. This property is
  3189. * omitted if no properties have any decorators.
  3190. */
  3191. propDecorators?: Expression;
  3192. }
  3193. /**
  3194. * Describes the shape of the object that the `ɵɵngDeclareClassMetadataAsync()` function accepts.
  3195. *
  3196. * This interface serves primarily as documentation, as conformance to this interface is not
  3197. * enforced during linking.
  3198. */
  3199. interface R3DeclareClassMetadataAsync extends R3PartialDeclaration {
  3200. /** Function that loads the deferred dependencies associated with the component. */
  3201. resolveDeferredDeps: Expression;
  3202. /**
  3203. * Function that, when invoked with the resolved deferred
  3204. * dependencies, will return the class metadata.
  3205. */
  3206. resolveMetadata: Expression;
  3207. }
  3208. /**
  3209. * Describes the shape of the object literal that can be
  3210. * passed in as a part of the `hostDirectives` array.
  3211. */
  3212. interface R3DeclareHostDirectiveMetadata {
  3213. directive: Expression;
  3214. inputs?: string[];
  3215. outputs?: string[];
  3216. }
  3217. interface Node {
  3218. sourceSpan: ParseSourceSpan;
  3219. visit<Result>(visitor: Visitor<Result>): Result;
  3220. }
  3221. /**
  3222. * This is an R3 `Node`-like wrapper for a raw `html.Comment` node. We do not currently
  3223. * require the implementation of a visitor for Comments as they are only collected at
  3224. * the top-level of the R3 AST, and only if `Render3ParseOptions['collectCommentNodes']`
  3225. * is true.
  3226. */
  3227. declare class Comment implements Node {
  3228. value: string;
  3229. sourceSpan: ParseSourceSpan;
  3230. constructor(value: string, sourceSpan: ParseSourceSpan);
  3231. visit<Result>(_visitor: Visitor<Result>): Result;
  3232. }
  3233. declare class Text implements Node {
  3234. value: string;
  3235. sourceSpan: ParseSourceSpan;
  3236. constructor(value: string, sourceSpan: ParseSourceSpan);
  3237. visit<Result>(visitor: Visitor<Result>): Result;
  3238. }
  3239. declare class BoundText implements Node {
  3240. value: AST;
  3241. sourceSpan: ParseSourceSpan;
  3242. i18n?: I18nMeta$1 | undefined;
  3243. constructor(value: AST, sourceSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined);
  3244. visit<Result>(visitor: Visitor<Result>): Result;
  3245. }
  3246. /**
  3247. * Represents a text attribute in the template.
  3248. *
  3249. * `valueSpan` may not be present in cases where there is no value `<div a></div>`.
  3250. * `keySpan` may also not be present for synthetic attributes from ICU expansions.
  3251. */
  3252. declare class TextAttribute implements Node {
  3253. name: string;
  3254. value: string;
  3255. sourceSpan: ParseSourceSpan;
  3256. readonly keySpan: ParseSourceSpan | undefined;
  3257. valueSpan?: ParseSourceSpan | undefined;
  3258. i18n?: I18nMeta$1 | undefined;
  3259. constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan | undefined, valueSpan?: ParseSourceSpan | undefined, i18n?: I18nMeta$1 | undefined);
  3260. visit<Result>(visitor: Visitor<Result>): Result;
  3261. }
  3262. declare class BoundAttribute implements Node {
  3263. name: string;
  3264. type: BindingType;
  3265. securityContext: SecurityContext;
  3266. value: AST;
  3267. unit: string | null;
  3268. sourceSpan: ParseSourceSpan;
  3269. readonly keySpan: ParseSourceSpan;
  3270. valueSpan: ParseSourceSpan | undefined;
  3271. i18n: I18nMeta$1 | undefined;
  3272. constructor(name: string, type: BindingType, securityContext: SecurityContext, value: AST, unit: string | null, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan, valueSpan: ParseSourceSpan | undefined, i18n: I18nMeta$1 | undefined);
  3273. static fromBoundElementProperty(prop: BoundElementProperty, i18n?: I18nMeta$1): BoundAttribute;
  3274. visit<Result>(visitor: Visitor<Result>): Result;
  3275. }
  3276. declare class BoundEvent implements Node {
  3277. name: string;
  3278. type: ParsedEventType;
  3279. handler: AST;
  3280. target: string | null;
  3281. phase: string | null;
  3282. sourceSpan: ParseSourceSpan;
  3283. handlerSpan: ParseSourceSpan;
  3284. readonly keySpan: ParseSourceSpan;
  3285. constructor(name: string, type: ParsedEventType, handler: AST, target: string | null, phase: string | null, sourceSpan: ParseSourceSpan, handlerSpan: ParseSourceSpan, keySpan: ParseSourceSpan);
  3286. static fromParsedEvent(event: ParsedEvent): BoundEvent;
  3287. visit<Result>(visitor: Visitor<Result>): Result;
  3288. }
  3289. declare class Element implements Node {
  3290. name: string;
  3291. attributes: TextAttribute[];
  3292. inputs: BoundAttribute[];
  3293. outputs: BoundEvent[];
  3294. children: Node[];
  3295. references: Reference[];
  3296. sourceSpan: ParseSourceSpan;
  3297. startSourceSpan: ParseSourceSpan;
  3298. endSourceSpan: ParseSourceSpan | null;
  3299. i18n?: I18nMeta$1 | undefined;
  3300. constructor(name: string, attributes: TextAttribute[], inputs: BoundAttribute[], outputs: BoundEvent[], children: Node[], references: Reference[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta$1 | undefined);
  3301. visit<Result>(visitor: Visitor<Result>): Result;
  3302. }
  3303. declare abstract class DeferredTrigger implements Node {
  3304. nameSpan: ParseSourceSpan | null;
  3305. sourceSpan: ParseSourceSpan;
  3306. prefetchSpan: ParseSourceSpan | null;
  3307. whenOrOnSourceSpan: ParseSourceSpan | null;
  3308. hydrateSpan: ParseSourceSpan | null;
  3309. constructor(nameSpan: ParseSourceSpan | null, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, whenOrOnSourceSpan: ParseSourceSpan | null, hydrateSpan: ParseSourceSpan | null);
  3310. visit<Result>(visitor: Visitor<Result>): Result;
  3311. }
  3312. declare class BoundDeferredTrigger extends DeferredTrigger {
  3313. value: AST;
  3314. constructor(value: AST, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, whenSourceSpan: ParseSourceSpan, hydrateSpan: ParseSourceSpan | null);
  3315. }
  3316. declare class NeverDeferredTrigger extends DeferredTrigger {
  3317. }
  3318. declare class IdleDeferredTrigger extends DeferredTrigger {
  3319. }
  3320. declare class ImmediateDeferredTrigger extends DeferredTrigger {
  3321. }
  3322. declare class HoverDeferredTrigger extends DeferredTrigger {
  3323. reference: string | null;
  3324. constructor(reference: string | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, onSourceSpan: ParseSourceSpan | null, hydrateSpan: ParseSourceSpan | null);
  3325. }
  3326. declare class TimerDeferredTrigger extends DeferredTrigger {
  3327. delay: number;
  3328. constructor(delay: number, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, onSourceSpan: ParseSourceSpan | null, hydrateSpan: ParseSourceSpan | null);
  3329. }
  3330. declare class InteractionDeferredTrigger extends DeferredTrigger {
  3331. reference: string | null;
  3332. constructor(reference: string | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, onSourceSpan: ParseSourceSpan | null, hydrateSpan: ParseSourceSpan | null);
  3333. }
  3334. declare class ViewportDeferredTrigger extends DeferredTrigger {
  3335. reference: string | null;
  3336. constructor(reference: string | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, onSourceSpan: ParseSourceSpan | null, hydrateSpan: ParseSourceSpan | null);
  3337. }
  3338. declare class BlockNode {
  3339. nameSpan: ParseSourceSpan;
  3340. sourceSpan: ParseSourceSpan;
  3341. startSourceSpan: ParseSourceSpan;
  3342. endSourceSpan: ParseSourceSpan | null;
  3343. constructor(nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
  3344. }
  3345. declare class DeferredBlockPlaceholder extends BlockNode implements Node {
  3346. children: Node[];
  3347. minimumTime: number | null;
  3348. i18n?: I18nMeta$1 | undefined;
  3349. constructor(children: Node[], minimumTime: number | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta$1 | undefined);
  3350. visit<Result>(visitor: Visitor<Result>): Result;
  3351. }
  3352. declare class DeferredBlockLoading extends BlockNode implements Node {
  3353. children: Node[];
  3354. afterTime: number | null;
  3355. minimumTime: number | null;
  3356. i18n?: I18nMeta$1 | undefined;
  3357. constructor(children: Node[], afterTime: number | null, minimumTime: number | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta$1 | undefined);
  3358. visit<Result>(visitor: Visitor<Result>): Result;
  3359. }
  3360. declare class DeferredBlockError extends BlockNode implements Node {
  3361. children: Node[];
  3362. i18n?: I18nMeta$1 | undefined;
  3363. constructor(children: Node[], nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta$1 | undefined);
  3364. visit<Result>(visitor: Visitor<Result>): Result;
  3365. }
  3366. interface DeferredBlockTriggers {
  3367. when?: BoundDeferredTrigger;
  3368. idle?: IdleDeferredTrigger;
  3369. immediate?: ImmediateDeferredTrigger;
  3370. hover?: HoverDeferredTrigger;
  3371. timer?: TimerDeferredTrigger;
  3372. interaction?: InteractionDeferredTrigger;
  3373. viewport?: ViewportDeferredTrigger;
  3374. never?: NeverDeferredTrigger;
  3375. }
  3376. declare class DeferredBlock extends BlockNode implements Node {
  3377. children: Node[];
  3378. placeholder: DeferredBlockPlaceholder | null;
  3379. loading: DeferredBlockLoading | null;
  3380. error: DeferredBlockError | null;
  3381. mainBlockSpan: ParseSourceSpan;
  3382. i18n?: I18nMeta$1 | undefined;
  3383. readonly triggers: Readonly<DeferredBlockTriggers>;
  3384. readonly prefetchTriggers: Readonly<DeferredBlockTriggers>;
  3385. readonly hydrateTriggers: Readonly<DeferredBlockTriggers>;
  3386. private readonly definedTriggers;
  3387. private readonly definedPrefetchTriggers;
  3388. private readonly definedHydrateTriggers;
  3389. constructor(children: Node[], triggers: DeferredBlockTriggers, prefetchTriggers: DeferredBlockTriggers, hydrateTriggers: DeferredBlockTriggers, placeholder: DeferredBlockPlaceholder | null, loading: DeferredBlockLoading | null, error: DeferredBlockError | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, mainBlockSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta$1 | undefined);
  3390. visit<Result>(visitor: Visitor<Result>): Result;
  3391. visitAll(visitor: Visitor<unknown>): void;
  3392. private visitTriggers;
  3393. }
  3394. declare class SwitchBlock extends BlockNode implements Node {
  3395. expression: AST;
  3396. cases: SwitchBlockCase[];
  3397. /**
  3398. * These blocks are only captured to allow for autocompletion in the language service. They
  3399. * aren't meant to be processed in any other way.
  3400. */
  3401. unknownBlocks: UnknownBlock[];
  3402. constructor(expression: AST, cases: SwitchBlockCase[],
  3403. /**
  3404. * These blocks are only captured to allow for autocompletion in the language service. They
  3405. * aren't meant to be processed in any other way.
  3406. */
  3407. unknownBlocks: UnknownBlock[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan);
  3408. visit<Result>(visitor: Visitor<Result>): Result;
  3409. }
  3410. declare class SwitchBlockCase extends BlockNode implements Node {
  3411. expression: AST | null;
  3412. children: Node[];
  3413. i18n?: I18nMeta$1 | undefined;
  3414. constructor(expression: AST | null, children: Node[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined);
  3415. visit<Result>(visitor: Visitor<Result>): Result;
  3416. }
  3417. declare class ForLoopBlock extends BlockNode implements Node {
  3418. item: Variable;
  3419. expression: ASTWithSource;
  3420. trackBy: ASTWithSource;
  3421. trackKeywordSpan: ParseSourceSpan;
  3422. contextVariables: Variable[];
  3423. children: Node[];
  3424. empty: ForLoopBlockEmpty | null;
  3425. mainBlockSpan: ParseSourceSpan;
  3426. i18n?: I18nMeta$1 | undefined;
  3427. constructor(item: Variable, expression: ASTWithSource, trackBy: ASTWithSource, trackKeywordSpan: ParseSourceSpan, contextVariables: Variable[], children: Node[], empty: ForLoopBlockEmpty | null, sourceSpan: ParseSourceSpan, mainBlockSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined);
  3428. visit<Result>(visitor: Visitor<Result>): Result;
  3429. }
  3430. declare class ForLoopBlockEmpty extends BlockNode implements Node {
  3431. children: Node[];
  3432. i18n?: I18nMeta$1 | undefined;
  3433. constructor(children: Node[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined);
  3434. visit<Result>(visitor: Visitor<Result>): Result;
  3435. }
  3436. declare class IfBlock extends BlockNode implements Node {
  3437. branches: IfBlockBranch[];
  3438. constructor(branches: IfBlockBranch[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan);
  3439. visit<Result>(visitor: Visitor<Result>): Result;
  3440. }
  3441. declare class IfBlockBranch extends BlockNode implements Node {
  3442. expression: AST | null;
  3443. children: Node[];
  3444. expressionAlias: Variable | null;
  3445. i18n?: I18nMeta$1 | undefined;
  3446. constructor(expression: AST | null, children: Node[], expressionAlias: Variable | null, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined);
  3447. visit<Result>(visitor: Visitor<Result>): Result;
  3448. }
  3449. declare class UnknownBlock implements Node {
  3450. name: string;
  3451. sourceSpan: ParseSourceSpan;
  3452. nameSpan: ParseSourceSpan;
  3453. constructor(name: string, sourceSpan: ParseSourceSpan, nameSpan: ParseSourceSpan);
  3454. visit<Result>(visitor: Visitor<Result>): Result;
  3455. }
  3456. declare class LetDeclaration implements Node {
  3457. name: string;
  3458. value: AST;
  3459. sourceSpan: ParseSourceSpan;
  3460. nameSpan: ParseSourceSpan;
  3461. valueSpan: ParseSourceSpan;
  3462. constructor(name: string, value: AST, sourceSpan: ParseSourceSpan, nameSpan: ParseSourceSpan, valueSpan: ParseSourceSpan);
  3463. visit<Result>(visitor: Visitor<Result>): Result;
  3464. }
  3465. declare class Template implements Node {
  3466. tagName: string | null;
  3467. attributes: TextAttribute[];
  3468. inputs: BoundAttribute[];
  3469. outputs: BoundEvent[];
  3470. templateAttrs: (BoundAttribute | TextAttribute)[];
  3471. children: Node[];
  3472. references: Reference[];
  3473. variables: Variable[];
  3474. sourceSpan: ParseSourceSpan;
  3475. startSourceSpan: ParseSourceSpan;
  3476. endSourceSpan: ParseSourceSpan | null;
  3477. i18n?: I18nMeta$1 | undefined;
  3478. constructor(tagName: string | null, attributes: TextAttribute[], inputs: BoundAttribute[], outputs: BoundEvent[], templateAttrs: (BoundAttribute | TextAttribute)[], children: Node[], references: Reference[], variables: Variable[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta$1 | undefined);
  3479. visit<Result>(visitor: Visitor<Result>): Result;
  3480. }
  3481. declare class Content implements Node {
  3482. selector: string;
  3483. attributes: TextAttribute[];
  3484. children: Node[];
  3485. sourceSpan: ParseSourceSpan;
  3486. i18n?: I18nMeta$1 | undefined;
  3487. readonly name = "ng-content";
  3488. constructor(selector: string, attributes: TextAttribute[], children: Node[], sourceSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined);
  3489. visit<Result>(visitor: Visitor<Result>): Result;
  3490. }
  3491. declare class Variable implements Node {
  3492. name: string;
  3493. value: string;
  3494. sourceSpan: ParseSourceSpan;
  3495. readonly keySpan: ParseSourceSpan;
  3496. valueSpan?: ParseSourceSpan | undefined;
  3497. constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan, valueSpan?: ParseSourceSpan | undefined);
  3498. visit<Result>(visitor: Visitor<Result>): Result;
  3499. }
  3500. declare class Reference implements Node {
  3501. name: string;
  3502. value: string;
  3503. sourceSpan: ParseSourceSpan;
  3504. readonly keySpan: ParseSourceSpan;
  3505. valueSpan?: ParseSourceSpan | undefined;
  3506. constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan, valueSpan?: ParseSourceSpan | undefined);
  3507. visit<Result>(visitor: Visitor<Result>): Result;
  3508. }
  3509. declare class Icu implements Node {
  3510. vars: {
  3511. [name: string]: BoundText;
  3512. };
  3513. placeholders: {
  3514. [name: string]: Text | BoundText;
  3515. };
  3516. sourceSpan: ParseSourceSpan;
  3517. i18n?: I18nMeta$1 | undefined;
  3518. constructor(vars: {
  3519. [name: string]: BoundText;
  3520. }, placeholders: {
  3521. [name: string]: Text | BoundText;
  3522. }, sourceSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined);
  3523. visit<Result>(visitor: Visitor<Result>): Result;
  3524. }
  3525. interface Visitor<Result = any> {
  3526. visit?(node: Node): Result;
  3527. visitElement(element: Element): Result;
  3528. visitTemplate(template: Template): Result;
  3529. visitContent(content: Content): Result;
  3530. visitVariable(variable: Variable): Result;
  3531. visitReference(reference: Reference): Result;
  3532. visitTextAttribute(attribute: TextAttribute): Result;
  3533. visitBoundAttribute(attribute: BoundAttribute): Result;
  3534. visitBoundEvent(attribute: BoundEvent): Result;
  3535. visitText(text: Text): Result;
  3536. visitBoundText(text: BoundText): Result;
  3537. visitIcu(icu: Icu): Result;
  3538. visitDeferredBlock(deferred: DeferredBlock): Result;
  3539. visitDeferredBlockPlaceholder(block: DeferredBlockPlaceholder): Result;
  3540. visitDeferredBlockError(block: DeferredBlockError): Result;
  3541. visitDeferredBlockLoading(block: DeferredBlockLoading): Result;
  3542. visitDeferredTrigger(trigger: DeferredTrigger): Result;
  3543. visitSwitchBlock(block: SwitchBlock): Result;
  3544. visitSwitchBlockCase(block: SwitchBlockCase): Result;
  3545. visitForLoopBlock(block: ForLoopBlock): Result;
  3546. visitForLoopBlockEmpty(block: ForLoopBlockEmpty): Result;
  3547. visitIfBlock(block: IfBlock): Result;
  3548. visitIfBlockBranch(block: IfBlockBranch): Result;
  3549. visitUnknownBlock(block: UnknownBlock): Result;
  3550. visitLetDeclaration(decl: LetDeclaration): Result;
  3551. }
  3552. declare class RecursiveVisitor implements Visitor<void> {
  3553. visitElement(element: Element): void;
  3554. visitTemplate(template: Template): void;
  3555. visitDeferredBlock(deferred: DeferredBlock): void;
  3556. visitDeferredBlockPlaceholder(block: DeferredBlockPlaceholder): void;
  3557. visitDeferredBlockError(block: DeferredBlockError): void;
  3558. visitDeferredBlockLoading(block: DeferredBlockLoading): void;
  3559. visitSwitchBlock(block: SwitchBlock): void;
  3560. visitSwitchBlockCase(block: SwitchBlockCase): void;
  3561. visitForLoopBlock(block: ForLoopBlock): void;
  3562. visitForLoopBlockEmpty(block: ForLoopBlockEmpty): void;
  3563. visitIfBlock(block: IfBlock): void;
  3564. visitIfBlockBranch(block: IfBlockBranch): void;
  3565. visitContent(content: Content): void;
  3566. visitVariable(variable: Variable): void;
  3567. visitReference(reference: Reference): void;
  3568. visitTextAttribute(attribute: TextAttribute): void;
  3569. visitBoundAttribute(attribute: BoundAttribute): void;
  3570. visitBoundEvent(attribute: BoundEvent): void;
  3571. visitText(text: Text): void;
  3572. visitBoundText(text: BoundText): void;
  3573. visitIcu(icu: Icu): void;
  3574. visitDeferredTrigger(trigger: DeferredTrigger): void;
  3575. visitUnknownBlock(block: UnknownBlock): void;
  3576. visitLetDeclaration(decl: LetDeclaration): void;
  3577. }
  3578. declare function visitAll<Result>(visitor: Visitor<Result>, nodes: Node[]): Result[];
  3579. /**
  3580. * Information needed to compile a directive for the render3 runtime.
  3581. */
  3582. interface R3DirectiveMetadata {
  3583. /**
  3584. * Name of the directive type.
  3585. */
  3586. name: string;
  3587. /**
  3588. * An expression representing a reference to the directive itself.
  3589. */
  3590. type: R3Reference;
  3591. /**
  3592. * Number of generic type parameters of the type itself.
  3593. */
  3594. typeArgumentCount: number;
  3595. /**
  3596. * A source span for the directive type.
  3597. */
  3598. typeSourceSpan: ParseSourceSpan;
  3599. /**
  3600. * Dependencies of the directive's constructor.
  3601. */
  3602. deps: R3DependencyMetadata[] | 'invalid' | null;
  3603. /**
  3604. * Unparsed selector of the directive, or `null` if there was no selector.
  3605. */
  3606. selector: string | null;
  3607. /**
  3608. * Information about the content queries made by the directive.
  3609. */
  3610. queries: R3QueryMetadata[];
  3611. /**
  3612. * Information about the view queries made by the directive.
  3613. */
  3614. viewQueries: R3QueryMetadata[];
  3615. /**
  3616. * Mappings indicating how the directive interacts with its host element (host bindings,
  3617. * listeners, etc).
  3618. */
  3619. host: R3HostMetadata;
  3620. /**
  3621. * Information about usage of specific lifecycle events which require special treatment in the
  3622. * code generator.
  3623. */
  3624. lifecycle: {
  3625. /**
  3626. * Whether the directive uses NgOnChanges.
  3627. */
  3628. usesOnChanges: boolean;
  3629. };
  3630. /**
  3631. * A mapping of inputs from class property names to binding property names, or to a tuple of
  3632. * binding property name and class property name if the names are different.
  3633. */
  3634. inputs: {
  3635. [field: string]: R3InputMetadata;
  3636. };
  3637. /**
  3638. * A mapping of outputs from class property names to binding property names, or to a tuple of
  3639. * binding property name and class property name if the names are different.
  3640. */
  3641. outputs: {
  3642. [field: string]: string;
  3643. };
  3644. /**
  3645. * Whether or not the component or directive inherits from another class
  3646. */
  3647. usesInheritance: boolean;
  3648. /**
  3649. * Whether or not the component or directive inherits its entire decorator from its base class.
  3650. */
  3651. fullInheritance: boolean;
  3652. /**
  3653. * Reference name under which to export the directive's type in a template,
  3654. * if any.
  3655. */
  3656. exportAs: string[] | null;
  3657. /**
  3658. * The list of providers defined in the directive.
  3659. */
  3660. providers: Expression | null;
  3661. /**
  3662. * Whether or not the component or directive is standalone.
  3663. */
  3664. isStandalone: boolean;
  3665. /**
  3666. * Whether or not the component or directive is signal-based.
  3667. */
  3668. isSignal: boolean;
  3669. /**
  3670. * Additional directives applied to the directive host.
  3671. */
  3672. hostDirectives: R3HostDirectiveMetadata[] | null;
  3673. }
  3674. /**
  3675. * Defines how dynamic imports for deferred dependencies should be emitted in the
  3676. * generated output:
  3677. * - either in a function on per-component basis (in case of local compilation)
  3678. * - or in a function on per-block basis (in full compilation mode)
  3679. */
  3680. declare const enum DeferBlockDepsEmitMode {
  3681. /**
  3682. * Dynamic imports are grouped on per-block basis.
  3683. *
  3684. * This is used in full compilation mode, when compiler has more information
  3685. * about particular dependencies that belong to this block.
  3686. */
  3687. PerBlock = 0,
  3688. /**
  3689. * Dynamic imports are grouped on per-component basis.
  3690. *
  3691. * In local compilation, compiler doesn't have enough information to determine
  3692. * which deferred dependencies belong to which block. In this case we group all
  3693. * dynamic imports into a single file on per-component basis.
  3694. */
  3695. PerComponent = 1
  3696. }
  3697. /**
  3698. * Specifies how a list of declaration type references should be emitted into the generated code.
  3699. */
  3700. declare const enum DeclarationListEmitMode {
  3701. /**
  3702. * The list of declarations is emitted into the generated code as is.
  3703. *
  3704. * ```ts
  3705. * directives: [MyDir],
  3706. * ```
  3707. */
  3708. Direct = 0,
  3709. /**
  3710. * The list of declarations is emitted into the generated code wrapped inside a closure, which
  3711. * is needed when at least one declaration is a forward reference.
  3712. *
  3713. * ```ts
  3714. * directives: function () { return [MyDir, ForwardDir]; },
  3715. * ```
  3716. */
  3717. Closure = 1,
  3718. /**
  3719. * Similar to `Closure`, with the addition that the list of declarations can contain individual
  3720. * items that are themselves forward references. This is relevant for JIT compilations, as
  3721. * unwrapping the forwardRef cannot be done statically so must be deferred. This mode emits
  3722. * the declaration list using a mapping transform through `resolveForwardRef` to ensure that
  3723. * any forward references within the list are resolved when the outer closure is invoked.
  3724. *
  3725. * Consider the case where the runtime has captured two declarations in two distinct values:
  3726. * ```ts
  3727. * const dirA = MyDir;
  3728. * const dirB = forwardRef(function() { return ForwardRef; });
  3729. * ```
  3730. *
  3731. * This mode would emit the declarations captured in `dirA` and `dirB` as follows:
  3732. * ```ts
  3733. * directives: function () { return [dirA, dirB].map(ng.resolveForwardRef); },
  3734. * ```
  3735. */
  3736. ClosureResolved = 2,
  3737. RuntimeResolved = 3
  3738. }
  3739. /**
  3740. * Information needed to compile a component for the render3 runtime.
  3741. */
  3742. interface R3ComponentMetadata<DeclarationT extends R3TemplateDependency> extends R3DirectiveMetadata {
  3743. /**
  3744. * Information about the component's template.
  3745. */
  3746. template: {
  3747. /**
  3748. * Parsed nodes of the template.
  3749. */
  3750. nodes: Node[];
  3751. /**
  3752. * Any ng-content selectors extracted from the template. Contains `*` when an ng-content
  3753. * element without selector is present.
  3754. */
  3755. ngContentSelectors: string[];
  3756. /**
  3757. * Whether the template preserves whitespaces from the user's code.
  3758. */
  3759. preserveWhitespaces?: boolean;
  3760. };
  3761. declarations: DeclarationT[];
  3762. /** Metadata related to the deferred blocks in the component's template. */
  3763. defer: R3ComponentDeferMetadata;
  3764. /**
  3765. * Specifies how the 'directives' and/or `pipes` array, if generated, need to be emitted.
  3766. */
  3767. declarationListEmitMode: DeclarationListEmitMode;
  3768. /**
  3769. * A collection of styling data that will be applied and scoped to the component.
  3770. */
  3771. styles: string[];
  3772. /**
  3773. * A collection of style paths for external stylesheets that will be applied and scoped to the component.
  3774. */
  3775. externalStyles?: string[];
  3776. /**
  3777. * An encapsulation policy for the component's styling.
  3778. * Possible values:
  3779. * - `ViewEncapsulation.Emulated`: Apply modified component styles in order to emulate
  3780. * a native Shadow DOM CSS encapsulation behavior.
  3781. * - `ViewEncapsulation.None`: Apply component styles globally without any sort of encapsulation.
  3782. * - `ViewEncapsulation.ShadowDom`: Use the browser's native Shadow DOM API to encapsulate styles.
  3783. */
  3784. encapsulation: ViewEncapsulation;
  3785. /**
  3786. * A collection of animation triggers that will be used in the component template.
  3787. */
  3788. animations: Expression | null;
  3789. /**
  3790. * The list of view providers defined in the component.
  3791. */
  3792. viewProviders: Expression | null;
  3793. /**
  3794. * Path to the .ts file in which this template's generated code will be included, relative to
  3795. * the compilation root. This will be used to generate identifiers that need to be globally
  3796. * unique in certain contexts (such as g3).
  3797. */
  3798. relativeContextFilePath: string;
  3799. /**
  3800. * Whether translation variable name should contain external message id
  3801. * (used by Closure Compiler's output of `goog.getMsg` for transition period).
  3802. */
  3803. i18nUseExternalIds: boolean;
  3804. /**
  3805. * Overrides the default interpolation start and end delimiters ({{ and }}).
  3806. */
  3807. interpolation: InterpolationConfig;
  3808. /**
  3809. * Strategy used for detecting changes in the component.
  3810. *
  3811. * In global compilation mode the value is ChangeDetectionStrategy if available as it is
  3812. * statically resolved during analysis phase. Whereas in local compilation mode the value is the
  3813. * expression as appears in the decorator.
  3814. */
  3815. changeDetection: ChangeDetectionStrategy | Expression | null;
  3816. /**
  3817. * Relative path to the component's template from the root of the project.
  3818. * Used to generate debugging information.
  3819. */
  3820. relativeTemplatePath: string | null;
  3821. /**
  3822. * The imports expression as appears on the component decorate for standalone component. This
  3823. * field is currently needed only for local compilation, and so in other compilation modes it may
  3824. * not be set. If component has empty array imports then this field is not set.
  3825. */
  3826. rawImports?: Expression;
  3827. }
  3828. /**
  3829. * Information about the deferred blocks in a component's template.
  3830. */
  3831. type R3ComponentDeferMetadata = {
  3832. mode: DeferBlockDepsEmitMode.PerBlock;
  3833. blocks: Map<DeferredBlock, Expression | null>;
  3834. } | {
  3835. mode: DeferBlockDepsEmitMode.PerComponent;
  3836. dependenciesFn: Expression | null;
  3837. };
  3838. /**
  3839. * Metadata for an individual input on a directive.
  3840. */
  3841. interface R3InputMetadata {
  3842. classPropertyName: string;
  3843. bindingPropertyName: string;
  3844. required: boolean;
  3845. isSignal: boolean;
  3846. /**
  3847. * Transform function for the input.
  3848. *
  3849. * Null if there is no transform, or if this is a signal input.
  3850. * Signal inputs capture their transform as part of the `InputSignal`.
  3851. */
  3852. transformFunction: Expression | null;
  3853. }
  3854. declare enum R3TemplateDependencyKind {
  3855. Directive = 0,
  3856. Pipe = 1,
  3857. NgModule = 2
  3858. }
  3859. /**
  3860. * A dependency that's used within a component template.
  3861. */
  3862. interface R3TemplateDependency {
  3863. kind: R3TemplateDependencyKind;
  3864. /**
  3865. * The type of the dependency as an expression.
  3866. */
  3867. type: Expression;
  3868. }
  3869. /**
  3870. * A dependency that's used within a component template
  3871. */
  3872. type R3TemplateDependencyMetadata = R3DirectiveDependencyMetadata | R3PipeDependencyMetadata | R3NgModuleDependencyMetadata;
  3873. /**
  3874. * Information about a directive that is used in a component template. Only the stable, public
  3875. * facing information of the directive is stored here.
  3876. */
  3877. interface R3DirectiveDependencyMetadata extends R3TemplateDependency {
  3878. kind: R3TemplateDependencyKind.Directive;
  3879. /**
  3880. * The selector of the directive.
  3881. */
  3882. selector: string;
  3883. /**
  3884. * The binding property names of the inputs of the directive.
  3885. */
  3886. inputs: string[];
  3887. /**
  3888. * The binding property names of the outputs of the directive.
  3889. */
  3890. outputs: string[];
  3891. /**
  3892. * Name under which the directive is exported, if any (exportAs in Angular). Null otherwise.
  3893. */
  3894. exportAs: string[] | null;
  3895. /**
  3896. * If true then this directive is actually a component; otherwise it is not.
  3897. */
  3898. isComponent: boolean;
  3899. }
  3900. interface R3PipeDependencyMetadata extends R3TemplateDependency {
  3901. kind: R3TemplateDependencyKind.Pipe;
  3902. name: string;
  3903. }
  3904. interface R3NgModuleDependencyMetadata extends R3TemplateDependency {
  3905. kind: R3TemplateDependencyKind.NgModule;
  3906. }
  3907. /**
  3908. * Information needed to compile a query (view or content).
  3909. */
  3910. interface R3QueryMetadata {
  3911. /**
  3912. * Name of the property on the class to update with query results.
  3913. */
  3914. propertyName: string;
  3915. /**
  3916. * Whether to read only the first matching result, or an array of results.
  3917. */
  3918. first: boolean;
  3919. /**
  3920. * Either an expression representing a type or `InjectionToken` for the query
  3921. * predicate, or a set of string selectors.
  3922. *
  3923. * Note: At compile time we split selectors as an optimization that avoids this
  3924. * extra work at runtime creation phase.
  3925. *
  3926. * Notably, if the selector is not statically analyzable due to an expression,
  3927. * the selectors may need to be split up at runtime.
  3928. */
  3929. predicate: MaybeForwardRefExpression | string[];
  3930. /**
  3931. * Whether to include only direct children or all descendants.
  3932. */
  3933. descendants: boolean;
  3934. /**
  3935. * If the `QueryList` should fire change event only if actual change to query was computed (vs old
  3936. * behavior where the change was fired whenever the query was recomputed, even if the recomputed
  3937. * query resulted in the same list.)
  3938. */
  3939. emitDistinctChangesOnly: boolean;
  3940. /**
  3941. * An expression representing a type to read from each matched node, or null if the default value
  3942. * for a given node is to be returned.
  3943. */
  3944. read: Expression | null;
  3945. /**
  3946. * Whether or not this query should collect only static results.
  3947. *
  3948. * If static is true, the query's results will be set on the component after nodes are created,
  3949. * but before change detection runs. This means that any results that relied upon change detection
  3950. * to run (e.g. results inside *ngIf or *ngFor views) will not be collected. Query results are
  3951. * available in the ngOnInit hook.
  3952. *
  3953. * If static is false, the query's results will be set on the component after change detection
  3954. * runs. This means that the query results can contain nodes inside *ngIf or *ngFor views, but
  3955. * the results will not be available in the ngOnInit hook (only in the ngAfterContentInit for
  3956. * content hooks and ngAfterViewInit for view hooks).
  3957. *
  3958. * Note: For signal-based queries, this option does not have any effect.
  3959. */
  3960. static: boolean;
  3961. /** Whether the query is signal-based. */
  3962. isSignal: boolean;
  3963. }
  3964. /**
  3965. * Mappings indicating how the class interacts with its
  3966. * host element (host bindings, listeners, etc).
  3967. */
  3968. interface R3HostMetadata {
  3969. /**
  3970. * A mapping of attribute binding keys to `o.Expression`s.
  3971. */
  3972. attributes: {
  3973. [key: string]: Expression;
  3974. };
  3975. /**
  3976. * A mapping of event binding keys to unparsed expressions.
  3977. */
  3978. listeners: {
  3979. [key: string]: string;
  3980. };
  3981. /**
  3982. * A mapping of property binding keys to unparsed expressions.
  3983. */
  3984. properties: {
  3985. [key: string]: string;
  3986. };
  3987. specialAttributes: {
  3988. styleAttr?: string;
  3989. classAttr?: string;
  3990. };
  3991. }
  3992. /**
  3993. * Information needed to compile a host directive for the render3 runtime.
  3994. */
  3995. interface R3HostDirectiveMetadata {
  3996. /** An expression representing the host directive class itself. */
  3997. directive: R3Reference;
  3998. /** Whether the expression referring to the host directive is a forward reference. */
  3999. isForwardReference: boolean;
  4000. /** Inputs from the host directive that will be exposed on the host. */
  4001. inputs: {
  4002. [publicName: string]: string;
  4003. } | null;
  4004. /** Outputs from the host directive that will be exposed on the host. */
  4005. outputs: {
  4006. [publicName: string]: string;
  4007. } | null;
  4008. }
  4009. /**
  4010. * Information needed to compile the defer block resolver function.
  4011. */
  4012. type R3DeferResolverFunctionMetadata = {
  4013. mode: DeferBlockDepsEmitMode.PerBlock;
  4014. dependencies: R3DeferPerBlockDependency[];
  4015. } | {
  4016. mode: DeferBlockDepsEmitMode.PerComponent;
  4017. dependencies: R3DeferPerComponentDependency[];
  4018. };
  4019. /**
  4020. * Information about a single dependency of a defer block in `PerBlock` mode.
  4021. */
  4022. interface R3DeferPerBlockDependency {
  4023. /**
  4024. * Reference to a dependency.
  4025. */
  4026. typeReference: Expression;
  4027. /**
  4028. * Dependency class name.
  4029. */
  4030. symbolName: string;
  4031. /**
  4032. * Whether this dependency can be defer-loaded.
  4033. */
  4034. isDeferrable: boolean;
  4035. /**
  4036. * Import path where this dependency is located.
  4037. */
  4038. importPath: string | null;
  4039. /**
  4040. * Whether the symbol is the default export.
  4041. */
  4042. isDefaultImport: boolean;
  4043. }
  4044. /**
  4045. * Information about a single dependency of a defer block in `PerComponent` mode.
  4046. */
  4047. interface R3DeferPerComponentDependency {
  4048. /**
  4049. * Dependency class name.
  4050. */
  4051. symbolName: string;
  4052. /**
  4053. * Import path where this dependency is located.
  4054. */
  4055. importPath: string;
  4056. /**
  4057. * Whether the symbol is the default export.
  4058. */
  4059. isDefaultImport: boolean;
  4060. }
  4061. /** Node that has a `Scope` associated with it. */
  4062. type ScopedNode = Template | SwitchBlockCase | IfBlockBranch | ForLoopBlock | ForLoopBlockEmpty | DeferredBlock | DeferredBlockError | DeferredBlockLoading | DeferredBlockPlaceholder | Content;
  4063. /** Possible values that a reference can be resolved to. */
  4064. type ReferenceTarget<DirectiveT> = {
  4065. directive: DirectiveT;
  4066. node: Element | Template;
  4067. } | Element | Template;
  4068. /** Entity that is local to the template and defined within the template. */
  4069. type TemplateEntity = Reference | Variable | LetDeclaration;
  4070. /**
  4071. * A logical target for analysis, which could contain a template or other types of bindings.
  4072. */
  4073. interface Target {
  4074. template?: Node[];
  4075. }
  4076. /**
  4077. * A data structure which can indicate whether a given property name is present or not.
  4078. *
  4079. * This is used to represent the set of inputs or outputs present on a directive, and allows the
  4080. * binder to query for the presence of a mapping for property names.
  4081. */
  4082. interface InputOutputPropertySet {
  4083. hasBindingPropertyName(propertyName: string): boolean;
  4084. }
  4085. /**
  4086. * A data structure which captures the animation trigger names that are statically resolvable
  4087. * and whether some names could not be statically evaluated.
  4088. */
  4089. interface AnimationTriggerNames {
  4090. includesDynamicAnimations: boolean;
  4091. staticTriggerNames: string[];
  4092. }
  4093. /**
  4094. * Metadata regarding a directive that's needed to match it against template elements. This is
  4095. * provided by a consumer of the t2 APIs.
  4096. */
  4097. interface DirectiveMeta {
  4098. /**
  4099. * Name of the directive class (used for debugging).
  4100. */
  4101. name: string;
  4102. /** The selector for the directive or `null` if there isn't one. */
  4103. selector: string | null;
  4104. /**
  4105. * Whether the directive is a component.
  4106. */
  4107. isComponent: boolean;
  4108. /**
  4109. * Set of inputs which this directive claims.
  4110. *
  4111. * Goes from property names to field names.
  4112. */
  4113. inputs: InputOutputPropertySet;
  4114. /**
  4115. * Set of outputs which this directive claims.
  4116. *
  4117. * Goes from property names to field names.
  4118. */
  4119. outputs: InputOutputPropertySet;
  4120. /**
  4121. * Name under which the directive is exported, if any (exportAs in Angular).
  4122. *
  4123. * Null otherwise
  4124. */
  4125. exportAs: string[] | null;
  4126. /**
  4127. * Whether the directive is a structural directive (e.g. `<div *ngIf></div>`).
  4128. */
  4129. isStructural: boolean;
  4130. /**
  4131. * If the directive is a component, includes the selectors of its `ng-content` elements.
  4132. */
  4133. ngContentSelectors: string[] | null;
  4134. /**
  4135. * Whether the template of the component preserves whitespaces.
  4136. */
  4137. preserveWhitespaces: boolean;
  4138. /**
  4139. * The name of animations that the user defines in the component.
  4140. * Only includes the animation names.
  4141. */
  4142. animationTriggerNames: AnimationTriggerNames | null;
  4143. }
  4144. /**
  4145. * Interface to the binding API, which processes a template and returns an object similar to the
  4146. * `ts.TypeChecker`.
  4147. *
  4148. * The returned `BoundTarget` has an API for extracting information about the processed target.
  4149. */
  4150. interface TargetBinder<D extends DirectiveMeta> {
  4151. bind(target: Target): BoundTarget<D>;
  4152. }
  4153. /**
  4154. * Result of performing the binding operation against a `Target`.
  4155. *
  4156. * The original `Target` is accessible, as well as a suite of methods for extracting binding
  4157. * information regarding the `Target`.
  4158. *
  4159. * @param DirectiveT directive metadata type
  4160. */
  4161. interface BoundTarget<DirectiveT extends DirectiveMeta> {
  4162. /**
  4163. * Get the original `Target` that was bound.
  4164. */
  4165. readonly target: Target;
  4166. /**
  4167. * For a given template node (either an `Element` or a `Template`), get the set of directives
  4168. * which matched the node, if any.
  4169. */
  4170. getDirectivesOfNode(node: Element | Template): DirectiveT[] | null;
  4171. /**
  4172. * For a given `Reference`, get the reference's target - either an `Element`, a `Template`, or
  4173. * a directive on a particular node.
  4174. */
  4175. getReferenceTarget(ref: Reference): ReferenceTarget<DirectiveT> | null;
  4176. /**
  4177. * For a given binding, get the entity to which the binding is being made.
  4178. *
  4179. * This will either be a directive or the node itself.
  4180. */
  4181. getConsumerOfBinding(binding: BoundAttribute | BoundEvent | TextAttribute): DirectiveT | Element | Template | null;
  4182. /**
  4183. * If the given `AST` expression refers to a `Reference` or `Variable` within the `Target`, then
  4184. * return that.
  4185. *
  4186. * Otherwise, returns `null`.
  4187. *
  4188. * This is only defined for `AST` expressions that read or write to a property of an
  4189. * `ImplicitReceiver`.
  4190. */
  4191. getExpressionTarget(expr: AST): TemplateEntity | null;
  4192. /**
  4193. * Given a particular `Reference` or `Variable`, get the `ScopedNode` which created it.
  4194. *
  4195. * All `Variable`s are defined on node, so this will always return a value for a `Variable`
  4196. * from the `Target`. Returns `null` otherwise.
  4197. */
  4198. getDefinitionNodeOfSymbol(symbol: TemplateEntity): ScopedNode | null;
  4199. /**
  4200. * Get the nesting level of a particular `ScopedNode`.
  4201. *
  4202. * This starts at 1 for top-level nodes within the `Target` and increases for nodes
  4203. * nested at deeper levels.
  4204. */
  4205. getNestingLevel(node: ScopedNode): number;
  4206. /**
  4207. * Get all `Reference`s and `Variables` visible within the given `ScopedNode` (or at the top
  4208. * level, if `null` is passed).
  4209. */
  4210. getEntitiesInScope(node: ScopedNode | null): ReadonlySet<TemplateEntity>;
  4211. /**
  4212. * Get a list of all the directives used by the target,
  4213. * including directives from `@defer` blocks.
  4214. */
  4215. getUsedDirectives(): DirectiveT[];
  4216. /**
  4217. * Get a list of eagerly used directives from the target.
  4218. * Note: this list *excludes* directives from `@defer` blocks.
  4219. */
  4220. getEagerlyUsedDirectives(): DirectiveT[];
  4221. /**
  4222. * Get a list of all the pipes used by the target,
  4223. * including pipes from `@defer` blocks.
  4224. */
  4225. getUsedPipes(): string[];
  4226. /**
  4227. * Get a list of eagerly used pipes from the target.
  4228. * Note: this list *excludes* pipes from `@defer` blocks.
  4229. */
  4230. getEagerlyUsedPipes(): string[];
  4231. /**
  4232. * Get a list of all `@defer` blocks used by the target.
  4233. */
  4234. getDeferBlocks(): DeferredBlock[];
  4235. /**
  4236. * Gets the element that a specific deferred block trigger is targeting.
  4237. * @param block Block that the trigger belongs to.
  4238. * @param trigger Trigger whose target is being looked up.
  4239. */
  4240. getDeferredTriggerTarget(block: DeferredBlock, trigger: DeferredTrigger): Element | null;
  4241. /**
  4242. * Whether a given node is located in a `@defer` block.
  4243. */
  4244. isDeferred(node: Element): boolean;
  4245. }
  4246. /** Shorthand for a map between a binding AST node and the entity it's targeting. */
  4247. type BindingsMap<DirectiveT> = Map<BoundAttribute | BoundEvent | TextAttribute, DirectiveT | Template | Element>;
  4248. /** Shorthand for a map between a reference AST node and the entity it's targeting. */
  4249. type ReferenceMap<DirectiveT> = Map<Reference, Template | Element | {
  4250. directive: DirectiveT;
  4251. node: Element | Template;
  4252. }>;
  4253. /** Mapping between AST nodes and the directives that have been matched on them. */
  4254. type MatchedDirectives<DirectiveT> = Map<Template | Element, DirectiveT[]>;
  4255. /**
  4256. * Mapping between a scoped not and the template entities that exist in it.
  4257. * `null` represents the root scope.
  4258. */
  4259. type ScopedNodeEntities = Map<ScopedNode | null, Set<TemplateEntity>>;
  4260. /** Shorthand tuple type where a defer block is paired with its corresponding scope. */
  4261. type DeferBlockScopes = [DeferredBlock, Scope][];
  4262. /**
  4263. * Given a template string and a set of available directive selectors,
  4264. * computes a list of matching selectors and splits them into 2 buckets:
  4265. * (1) eagerly used in a template and (2) directives used only in defer
  4266. * blocks. Similarly, returns 2 lists of pipes (eager and deferrable).
  4267. *
  4268. * Note: deferrable directives selectors and pipes names used in `@defer`
  4269. * blocks are **candidates** and API caller should make sure that:
  4270. *
  4271. * * A Component where a given template is defined is standalone
  4272. * * Underlying dependency classes are also standalone
  4273. * * Dependency class symbols are not eagerly used in a TS file
  4274. * where a host component (that owns the template) is located
  4275. */
  4276. declare function findMatchingDirectivesAndPipes(template: string, directiveSelectors: string[]): {
  4277. directives: {
  4278. regular: string[];
  4279. deferCandidates: string[];
  4280. };
  4281. pipes: {
  4282. regular: string[];
  4283. deferCandidates: string[];
  4284. };
  4285. };
  4286. /**
  4287. * Processes `Target`s with a given set of directives and performs a binding operation, which
  4288. * returns an object similar to TypeScript's `ts.TypeChecker` that contains knowledge about the
  4289. * target.
  4290. */
  4291. declare class R3TargetBinder<DirectiveT extends DirectiveMeta> implements TargetBinder<DirectiveT> {
  4292. private directiveMatcher;
  4293. constructor(directiveMatcher: SelectorMatcher<DirectiveT[]>);
  4294. /**
  4295. * Perform a binding operation on the given `Target` and return a `BoundTarget` which contains
  4296. * metadata about the types referenced in the template.
  4297. */
  4298. bind(target: Target): BoundTarget<DirectiveT>;
  4299. }
  4300. /**
  4301. * Represents a binding scope within a template.
  4302. *
  4303. * Any variables, references, or other named entities declared within the template will
  4304. * be captured and available by name in `namedEntities`. Additionally, child templates will
  4305. * be analyzed and have their child `Scope`s available in `childScopes`.
  4306. */
  4307. declare class Scope implements Visitor {
  4308. readonly parentScope: Scope | null;
  4309. readonly rootNode: ScopedNode | null;
  4310. /**
  4311. * Named members of the `Scope`, such as `Reference`s or `Variable`s.
  4312. */
  4313. readonly namedEntities: Map<string, TemplateEntity>;
  4314. /**
  4315. * Set of elements that belong to this scope.
  4316. */
  4317. readonly elementsInScope: Set<Element>;
  4318. /**
  4319. * Child `Scope`s for immediately nested `ScopedNode`s.
  4320. */
  4321. readonly childScopes: Map<ScopedNode, Scope>;
  4322. /** Whether this scope is deferred or if any of its ancestors are deferred. */
  4323. readonly isDeferred: boolean;
  4324. private constructor();
  4325. static newRootScope(): Scope;
  4326. /**
  4327. * Process a template (either as a `Template` sub-template with variables, or a plain array of
  4328. * template `Node`s) and construct its `Scope`.
  4329. */
  4330. static apply(template: Node[]): Scope;
  4331. /**
  4332. * Internal method to process the scoped node and populate the `Scope`.
  4333. */
  4334. private ingest;
  4335. visitElement(element: Element): void;
  4336. visitTemplate(template: Template): void;
  4337. visitVariable(variable: Variable): void;
  4338. visitReference(reference: Reference): void;
  4339. visitDeferredBlock(deferred: DeferredBlock): void;
  4340. visitDeferredBlockPlaceholder(block: DeferredBlockPlaceholder): void;
  4341. visitDeferredBlockError(block: DeferredBlockError): void;
  4342. visitDeferredBlockLoading(block: DeferredBlockLoading): void;
  4343. visitSwitchBlock(block: SwitchBlock): void;
  4344. visitSwitchBlockCase(block: SwitchBlockCase): void;
  4345. visitForLoopBlock(block: ForLoopBlock): void;
  4346. visitForLoopBlockEmpty(block: ForLoopBlockEmpty): void;
  4347. visitIfBlock(block: IfBlock): void;
  4348. visitIfBlockBranch(block: IfBlockBranch): void;
  4349. visitContent(content: Content): void;
  4350. visitLetDeclaration(decl: LetDeclaration): void;
  4351. visitBoundAttribute(attr: BoundAttribute): void;
  4352. visitBoundEvent(event: BoundEvent): void;
  4353. visitBoundText(text: BoundText): void;
  4354. visitText(text: Text): void;
  4355. visitTextAttribute(attr: TextAttribute): void;
  4356. visitIcu(icu: Icu): void;
  4357. visitDeferredTrigger(trigger: DeferredTrigger): void;
  4358. visitUnknownBlock(block: UnknownBlock): void;
  4359. private maybeDeclare;
  4360. /**
  4361. * Look up a variable within this `Scope`.
  4362. *
  4363. * This can recurse into a parent `Scope` if it's available.
  4364. */
  4365. lookup(name: string): TemplateEntity | null;
  4366. /**
  4367. * Get the child scope for a `ScopedNode`.
  4368. *
  4369. * This should always be defined.
  4370. */
  4371. getChildScope(node: ScopedNode): Scope;
  4372. private ingestScopedNode;
  4373. }
  4374. /**
  4375. * Metadata container for a `Target` that allows queries for specific bits of metadata.
  4376. *
  4377. * See `BoundTarget` for documentation on the individual methods.
  4378. */
  4379. declare class R3BoundTarget<DirectiveT extends DirectiveMeta> implements BoundTarget<DirectiveT> {
  4380. readonly target: Target;
  4381. private directives;
  4382. private eagerDirectives;
  4383. private bindings;
  4384. private references;
  4385. private exprTargets;
  4386. private symbols;
  4387. private nestingLevel;
  4388. private scopedNodeEntities;
  4389. private usedPipes;
  4390. private eagerPipes;
  4391. /** Deferred blocks, ordered as they appear in the template. */
  4392. private deferredBlocks;
  4393. /** Map of deferred blocks to their scope. */
  4394. private deferredScopes;
  4395. constructor(target: Target, directives: MatchedDirectives<DirectiveT>, eagerDirectives: DirectiveT[], bindings: BindingsMap<DirectiveT>, references: ReferenceMap<DirectiveT>, exprTargets: Map<AST, TemplateEntity>, symbols: Map<TemplateEntity, Template>, nestingLevel: Map<ScopedNode, number>, scopedNodeEntities: ScopedNodeEntities, usedPipes: Set<string>, eagerPipes: Set<string>, rawDeferred: DeferBlockScopes);
  4396. getEntitiesInScope(node: ScopedNode | null): ReadonlySet<TemplateEntity>;
  4397. getDirectivesOfNode(node: Element | Template): DirectiveT[] | null;
  4398. getReferenceTarget(ref: Reference): ReferenceTarget<DirectiveT> | null;
  4399. getConsumerOfBinding(binding: BoundAttribute | BoundEvent | TextAttribute): DirectiveT | Element | Template | null;
  4400. getExpressionTarget(expr: AST): TemplateEntity | null;
  4401. getDefinitionNodeOfSymbol(symbol: TemplateEntity): ScopedNode | null;
  4402. getNestingLevel(node: ScopedNode): number;
  4403. getUsedDirectives(): DirectiveT[];
  4404. getEagerlyUsedDirectives(): DirectiveT[];
  4405. getUsedPipes(): string[];
  4406. getEagerlyUsedPipes(): string[];
  4407. getDeferBlocks(): DeferredBlock[];
  4408. getDeferredTriggerTarget(block: DeferredBlock, trigger: DeferredTrigger): Element | null;
  4409. isDeferred(element: Element): boolean;
  4410. /**
  4411. * Finds an entity with a specific name in a scope.
  4412. * @param rootNode Root node of the scope.
  4413. * @param name Name of the entity.
  4414. */
  4415. private findEntityInScope;
  4416. /** Coerces a `ReferenceTarget` to an `Element`, if possible. */
  4417. private referenceTargetToElement;
  4418. }
  4419. /**
  4420. * Creates a `CssSelector` from an AST node.
  4421. */
  4422. declare function createCssSelectorFromNode(node: Element | Template): CssSelector;
  4423. declare class Identifiers {
  4424. static NEW_METHOD: string;
  4425. static TRANSFORM_METHOD: string;
  4426. static PATCH_DEPS: string;
  4427. static core: ExternalReference;
  4428. static namespaceHTML: ExternalReference;
  4429. static namespaceMathML: ExternalReference;
  4430. static namespaceSVG: ExternalReference;
  4431. static element: ExternalReference;
  4432. static elementStart: ExternalReference;
  4433. static elementEnd: ExternalReference;
  4434. static advance: ExternalReference;
  4435. static syntheticHostProperty: ExternalReference;
  4436. static syntheticHostListener: ExternalReference;
  4437. static attribute: ExternalReference;
  4438. static attributeInterpolate1: ExternalReference;
  4439. static attributeInterpolate2: ExternalReference;
  4440. static attributeInterpolate3: ExternalReference;
  4441. static attributeInterpolate4: ExternalReference;
  4442. static attributeInterpolate5: ExternalReference;
  4443. static attributeInterpolate6: ExternalReference;
  4444. static attributeInterpolate7: ExternalReference;
  4445. static attributeInterpolate8: ExternalReference;
  4446. static attributeInterpolateV: ExternalReference;
  4447. static classProp: ExternalReference;
  4448. static elementContainerStart: ExternalReference;
  4449. static elementContainerEnd: ExternalReference;
  4450. static elementContainer: ExternalReference;
  4451. static styleMap: ExternalReference;
  4452. static styleMapInterpolate1: ExternalReference;
  4453. static styleMapInterpolate2: ExternalReference;
  4454. static styleMapInterpolate3: ExternalReference;
  4455. static styleMapInterpolate4: ExternalReference;
  4456. static styleMapInterpolate5: ExternalReference;
  4457. static styleMapInterpolate6: ExternalReference;
  4458. static styleMapInterpolate7: ExternalReference;
  4459. static styleMapInterpolate8: ExternalReference;
  4460. static styleMapInterpolateV: ExternalReference;
  4461. static classMap: ExternalReference;
  4462. static classMapInterpolate1: ExternalReference;
  4463. static classMapInterpolate2: ExternalReference;
  4464. static classMapInterpolate3: ExternalReference;
  4465. static classMapInterpolate4: ExternalReference;
  4466. static classMapInterpolate5: ExternalReference;
  4467. static classMapInterpolate6: ExternalReference;
  4468. static classMapInterpolate7: ExternalReference;
  4469. static classMapInterpolate8: ExternalReference;
  4470. static classMapInterpolateV: ExternalReference;
  4471. static styleProp: ExternalReference;
  4472. static stylePropInterpolate1: ExternalReference;
  4473. static stylePropInterpolate2: ExternalReference;
  4474. static stylePropInterpolate3: ExternalReference;
  4475. static stylePropInterpolate4: ExternalReference;
  4476. static stylePropInterpolate5: ExternalReference;
  4477. static stylePropInterpolate6: ExternalReference;
  4478. static stylePropInterpolate7: ExternalReference;
  4479. static stylePropInterpolate8: ExternalReference;
  4480. static stylePropInterpolateV: ExternalReference;
  4481. static nextContext: ExternalReference;
  4482. static resetView: ExternalReference;
  4483. static templateCreate: ExternalReference;
  4484. static defer: ExternalReference;
  4485. static deferWhen: ExternalReference;
  4486. static deferOnIdle: ExternalReference;
  4487. static deferOnImmediate: ExternalReference;
  4488. static deferOnTimer: ExternalReference;
  4489. static deferOnHover: ExternalReference;
  4490. static deferOnInteraction: ExternalReference;
  4491. static deferOnViewport: ExternalReference;
  4492. static deferPrefetchWhen: ExternalReference;
  4493. static deferPrefetchOnIdle: ExternalReference;
  4494. static deferPrefetchOnImmediate: ExternalReference;
  4495. static deferPrefetchOnTimer: ExternalReference;
  4496. static deferPrefetchOnHover: ExternalReference;
  4497. static deferPrefetchOnInteraction: ExternalReference;
  4498. static deferPrefetchOnViewport: ExternalReference;
  4499. static deferHydrateWhen: ExternalReference;
  4500. static deferHydrateNever: ExternalReference;
  4501. static deferHydrateOnIdle: ExternalReference;
  4502. static deferHydrateOnImmediate: ExternalReference;
  4503. static deferHydrateOnTimer: ExternalReference;
  4504. static deferHydrateOnHover: ExternalReference;
  4505. static deferHydrateOnInteraction: ExternalReference;
  4506. static deferHydrateOnViewport: ExternalReference;
  4507. static deferEnableTimerScheduling: ExternalReference;
  4508. static conditional: ExternalReference;
  4509. static repeater: ExternalReference;
  4510. static repeaterCreate: ExternalReference;
  4511. static repeaterTrackByIndex: ExternalReference;
  4512. static repeaterTrackByIdentity: ExternalReference;
  4513. static componentInstance: ExternalReference;
  4514. static text: ExternalReference;
  4515. static enableBindings: ExternalReference;
  4516. static disableBindings: ExternalReference;
  4517. static getCurrentView: ExternalReference;
  4518. static textInterpolate: ExternalReference;
  4519. static textInterpolate1: ExternalReference;
  4520. static textInterpolate2: ExternalReference;
  4521. static textInterpolate3: ExternalReference;
  4522. static textInterpolate4: ExternalReference;
  4523. static textInterpolate5: ExternalReference;
  4524. static textInterpolate6: ExternalReference;
  4525. static textInterpolate7: ExternalReference;
  4526. static textInterpolate8: ExternalReference;
  4527. static textInterpolateV: ExternalReference;
  4528. static restoreView: ExternalReference;
  4529. static pureFunction0: ExternalReference;
  4530. static pureFunction1: ExternalReference;
  4531. static pureFunction2: ExternalReference;
  4532. static pureFunction3: ExternalReference;
  4533. static pureFunction4: ExternalReference;
  4534. static pureFunction5: ExternalReference;
  4535. static pureFunction6: ExternalReference;
  4536. static pureFunction7: ExternalReference;
  4537. static pureFunction8: ExternalReference;
  4538. static pureFunctionV: ExternalReference;
  4539. static pipeBind1: ExternalReference;
  4540. static pipeBind2: ExternalReference;
  4541. static pipeBind3: ExternalReference;
  4542. static pipeBind4: ExternalReference;
  4543. static pipeBindV: ExternalReference;
  4544. static hostProperty: ExternalReference;
  4545. static property: ExternalReference;
  4546. static propertyInterpolate: ExternalReference;
  4547. static propertyInterpolate1: ExternalReference;
  4548. static propertyInterpolate2: ExternalReference;
  4549. static propertyInterpolate3: ExternalReference;
  4550. static propertyInterpolate4: ExternalReference;
  4551. static propertyInterpolate5: ExternalReference;
  4552. static propertyInterpolate6: ExternalReference;
  4553. static propertyInterpolate7: ExternalReference;
  4554. static propertyInterpolate8: ExternalReference;
  4555. static propertyInterpolateV: ExternalReference;
  4556. static i18n: ExternalReference;
  4557. static i18nAttributes: ExternalReference;
  4558. static i18nExp: ExternalReference;
  4559. static i18nStart: ExternalReference;
  4560. static i18nEnd: ExternalReference;
  4561. static i18nApply: ExternalReference;
  4562. static i18nPostprocess: ExternalReference;
  4563. static pipe: ExternalReference;
  4564. static projection: ExternalReference;
  4565. static projectionDef: ExternalReference;
  4566. static reference: ExternalReference;
  4567. static inject: ExternalReference;
  4568. static injectAttribute: ExternalReference;
  4569. static directiveInject: ExternalReference;
  4570. static invalidFactory: ExternalReference;
  4571. static invalidFactoryDep: ExternalReference;
  4572. static templateRefExtractor: ExternalReference;
  4573. static forwardRef: ExternalReference;
  4574. static resolveForwardRef: ExternalReference;
  4575. static replaceMetadata: ExternalReference;
  4576. static ɵɵdefineInjectable: ExternalReference;
  4577. static declareInjectable: ExternalReference;
  4578. static InjectableDeclaration: ExternalReference;
  4579. static resolveWindow: ExternalReference;
  4580. static resolveDocument: ExternalReference;
  4581. static resolveBody: ExternalReference;
  4582. static getComponentDepsFactory: ExternalReference;
  4583. static defineComponent: ExternalReference;
  4584. static declareComponent: ExternalReference;
  4585. static setComponentScope: ExternalReference;
  4586. static ChangeDetectionStrategy: ExternalReference;
  4587. static ViewEncapsulation: ExternalReference;
  4588. static ComponentDeclaration: ExternalReference;
  4589. static FactoryDeclaration: ExternalReference;
  4590. static declareFactory: ExternalReference;
  4591. static FactoryTarget: ExternalReference;
  4592. static defineDirective: ExternalReference;
  4593. static declareDirective: ExternalReference;
  4594. static DirectiveDeclaration: ExternalReference;
  4595. static InjectorDef: ExternalReference;
  4596. static InjectorDeclaration: ExternalReference;
  4597. static defineInjector: ExternalReference;
  4598. static declareInjector: ExternalReference;
  4599. static NgModuleDeclaration: ExternalReference;
  4600. static ModuleWithProviders: ExternalReference;
  4601. static defineNgModule: ExternalReference;
  4602. static declareNgModule: ExternalReference;
  4603. static setNgModuleScope: ExternalReference;
  4604. static registerNgModuleType: ExternalReference;
  4605. static PipeDeclaration: ExternalReference;
  4606. static definePipe: ExternalReference;
  4607. static declarePipe: ExternalReference;
  4608. static declareClassMetadata: ExternalReference;
  4609. static declareClassMetadataAsync: ExternalReference;
  4610. static setClassMetadata: ExternalReference;
  4611. static setClassMetadataAsync: ExternalReference;
  4612. static setClassDebugInfo: ExternalReference;
  4613. static queryRefresh: ExternalReference;
  4614. static viewQuery: ExternalReference;
  4615. static loadQuery: ExternalReference;
  4616. static contentQuery: ExternalReference;
  4617. static viewQuerySignal: ExternalReference;
  4618. static contentQuerySignal: ExternalReference;
  4619. static queryAdvance: ExternalReference;
  4620. static twoWayProperty: ExternalReference;
  4621. static twoWayBindingSet: ExternalReference;
  4622. static twoWayListener: ExternalReference;
  4623. static declareLet: ExternalReference;
  4624. static storeLet: ExternalReference;
  4625. static readContextLet: ExternalReference;
  4626. static attachSourceLocations: ExternalReference;
  4627. static NgOnChangesFeature: ExternalReference;
  4628. static InheritDefinitionFeature: ExternalReference;
  4629. static CopyDefinitionFeature: ExternalReference;
  4630. static ProvidersFeature: ExternalReference;
  4631. static HostDirectivesFeature: ExternalReference;
  4632. static ExternalStylesFeature: ExternalReference;
  4633. static listener: ExternalReference;
  4634. static getInheritedFactory: ExternalReference;
  4635. static sanitizeHtml: ExternalReference;
  4636. static sanitizeStyle: ExternalReference;
  4637. static sanitizeResourceUrl: ExternalReference;
  4638. static sanitizeScript: ExternalReference;
  4639. static sanitizeUrl: ExternalReference;
  4640. static sanitizeUrlOrResourceUrl: ExternalReference;
  4641. static trustConstantHtml: ExternalReference;
  4642. static trustConstantResourceUrl: ExternalReference;
  4643. static validateIframeAttribute: ExternalReference;
  4644. static InputSignalBrandWriteType: {
  4645. name: string;
  4646. moduleName: string;
  4647. };
  4648. static UnwrapDirectiveSignalInputs: {
  4649. name: string;
  4650. moduleName: string;
  4651. };
  4652. static unwrapWritableSignal: {
  4653. name: string;
  4654. moduleName: string;
  4655. };
  4656. }
  4657. type CompileClassMetadataFn = (metadata: R3ClassMetadata) => Expression;
  4658. /**
  4659. * Metadata of a class which captures the original Angular decorators of a class. The original
  4660. * decorators are preserved in the generated code to allow TestBed APIs to recompile the class
  4661. * using the original decorator with a set of overrides applied.
  4662. */
  4663. interface R3ClassMetadata {
  4664. /**
  4665. * The class type for which the metadata is captured.
  4666. */
  4667. type: Expression;
  4668. /**
  4669. * An expression representing the Angular decorators that were applied on the class.
  4670. */
  4671. decorators: Expression;
  4672. /**
  4673. * An expression representing the Angular decorators applied to constructor parameters, or `null`
  4674. * if there is no constructor.
  4675. */
  4676. ctorParameters: Expression | null;
  4677. /**
  4678. * An expression representing the Angular decorators that were applied on the properties of the
  4679. * class, or `null` if no properties have decorators.
  4680. */
  4681. propDecorators: Expression | null;
  4682. }
  4683. declare function compileClassMetadata(metadata: R3ClassMetadata): InvokeFunctionExpr;
  4684. /**
  4685. * Wraps the `setClassMetadata` function with extra logic that dynamically
  4686. * loads dependencies from `@defer` blocks.
  4687. *
  4688. * Generates a call like this:
  4689. * ```ts
  4690. * setClassMetadataAsync(type, () => [
  4691. * import('./cmp-a').then(m => m.CmpA);
  4692. * import('./cmp-b').then(m => m.CmpB);
  4693. * ], (CmpA, CmpB) => {
  4694. * setClassMetadata(type, decorators, ctorParameters, propParameters);
  4695. * });
  4696. * ```
  4697. *
  4698. * Similar to the `setClassMetadata` call, it's wrapped into the `ngDevMode`
  4699. * check to tree-shake away this code in production mode.
  4700. */
  4701. declare function compileComponentClassMetadata(metadata: R3ClassMetadata, dependencies: R3DeferPerComponentDependency[] | null): Expression;
  4702. /**
  4703. * Identical to `compileComponentClassMetadata`. Used for the cases where we're unable to
  4704. * analyze the deferred block dependencies, but we have a reference to the compiled
  4705. * dependency resolver function that we can use as is.
  4706. * @param metadata Class metadata for the internal `setClassMetadata` call.
  4707. * @param deferResolver Expression representing the deferred dependency loading function.
  4708. * @param deferredDependencyNames Names of the dependencies that are being loaded asynchronously.
  4709. */
  4710. declare function compileOpaqueAsyncClassMetadata(metadata: R3ClassMetadata, deferResolver: Expression, deferredDependencyNames: string[]): Expression;
  4711. /**
  4712. * Info needed for runtime errors related to a class, such as the location in which the class is
  4713. * defined.
  4714. */
  4715. interface R3ClassDebugInfo {
  4716. /** The class identifier */
  4717. type: Expression;
  4718. /**
  4719. * A string literal containing the original class name as appears in its definition.
  4720. */
  4721. className: Expression;
  4722. /**
  4723. * A string literal containing the relative path of the file in which the class is defined.
  4724. *
  4725. * The path is relative to the project root. The compiler does the best effort to find the project
  4726. * root (e.g., using the rootDir of tsconfig), but if it fails this field is set to null,
  4727. * indicating that the file path was failed to be computed. In this case, the downstream consumers
  4728. * of the debug info will usually ignore the `lineNumber` field as well and just show the
  4729. * `className`. For security reasons we never show the absolute file path and prefer to just
  4730. * return null here.
  4731. */
  4732. filePath: Expression | null;
  4733. /**
  4734. * A number literal number containing the line number in which this class is defined.
  4735. */
  4736. lineNumber: Expression;
  4737. /**
  4738. * Whether to check if this component is being rendered without its NgModule being loaded into the
  4739. * browser. Such checks is carried out only in dev mode.
  4740. */
  4741. forbidOrphanRendering: boolean;
  4742. }
  4743. /**
  4744. * Generate an ngDevMode guarded call to setClassDebugInfo with the debug info about the class
  4745. * (e.g., the file name in which the class is defined)
  4746. */
  4747. declare function compileClassDebugInfo(debugInfo: R3ClassDebugInfo): Expression;
  4748. /*!
  4749. * @license
  4750. * Copyright Google LLC All Rights Reserved.
  4751. *
  4752. * Use of this source code is governed by an MIT-style license that can be
  4753. * found in the LICENSE file at https://angular.dev/license
  4754. */
  4755. /** Metadata necessary to compile HMR-related code call. */
  4756. interface R3HmrMetadata {
  4757. /** Component class for which HMR is being enabled. */
  4758. type: Expression;
  4759. /** Name of the component class. */
  4760. className: string;
  4761. /** File path of the component class. */
  4762. filePath: string;
  4763. /**
  4764. * When the compiler generates new imports, they get produced as namespace imports
  4765. * (e.g. import * as i0 from '@angular/core'). These namespaces have to be captured and passed
  4766. * along to the update callback.
  4767. */
  4768. namespaceDependencies: R3HmrNamespaceDependency[];
  4769. /**
  4770. * HMR update functions cannot contain imports so any locals the generated code depends on
  4771. * (e.g. references to imports within the same file or imported symbols) have to be passed in
  4772. * as function parameters. This array contains the names and runtime representation of the locals.
  4773. */
  4774. localDependencies: {
  4775. name: string;
  4776. runtimeRepresentation: Expression;
  4777. }[];
  4778. }
  4779. /** HMR dependency on a namespace import. */
  4780. interface R3HmrNamespaceDependency {
  4781. /** Module name of the import. */
  4782. moduleName: string;
  4783. /**
  4784. * Name under which to refer to the namespace inside
  4785. * HMR-related code. Must be a valid JS identifier.
  4786. */
  4787. assignedName: string;
  4788. }
  4789. /**
  4790. * Compiles the expression that initializes HMR for a class.
  4791. * @param meta HMR metadata extracted from the class.
  4792. */
  4793. declare function compileHmrInitializer(meta: R3HmrMetadata): Expression;
  4794. /**
  4795. * Compiles the HMR update callback for a class.
  4796. * @param definitions Compiled definitions for the class (e.g. `defineComponent` calls).
  4797. * @param constantStatements Supporting constants statements that were generated alongside
  4798. * the definition.
  4799. * @param meta HMR metadata extracted from the class.
  4800. */
  4801. declare function compileHmrUpdateCallback(definitions: {
  4802. name: string;
  4803. initializer: Expression | null;
  4804. statements: Statement[];
  4805. }[], constantStatements: Statement[], meta: R3HmrMetadata): DeclareFunctionStmt;
  4806. /**
  4807. * How the selector scope of an NgModule (its declarations, imports, and exports) should be emitted
  4808. * as a part of the NgModule definition.
  4809. */
  4810. declare enum R3SelectorScopeMode {
  4811. /**
  4812. * Emit the declarations inline into the module definition.
  4813. *
  4814. * This option is useful in certain contexts where it's known that JIT support is required. The
  4815. * tradeoff here is that this emit style prevents directives and pipes from being tree-shaken if
  4816. * they are unused, but the NgModule is used.
  4817. */
  4818. Inline = 0,
  4819. /**
  4820. * Emit the declarations using a side effectful function call, `ɵɵsetNgModuleScope`, that is
  4821. * guarded with the `ngJitMode` flag.
  4822. *
  4823. * This form of emit supports JIT and can be optimized away if the `ngJitMode` flag is set to
  4824. * false, which allows unused directives and pipes to be tree-shaken.
  4825. */
  4826. SideEffect = 1,
  4827. /**
  4828. * Don't generate selector scopes at all.
  4829. *
  4830. * This is useful for contexts where JIT support is known to be unnecessary.
  4831. */
  4832. Omit = 2
  4833. }
  4834. /**
  4835. * The type of the NgModule meta data.
  4836. * - Global: Used for full and partial compilation modes which mainly includes R3References.
  4837. * - Local: Used for the local compilation mode which mainly includes the raw expressions as appears
  4838. * in the NgModule decorator.
  4839. */
  4840. declare enum R3NgModuleMetadataKind {
  4841. Global = 0,
  4842. Local = 1
  4843. }
  4844. interface R3NgModuleMetadataCommon {
  4845. kind: R3NgModuleMetadataKind;
  4846. /**
  4847. * An expression representing the module type being compiled.
  4848. */
  4849. type: R3Reference;
  4850. /**
  4851. * How to emit the selector scope values (declarations, imports, exports).
  4852. */
  4853. selectorScopeMode: R3SelectorScopeMode;
  4854. /**
  4855. * The set of schemas that declare elements to be allowed in the NgModule.
  4856. */
  4857. schemas: R3Reference[] | null;
  4858. /** Unique ID or expression representing the unique ID of an NgModule. */
  4859. id: Expression | null;
  4860. }
  4861. /**
  4862. * Metadata required by the module compiler in full/partial mode to generate a module def (`ɵmod`)
  4863. * for a type.
  4864. */
  4865. interface R3NgModuleMetadataGlobal extends R3NgModuleMetadataCommon {
  4866. kind: R3NgModuleMetadataKind.Global;
  4867. /**
  4868. * An array of expressions representing the bootstrap components specified by the module.
  4869. */
  4870. bootstrap: R3Reference[];
  4871. /**
  4872. * An array of expressions representing the directives and pipes declared by the module.
  4873. */
  4874. declarations: R3Reference[];
  4875. /**
  4876. * Those declarations which should be visible to downstream consumers. If not specified, all
  4877. * declarations are made visible to downstream consumers.
  4878. */
  4879. publicDeclarationTypes: Expression[] | null;
  4880. /**
  4881. * An array of expressions representing the imports of the module.
  4882. */
  4883. imports: R3Reference[];
  4884. /**
  4885. * Whether or not to include `imports` in generated type declarations.
  4886. */
  4887. includeImportTypes: boolean;
  4888. /**
  4889. * An array of expressions representing the exports of the module.
  4890. */
  4891. exports: R3Reference[];
  4892. /**
  4893. * Whether to generate closure wrappers for bootstrap, declarations, imports, and exports.
  4894. */
  4895. containsForwardDecls: boolean;
  4896. }
  4897. /**
  4898. * Metadata required by the module compiler in local mode to generate a module def (`ɵmod`) for a
  4899. * type.
  4900. */
  4901. interface R3NgModuleMetadataLocal extends R3NgModuleMetadataCommon {
  4902. kind: R3NgModuleMetadataKind.Local;
  4903. /**
  4904. * The output expression representing the bootstrap components specified by the module.
  4905. */
  4906. bootstrapExpression: Expression | null;
  4907. /**
  4908. * The output expression representing the declarations of the module.
  4909. */
  4910. declarationsExpression: Expression | null;
  4911. /**
  4912. * The output expression representing the imports of the module.
  4913. */
  4914. importsExpression: Expression | null;
  4915. /**
  4916. * The output expression representing the exports of the module.
  4917. */
  4918. exportsExpression: Expression | null;
  4919. /**
  4920. * Local compilation mode always requires scope to be handled using side effect function calls.
  4921. */
  4922. selectorScopeMode: R3SelectorScopeMode.SideEffect;
  4923. }
  4924. /**
  4925. * Metadata required by the module compiler to generate a module def (`ɵmod`) for a type.
  4926. */
  4927. type R3NgModuleMetadata = R3NgModuleMetadataGlobal | R3NgModuleMetadataLocal;
  4928. /**
  4929. * Construct an `R3NgModuleDef` for the given `R3NgModuleMetadata`.
  4930. */
  4931. declare function compileNgModule(meta: R3NgModuleMetadata): R3CompiledExpression;
  4932. interface R3InjectorMetadata {
  4933. name: string;
  4934. type: R3Reference;
  4935. providers: Expression | null;
  4936. imports: Expression[];
  4937. }
  4938. declare function compileInjector(meta: R3InjectorMetadata): R3CompiledExpression;
  4939. interface R3PipeMetadata {
  4940. /**
  4941. * Name of the pipe type.
  4942. */
  4943. name: string;
  4944. /**
  4945. * An expression representing a reference to the pipe itself.
  4946. */
  4947. type: R3Reference;
  4948. /**
  4949. * Number of generic type parameters of the type itself.
  4950. */
  4951. typeArgumentCount: number;
  4952. /**
  4953. * Name of the pipe.
  4954. */
  4955. pipeName: string;
  4956. /**
  4957. * Dependencies of the pipe's constructor.
  4958. */
  4959. deps: R3DependencyMetadata[] | null;
  4960. /**
  4961. * Whether the pipe is marked as pure.
  4962. */
  4963. pure: boolean;
  4964. /**
  4965. * Whether the pipe is standalone.
  4966. */
  4967. isStandalone: boolean;
  4968. }
  4969. declare function compilePipeFromMetadata(metadata: R3PipeMetadata): R3CompiledExpression;
  4970. interface HostProperties {
  4971. [key: string]: string;
  4972. }
  4973. interface HostListeners {
  4974. [key: string]: string;
  4975. }
  4976. /**
  4977. * Parses bindings in templates and in the directive host area.
  4978. */
  4979. declare class BindingParser {
  4980. private _exprParser;
  4981. private _interpolationConfig;
  4982. private _schemaRegistry;
  4983. errors: ParseError[];
  4984. constructor(_exprParser: Parser, _interpolationConfig: InterpolationConfig, _schemaRegistry: ElementSchemaRegistry, errors: ParseError[]);
  4985. get interpolationConfig(): InterpolationConfig;
  4986. createBoundHostProperties(properties: HostProperties, sourceSpan: ParseSourceSpan): ParsedProperty[] | null;
  4987. createDirectiveHostEventAsts(hostListeners: HostListeners, sourceSpan: ParseSourceSpan): ParsedEvent[] | null;
  4988. parseInterpolation(value: string, sourceSpan: ParseSourceSpan, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null): ASTWithSource;
  4989. /**
  4990. * Similar to `parseInterpolation`, but treats the provided string as a single expression
  4991. * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).
  4992. * This is used for parsing the switch expression in ICUs.
  4993. */
  4994. parseInterpolationExpression(expression: string, sourceSpan: ParseSourceSpan): ASTWithSource;
  4995. /**
  4996. * Parses the bindings in a microsyntax expression, and converts them to
  4997. * `ParsedProperty` or `ParsedVariable`.
  4998. *
  4999. * @param tplKey template binding name
  5000. * @param tplValue template binding value
  5001. * @param sourceSpan span of template binding relative to entire the template
  5002. * @param absoluteValueOffset start of the tplValue relative to the entire template
  5003. * @param targetMatchableAttrs potential attributes to match in the template
  5004. * @param targetProps target property bindings in the template
  5005. * @param targetVars target variables in the template
  5006. */
  5007. parseInlineTemplateBinding(tplKey: string, tplValue: string, sourceSpan: ParseSourceSpan, absoluteValueOffset: number, targetMatchableAttrs: string[][], targetProps: ParsedProperty[], targetVars: ParsedVariable[], isIvyAst: boolean): void;
  5008. /**
  5009. * Parses the bindings in a microsyntax expression, e.g.
  5010. * ```html
  5011. * <tag *tplKey="let value1 = prop; let value2 = localVar">
  5012. * ```
  5013. *
  5014. * @param tplKey template binding name
  5015. * @param tplValue template binding value
  5016. * @param sourceSpan span of template binding relative to entire the template
  5017. * @param absoluteKeyOffset start of the `tplKey`
  5018. * @param absoluteValueOffset start of the `tplValue`
  5019. */
  5020. private _parseTemplateBindings;
  5021. parseLiteralAttr(name: string, value: string | null, sourceSpan: ParseSourceSpan, absoluteOffset: number, valueSpan: ParseSourceSpan | undefined, targetMatchableAttrs: string[][], targetProps: ParsedProperty[], keySpan: ParseSourceSpan): void;
  5022. parsePropertyBinding(name: string, expression: string, isHost: boolean, isPartOfAssignmentBinding: boolean, sourceSpan: ParseSourceSpan, absoluteOffset: number, valueSpan: ParseSourceSpan | undefined, targetMatchableAttrs: string[][], targetProps: ParsedProperty[], keySpan: ParseSourceSpan): void;
  5023. parsePropertyInterpolation(name: string, value: string, sourceSpan: ParseSourceSpan, valueSpan: ParseSourceSpan | undefined, targetMatchableAttrs: string[][], targetProps: ParsedProperty[], keySpan: ParseSourceSpan, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null): boolean;
  5024. private _parsePropertyAst;
  5025. private _parseAnimation;
  5026. parseBinding(value: string, isHostBinding: boolean, sourceSpan: ParseSourceSpan, absoluteOffset: number): ASTWithSource;
  5027. createBoundElementProperty(elementSelector: string, boundProp: ParsedProperty, skipValidation?: boolean, mapPropertyName?: boolean): BoundElementProperty;
  5028. parseEvent(name: string, expression: string, isAssignmentEvent: boolean, sourceSpan: ParseSourceSpan, handlerSpan: ParseSourceSpan, targetMatchableAttrs: string[][], targetEvents: ParsedEvent[], keySpan: ParseSourceSpan): void;
  5029. calcPossibleSecurityContexts(selector: string, propName: string, isAttribute: boolean): SecurityContext[];
  5030. private _parseAnimationEvent;
  5031. private _parseRegularEvent;
  5032. private _parseAction;
  5033. private _reportError;
  5034. private _reportExpressionParserErrors;
  5035. /**
  5036. * @param propName the name of the property / attribute
  5037. * @param sourceSpan
  5038. * @param isAttr true when binding to an attribute
  5039. */
  5040. private _validatePropertyOrAttributeName;
  5041. /**
  5042. * Returns whether a parsed AST is allowed to be used within the event side of a two-way binding.
  5043. * @param ast Parsed AST to be checked.
  5044. */
  5045. private _isAllowedAssignmentEvent;
  5046. }
  5047. /**
  5048. * Options that can be used to modify how a template is parsed by `parseTemplate()`.
  5049. */
  5050. interface ParseTemplateOptions {
  5051. /**
  5052. * Include whitespace nodes in the parsed output.
  5053. */
  5054. preserveWhitespaces?: boolean;
  5055. /**
  5056. * Preserve original line endings instead of normalizing '\r\n' endings to '\n'.
  5057. */
  5058. preserveLineEndings?: boolean;
  5059. /**
  5060. * Preserve whitespace significant to rendering.
  5061. */
  5062. preserveSignificantWhitespace?: boolean;
  5063. /**
  5064. * How to parse interpolation markers.
  5065. */
  5066. interpolationConfig?: InterpolationConfig;
  5067. /**
  5068. * The start and end point of the text to parse within the `source` string.
  5069. * The entire `source` string is parsed if this is not provided.
  5070. * */
  5071. range?: LexerRange;
  5072. /**
  5073. * If this text is stored in a JavaScript string, then we have to deal with escape sequences.
  5074. *
  5075. * **Example 1:**
  5076. *
  5077. * ```
  5078. * "abc\"def\nghi"
  5079. * ```
  5080. *
  5081. * - The `\"` must be converted to `"`.
  5082. * - The `\n` must be converted to a new line character in a token,
  5083. * but it should not increment the current line for source mapping.
  5084. *
  5085. * **Example 2:**
  5086. *
  5087. * ```
  5088. * "abc\
  5089. * def"
  5090. * ```
  5091. *
  5092. * The line continuation (`\` followed by a newline) should be removed from a token
  5093. * but the new line should increment the current line for source mapping.
  5094. */
  5095. escapedString?: boolean;
  5096. /**
  5097. * An array of characters that should be considered as leading trivia.
  5098. * Leading trivia are characters that are not important to the developer, and so should not be
  5099. * included in source-map segments. A common example is whitespace.
  5100. */
  5101. leadingTriviaChars?: string[];
  5102. /**
  5103. * Render `$localize` message ids with additional legacy message ids.
  5104. *
  5105. * This option defaults to `true` but in the future the default will be flipped.
  5106. *
  5107. * For now set this option to false if you have migrated the translation files to use the new
  5108. * `$localize` message id format and you are not using compile time translation merging.
  5109. */
  5110. enableI18nLegacyMessageIdFormat?: boolean;
  5111. /**
  5112. * If this text is stored in an external template (e.g. via `templateUrl`) then we need to decide
  5113. * whether or not to normalize the line-endings (from `\r\n` to `\n`) when processing ICU
  5114. * expressions.
  5115. *
  5116. * If `true` then we will normalize ICU expression line endings.
  5117. * The default is `false`, but this will be switched in a future major release.
  5118. */
  5119. i18nNormalizeLineEndingsInICUs?: boolean;
  5120. /**
  5121. * Whether to always attempt to convert the parsed HTML AST to an R3 AST, despite HTML or i18n
  5122. * Meta parse errors.
  5123. *
  5124. *
  5125. * This option is useful in the context of the language service, where we want to get as much
  5126. * information as possible, despite any errors in the HTML. As an example, a user may be adding
  5127. * a new tag and expecting autocomplete on that tag. In this scenario, the HTML is in an errored
  5128. * state, as there is an incomplete open tag. However, we're still able to convert the HTML AST
  5129. * nodes to R3 AST nodes in order to provide information for the language service.
  5130. *
  5131. * Note that even when `true` the HTML parse and i18n errors are still appended to the errors
  5132. * output, but this is done after converting the HTML AST to R3 AST.
  5133. */
  5134. alwaysAttemptHtmlToR3AstConversion?: boolean;
  5135. /**
  5136. * Include HTML Comment nodes in a top-level comments array on the returned R3 AST.
  5137. *
  5138. * This option is required by tooling that needs to know the location of comment nodes within the
  5139. * AST. A concrete example is @angular-eslint which requires this in order to enable
  5140. * "eslint-disable" comments within HTML templates, which then allows users to turn off specific
  5141. * rules on a case by case basis, instead of for their whole project within a configuration file.
  5142. */
  5143. collectCommentNodes?: boolean;
  5144. /** Whether the @ block syntax is enabled. */
  5145. enableBlockSyntax?: boolean;
  5146. /** Whether the `@let` syntax is enabled. */
  5147. enableLetSyntax?: boolean;
  5148. }
  5149. /**
  5150. * Parse a template into render3 `Node`s and additional metadata, with no other dependencies.
  5151. *
  5152. * @param template text of the template to parse
  5153. * @param templateUrl URL to use for source mapping of the parsed template
  5154. * @param options options to modify how the template is parsed
  5155. */
  5156. declare function parseTemplate(template: string, templateUrl: string, options?: ParseTemplateOptions): ParsedTemplate;
  5157. /**
  5158. * Construct a `BindingParser` with a default configuration.
  5159. */
  5160. declare function makeBindingParser(interpolationConfig?: InterpolationConfig): BindingParser;
  5161. /**
  5162. * Information about the template which was extracted during parsing.
  5163. *
  5164. * This contains the actual parsed template as well as any metadata collected during its parsing,
  5165. * some of which might be useful for re-parsing the template with different options.
  5166. */
  5167. interface ParsedTemplate {
  5168. /**
  5169. * Include whitespace nodes in the parsed output.
  5170. */
  5171. preserveWhitespaces?: boolean;
  5172. /**
  5173. * How to parse interpolation markers.
  5174. */
  5175. interpolationConfig?: InterpolationConfig;
  5176. /**
  5177. * Any errors from parsing the template the first time.
  5178. *
  5179. * `null` if there are no errors. Otherwise, the array of errors is guaranteed to be non-empty.
  5180. */
  5181. errors: ParseError[] | null;
  5182. /**
  5183. * The template AST, parsed from the template.
  5184. */
  5185. nodes: Node[];
  5186. /**
  5187. * Any styleUrls extracted from the metadata.
  5188. */
  5189. styleUrls: string[];
  5190. /**
  5191. * Any inline styles extracted from the metadata.
  5192. */
  5193. styles: string[];
  5194. /**
  5195. * Any ng-content selectors extracted from the template.
  5196. */
  5197. ngContentSelectors: string[];
  5198. /**
  5199. * Any R3 Comment Nodes extracted from the template when the `collectCommentNodes` parse template
  5200. * option is enabled.
  5201. */
  5202. commentNodes?: Comment[];
  5203. }
  5204. /**
  5205. * Compile a directive for the render3 runtime as defined by the `R3DirectiveMetadata`.
  5206. */
  5207. declare function compileDirectiveFromMetadata(meta: R3DirectiveMetadata, constantPool: ConstantPool, bindingParser: BindingParser): R3CompiledExpression;
  5208. /**
  5209. * Compile a component for the render3 runtime as defined by the `R3ComponentMetadata`.
  5210. */
  5211. declare function compileComponentFromMetadata(meta: R3ComponentMetadata<R3TemplateDependency>, constantPool: ConstantPool, bindingParser: BindingParser): R3CompiledExpression;
  5212. interface ParsedHostBindings {
  5213. attributes: {
  5214. [key: string]: Expression;
  5215. };
  5216. listeners: {
  5217. [key: string]: string;
  5218. };
  5219. properties: {
  5220. [key: string]: string;
  5221. };
  5222. specialAttributes: {
  5223. styleAttr?: string;
  5224. classAttr?: string;
  5225. };
  5226. }
  5227. declare function parseHostBindings(host: {
  5228. [key: string]: string | Expression;
  5229. }): ParsedHostBindings;
  5230. /**
  5231. * Verifies host bindings and returns the list of errors (if any). Empty array indicates that a
  5232. * given set of host bindings has no errors.
  5233. *
  5234. * @param bindings set of host bindings to verify.
  5235. * @param sourceSpan source span where host bindings were defined.
  5236. * @returns array of errors associated with a given set of host bindings.
  5237. */
  5238. declare function verifyHostBindings(bindings: ParsedHostBindings, sourceSpan: ParseSourceSpan): ParseError[];
  5239. /**
  5240. * Encapsulates a CSS stylesheet with emulated view encapsulation.
  5241. * This allows a stylesheet to be used with an Angular component that
  5242. * is using the `ViewEncapsulation.Emulated` mode.
  5243. *
  5244. * @param style The content of a CSS stylesheet.
  5245. * @param componentIdentifier The identifier to use within the CSS rules.
  5246. * @returns The encapsulated content for the style.
  5247. */
  5248. declare function encapsulateStyle(style: string, componentIdentifier?: string): string;
  5249. /**
  5250. * Compiles the dependency resolver function for a defer block.
  5251. */
  5252. declare function compileDeferResolverFunction(meta: R3DeferResolverFunctionMetadata): ArrowFunctionExpr;
  5253. declare function compileDeclareClassMetadata(metadata: R3ClassMetadata): Expression;
  5254. declare function compileComponentDeclareClassMetadata(metadata: R3ClassMetadata, dependencies: R3DeferPerComponentDependency[] | null): Expression;
  5255. interface DeclareComponentTemplateInfo {
  5256. /**
  5257. * The string contents of the template.
  5258. *
  5259. * This is the "logical" template string, after expansion of any escaped characters (for inline
  5260. * templates). This may differ from the actual template bytes as they appear in the .ts file.
  5261. */
  5262. content: string;
  5263. /**
  5264. * A full path to the file which contains the template.
  5265. *
  5266. * This can be either the original .ts file if the template is inline, or the .html file if an
  5267. * external file was used.
  5268. */
  5269. sourceUrl: string;
  5270. /**
  5271. * Whether the template was inline (using `template`) or external (using `templateUrl`).
  5272. */
  5273. isInline: boolean;
  5274. /**
  5275. * If the template was defined inline by a direct string literal, then this is that literal
  5276. * expression. Otherwise `null`, if the template was not defined inline or was not a literal.
  5277. */
  5278. inlineTemplateLiteralExpression: Expression | null;
  5279. }
  5280. /**
  5281. * Compile a component declaration defined by the `R3ComponentMetadata`.
  5282. */
  5283. declare function compileDeclareComponentFromMetadata(meta: R3ComponentMetadata<R3TemplateDependencyMetadata>, template: ParsedTemplate, additionalTemplateInfo: DeclareComponentTemplateInfo): R3CompiledExpression;
  5284. /**
  5285. * Compile a directive declaration defined by the `R3DirectiveMetadata`.
  5286. */
  5287. declare function compileDeclareDirectiveFromMetadata(meta: R3DirectiveMetadata): R3CompiledExpression;
  5288. declare function compileDeclareFactoryFunction(meta: R3FactoryMetadata): R3CompiledExpression;
  5289. /**
  5290. * Compile a Injectable declaration defined by the `R3InjectableMetadata`.
  5291. */
  5292. declare function compileDeclareInjectableFromMetadata(meta: R3InjectableMetadata): R3CompiledExpression;
  5293. declare function compileDeclareInjectorFromMetadata(meta: R3InjectorMetadata): R3CompiledExpression;
  5294. declare function compileDeclareNgModuleFromMetadata(meta: R3NgModuleMetadata): R3CompiledExpression;
  5295. /**
  5296. * Compile a Pipe declaration defined by the `R3PipeMetadata`.
  5297. */
  5298. declare function compileDeclarePipeFromMetadata(meta: R3PipeMetadata): R3CompiledExpression;
  5299. declare function publishFacade(global: any): void;
  5300. export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, type AnimationTriggerNames, ArrayType, ArrowFunctionExpr, type AstVisitor, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BindingType, Block, BlockParameter, BoundElementProperty, type BoundTarget, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment$1 as Comment, type CompileClassMetadataFn, type CompileIdentifierMetadata, CompilerConfig, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclarationListEmitMode, type DeclareComponentTemplateInfo, DeclareFunctionStmt, DeclareVarStmt, DeferBlockDepsEmitMode, type DirectiveMeta, DomElementSchemaRegistry, DynamicImportExpr, EOF, Element$1 as Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, type ExpressionVisitor, ExternalExpr, ExternalReference, FactoryTarget$1 as FactoryTarget, ForwardRefHandling, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, type InputOutputPropertySet, InstantiateExpr, Interpolation, InterpolationConfig, type InterpolationPiece, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, KeyedWrite, LeadingComment, type LegacyInputPartialMapping, LetDeclaration$1 as LetDeclaration, Lexer, type LexerRange, TokenType$1 as LexerTokenType, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, type LiteralMapKey, LiteralPrimitive, LocalizedString, MapType, type MaybeForwardRefExpression, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, type Node$1 as Node, NodeWithI18n, NonNullAssert, NotExpr, ParseError, ParseErrorLevel, ParseFlags, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, type ParseTemplateOptions, ParseTreeResult, ParsedEvent, ParsedEventType, type ParsedHostBindings, ParsedProperty, ParsedPropertyType, type ParsedTemplate, ParsedVariable, Parser, ParserError, PrefixNot, PropertyRead, PropertyWrite, R3BoundTarget, type R3ClassDebugInfo, type R3ClassMetadata, type R3CompiledExpression, type R3ComponentDeferMetadata, type R3ComponentMetadata, type R3DeclareClassMetadata, type R3DeclareClassMetadataAsync, type R3DeclareComponentMetadata, type R3DeclareDependencyMetadata, type R3DeclareDirectiveDependencyMetadata, type R3DeclareDirectiveMetadata, type R3DeclareFactoryMetadata, type R3DeclareHostDirectiveMetadata, type R3DeclareInjectableMetadata, type R3DeclareInjectorMetadata, type R3DeclareNgModuleDependencyMetadata, type R3DeclareNgModuleMetadata, type R3DeclarePipeDependencyMetadata, type R3DeclarePipeMetadata, type R3DeclareQueryMetadata, type R3DeclareTemplateDependencyMetadata, type R3DeferPerBlockDependency, type R3DeferPerComponentDependency, type R3DeferResolverFunctionMetadata, type R3DependencyMetadata, type R3DirectiveDependencyMetadata, type R3DirectiveMetadata, type R3FactoryMetadata, type R3HmrMetadata, type R3HmrNamespaceDependency, type R3HostDirectiveMetadata, type R3HostMetadata, Identifiers as R3Identifiers, type R3InjectableMetadata, type R3InjectorMetadata, type R3InputMetadata, type R3NgModuleDependencyMetadata, type R3NgModuleMetadata, type R3NgModuleMetadataGlobal, R3NgModuleMetadataKind, type R3PartialDeclaration, type R3PipeDependencyMetadata, type R3PipeMetadata, type R3QueryMetadata, type R3Reference, R3SelectorScopeMode, R3TargetBinder, type R3TemplateDependency, R3TemplateDependencyKind, type R3TemplateDependencyMetadata, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor$1 as RecursiveVisitor, type ReferenceTarget, ResourceLoader, ReturnStatement, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, type SchemaMetadata, type ScopedNode, SelectorContext, SelectorListContext, SelectorMatcher, Serializer, type SourceMap, SplitInterpolation, Statement, type StatementVisitor, StmtModifier, StringToken, StringTokenKind, TagContentType, type TagDefinition, TaggedTemplateLiteralExpr, type Target, type TargetBinder, type TemplateBinding, type TemplateBindingIdentifier, TemplateBindingParseResult, type TemplateEntity, TemplateLiteral, TemplateLiteralElement, TemplateLiteralElementExpr, TemplateLiteralExpr, Text$1 as Text, ThisReceiver, BlockNode as TmplAstBlockNode, BoundAttribute as TmplAstBoundAttribute, BoundDeferredTrigger as TmplAstBoundDeferredTrigger, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Content as TmplAstContent, DeferredBlock as TmplAstDeferredBlock, DeferredBlockError as TmplAstDeferredBlockError, DeferredBlockLoading as TmplAstDeferredBlockLoading, DeferredBlockPlaceholder as TmplAstDeferredBlockPlaceholder, type DeferredBlockTriggers as TmplAstDeferredBlockTriggers, DeferredTrigger as TmplAstDeferredTrigger, Element as TmplAstElement, ForLoopBlock as TmplAstForLoopBlock, ForLoopBlockEmpty as TmplAstForLoopBlockEmpty, HoverDeferredTrigger as TmplAstHoverDeferredTrigger, Icu as TmplAstIcu, IdleDeferredTrigger as TmplAstIdleDeferredTrigger, IfBlock as TmplAstIfBlock, IfBlockBranch as TmplAstIfBlockBranch, ImmediateDeferredTrigger as TmplAstImmediateDeferredTrigger, InteractionDeferredTrigger as TmplAstInteractionDeferredTrigger, LetDeclaration as TmplAstLetDeclaration, NeverDeferredTrigger as TmplAstNeverDeferredTrigger, type Node as TmplAstNode, RecursiveVisitor as TmplAstRecursiveVisitor, Reference as TmplAstReference, SwitchBlock as TmplAstSwitchBlock, SwitchBlockCase as TmplAstSwitchBlockCase, Template as TmplAstTemplate, Text as TmplAstText, TextAttribute as TmplAstTextAttribute, TimerDeferredTrigger as TmplAstTimerDeferredTrigger, UnknownBlock as TmplAstUnknownBlock, Variable as TmplAstVariable, ViewportDeferredTrigger as TmplAstViewportDeferredTrigger, type Visitor as TmplAstVisitor, Token, TokenType, TransplantedType, TreeError, Type, TypeModifier, type TypeVisitor, TypeofExpr, TypeofExpression, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation, type Visitor$1 as Visitor, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, compileClassDebugInfo, compileClassMetadata, compileComponentClassMetadata, compileComponentDeclareClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDeferResolverFunction, compileDirectiveFromMetadata, compileFactoryFunction, compileHmrInitializer, compileHmrUpdateCallback, compileInjectable, compileInjector, compileNgModule, compileOpaqueAsyncClassMetadata, compilePipeFromMetadata, computeMsgId, core_d as core, createCssSelectorFromNode, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, encapsulateStyle, findMatchingDirectivesAndPipes, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literal, literalMap, makeBindingParser, mergeNsAndName, output_ast_d as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, splitNsName, visitAll as tmplAstVisitAll, verifyHostBindings, visitAll$1 as visitAll };