index.d.ts 180 KB

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