12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072(*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)modulerecSyntax:sigtype('M,'internal)t={leading:'MComment.tlist;trailing:'MComment.tlist;internal:'internal;}end=SyntaxandIdentifier:sigtype('M,'T)t='T*'Mt'and'Mt'={name:string;comments:('M,unit)Syntax.toption;}end=IdentifierandPrivateName:sigtype'Mt='M*'Mt'and'Mt'={name:string;comments:('M,unit)Syntax.toption;}end=PrivateNameandStringLiteral:sigtype'Mt={value:string;raw:string;comments:('M,unit)Syntax.toption;}end=StringLiteralandNumberLiteral:sigtype'Mt={value:float;raw:string;comments:('M,unit)Syntax.toption;}end=NumberLiteralandBigIntLiteral:sigtype'Mt={(* This will be None if we couldn't parse `raw`. That could be if the number is out of range or invalid (like a float) *)value:int64option;raw:string;comments:('M,unit)Syntax.toption;}end=BigIntLiteralandBooleanLiteral:sigtype'Mt={value:bool;comments:('M,unit)Syntax.toption;}end=BooleanLiteralandRegExpLiteral:sigtype'Mt={pattern:string;flags:string;raw:string;comments:('M,unit)Syntax.toption;}[@@derivingshow]end=RegExpLiteralandModuleRefLiteral:sigtype('M,'T)t={value:string;require_out:'T;prefix_len:int;legacy_interop:bool;raw:string;comments:('M,unit)Syntax.toption;}[@@derivingshow]end=ModuleRefLiteralandVariance:sigtype'Mt='M*'Mt'andkind=|Plus|Minus|Readonly|In|Out|InOutand'Mt'={kind:kind;comments:('M,unit)Syntax.toption;}end=VarianceandComputedKey:sigtype('M,'T)t='M*('M,'T)ComputedKey.t'and('M,'T)t'={expression:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}end=ComputedKeyandVariable:sigtypekind=|Var|Let|Const[@@derivingshow]end=VariableandType:sigmoduleConditional:sigtype('M,'T)t={check_type:('M,'T)Type.t;extends_type:('M,'T)Type.t;true_type:('M,'T)Type.t;false_type:('M,'T)Type.t;comments:('M,unit)Syntax.toption;}[@@derivingshow]endmoduleInfer:sigtype('M,'T)t={tparam:('M,'T)Type.TypeParam.t;comments:('M,unit)Syntax.toption;}[@@derivingshow]endmoduleFunction:sigmoduleParam:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={name:('M,'T)Identifier.toption;annot:('M,'T)Type.t;optional:bool;}endmoduleRestParam:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={argument:('M,'T)Param.t;comments:('M,unit)Syntax.toption;}endmoduleThisParam:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={annot:('M,'T)Type.annotation;comments:('M,unit)Syntax.toption;}endmoduleParams:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={this_:('M,'T)ThisParam.toption;params:('M,'T)Param.tlist;rest:('M,'T)RestParam.toption;comments:('M,'MComment.tlist)Syntax.toption;}[@@derivingshow]endtype('M,'T)t={tparams:('M,'T)Type.TypeParams.toption;params:('M,'T)Params.t;return:('M,'T)return_annotation;comments:('M,unit)Syntax.toption;}and('M,'T)return_annotation=|TypeAnnotationof('M,'T)Type.t|TypeGuardof('M,'T)Type.TypeGuard.t[@@derivingshow]endmoduleComponent:sigmoduleParam:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={name:('M,'T)Statement.ComponentDeclaration.Param.param_name;annot:('M,'T)Type.annotation;optional:bool;}[@@derivingshow]endmoduleRestParam:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={argument:('M,'T)Identifier.toption;annot:('M,'T)Type.t;optional:bool;comments:('M,unit)Syntax.toption;}[@@derivingshow]endmoduleParams:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={params:('M,'T)Param.tlist;rest:('M,'T)RestParam.toption;comments:('M,'MComment.tlist)Syntax.toption;}[@@derivingshow]endtype('M,'T)t={tparams:('M,'T)Type.TypeParams.toption;params:('M,'T)Params.t;renders:('M,'T)Type.component_renders_annotation;comments:('M,unit)Syntax.toption;}endmoduleGeneric:sigmoduleIdentifier:sigtype('M,'T)t=|Unqualifiedof('M,'T)Identifier.t|Qualifiedof('M,'T)qualifiedand('M,'T)qualified='M*('M,'T)qualified'and('M,'T)qualified'={qualification:('M,'T)t;id:('M,'T)Identifier.t;}endtype('M,'T)t={id:('M,'T)Identifier.t;targs:('M,'T)Type.TypeArgs.toption;comments:('M,unit)Syntax.toption;}endmoduleIndexedAccess:sigtype('M,'T)t={_object:('M,'T)Type.t;index:('M,'T)Type.t;comments:('M,unit)Syntax.toption;}endmoduleOptionalIndexedAccess:sigtype('M,'T)t={indexed_access:('M,'T)IndexedAccess.t;optional:bool;}endmoduleObject:sigmoduleProperty:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={key:('M,'T)Expression.Object.Property.key;value:('M,'T)value;optional:bool;static:bool;proto:bool;_method:bool;variance:'MVariance.toption;comments:('M,unit)Syntax.toption;}and('M,'T)value=|Initof('M,'T)Type.t|Getof('M*('M,'T)Function.t)|Setof('M*('M,'T)Function.t)endmoduleSpreadProperty:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={argument:('M,'T)Type.t;comments:('M,unit)Syntax.toption;}endmoduleIndexer:sigtype('M,'T)t'={id:('M,'M)Identifier.toption;key:('M,'T)Type.t;value:('M,'T)Type.t;static:bool;variance:'MVariance.toption;comments:('M,unit)Syntax.toption;}and('M,'T)t='M*('M,'T)t'[@@derivingshow]endmoduleMappedType:sig(* PlusOptional = +?, MinusOptional = -?, Optional = ?, NoOptionalFlag = blank *)typeoptional_flag=|PlusOptional|MinusOptional|Optional|NoOptionalFlag[@@derivingshow]type('M,'T)t'={key_tparam:('M,'T)Type.TypeParam.t;prop_type:('M,'T)Type.t;source_type:('M,'T)Type.t;variance:'MVariance.toption;optional:optional_flag;comments:('M,unit)Syntax.toption;}and('M,'T)t='M*('M,'T)t'[@@derivingshow]endmoduleCallProperty:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={value:'M*('M,'T)Function.t;static:bool;comments:('M,unit)Syntax.toption;}endmoduleInternalSlot:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={id:('M,'M)Identifier.t;value:('M,'T)Type.t;optional:bool;static:bool;_method:bool;comments:('M,unit)Syntax.toption;}endtype('M,'T)t={exact:bool;(* Inexact indicates the presence of ... in the object. It is more
* easily understood if exact is read as "explicitly exact" and "inexact"
* is read as "explicitly inexact".
*
* This confusion will go away when we get rid of the exact flag in favor
* of inexact as part of the work to make object types exact by default.
* *)inexact:bool;properties:('M,'T)propertylist;comments:('M,'MComment.tlist)Syntax.toption;}and('M,'T)property=|Propertyof('M,'T)Property.t|SpreadPropertyof('M,'T)SpreadProperty.t|Indexerof('M,'T)Indexer.t|CallPropertyof('M,'T)CallProperty.t|InternalSlotof('M,'T)InternalSlot.t|MappedTypeof('M,'T)MappedType.t[@@derivingshow]endmoduleInterface:sigtype('M,'T)t={body:'M*('M,'T)Object.t;extends:('M*('M,'T)Generic.t)list;comments:('M,unit)Syntax.toption;}endmoduleNullable:sigtype('M,'T)t={argument:('M,'T)Type.t;comments:('M,unit)Syntax.toption;}endmoduleTypeof:sigmoduleTarget:sigtype('M,'T)t=|Unqualifiedof('M,'T)Identifier.t|Qualifiedof('M,'T)qualifiedand('M,'T)qualified'={qualification:('M,'T)t;id:('M,'T)Identifier.t;}and('M,'T)qualified='T*('M,'T)qualified'[@@derivingshow]endtype('M,'T)t={argument:('M,'T)Target.t;targs:('M,'T)Type.TypeArgs.toption;comments:('M,unit)Syntax.toption;}endmoduleKeyof:sigtype('M,'T)t={argument:('M,'T)Type.t;comments:('M,unit)Syntax.toption;}[@@derivingshow]endmoduleRenders:sigtypevariant=|Normal|Maybe|Star[@@derivingshow]type('M,'T)t={operator_loc:'M;argument:('M,'T)Type.t;comments:('M,unit)Syntax.toption;variant:variant;}[@@derivingshow]endmoduleReadOnly:sigtype('M,'T)t={argument:('M,'T)Type.t;comments:('M,unit)Syntax.toption;}[@@derivingshow]endmoduleTuple:sigmoduleLabeledElement:sigtype('M,'T)t={name:('M,'T)Identifier.t;annot:('M,'T)Type.t;variance:'MVariance.toption;optional:bool;}[@@derivingshow]endmoduleSpreadElement:sigtype('M,'T)t={name:('M,'T)Identifier.toption;annot:('M,'T)Type.t;}[@@derivingshow]endtype('M,'T)element='M*('M,'T)element'[@@derivingshow]and('M,'T)element'=|UnlabeledElementof('M,'T)Type.t|LabeledElementof('M,'T)LabeledElement.t|SpreadElementof('M,'T)SpreadElement.t[@@derivingshow]and('M,'T)t={elements:('M,'T)elementlist;comments:('M,unit)Syntax.toption;}endmoduleArray:sigtype('M,'T)t={argument:('M,'T)Type.t;comments:('M,unit)Syntax.toption;}endmoduleUnion:sigtype('M,'T)t={types:('M,'T)Type.t*('M,'T)Type.t*('M,'T)Type.tlist;comments:('M,unit)Syntax.toption;}endmoduleIntersection:sigtype('M,'T)t={types:('M,'T)Type.t*('M,'T)Type.t*('M,'T)Type.tlist;comments:('M,unit)Syntax.toption;}endtype('M,'T)t='T*('M,'T)t'(* Yes, we could add a little complexity here to show that Any and Void
* should never be declared nullable, but that check can happen later *)and('M,'T)t'=|Anyof('M,unit)Syntax.toption|Mixedof('M,unit)Syntax.toption|Emptyof('M,unit)Syntax.toption|Voidof('M,unit)Syntax.toption|Nullof('M,unit)Syntax.toption|Numberof('M,unit)Syntax.toption|BigIntof('M,unit)Syntax.toption|Stringof('M,unit)Syntax.toption|Booleanof{raw:[`Boolean|`Bool];comments:('M,unit)Syntax.toption;}|Symbolof('M,unit)Syntax.toption|Existsof('M,unit)Syntax.toption|Nullableof('M,'T)Nullable.t|Functionof('M,'T)Function.t|Componentof('M,'T)Component.t|Objectof('M,'T)Object.t|Interfaceof('M,'T)Interface.t|Arrayof('M,'T)Array.t|Conditionalof('M,'T)Conditional.t|Inferof('M,'T)Infer.t|Genericof('M,'T)Generic.t|IndexedAccessof('M,'T)IndexedAccess.t|OptionalIndexedAccessof('M,'T)OptionalIndexedAccess.t|Unionof('M,'T)Union.t|Intersectionof('M,'T)Intersection.t|Typeofof('M,'T)Typeof.t|Keyofof('M,'T)Keyof.t|Rendersof('M,'T)Renders.t|ReadOnlyof('M,'T)ReadOnly.t|Tupleof('M,'T)Tuple.t|StringLiteralof'MStringLiteral.t|NumberLiteralof'MNumberLiteral.t|BigIntLiteralof'MBigIntLiteral.t|BooleanLiteralof'MBooleanLiteral.t|Unknownof('M,unit)Syntax.toption|Neverof('M,unit)Syntax.toption|Undefinedof('M,unit)Syntax.toption(* Type.annotation is a concrete syntax node with a location that starts at
* the colon and ends after the type. For example, "var a: number", the
* identifier a would have a property annot which contains a
* Type.annotation with a location from column 6-14 *)and('M,'T)annotation='M*('M,'T)t(* Same convention about the colon holds for type guards. *)and('M,'T)type_guard_annotation='M*('M,'T)Type.TypeGuard.tand('M,'T)annotation_or_hint=|Missingof'T|Availableof('M,'T)Type.annotation[@@derivingshow]and('M,'T)component_renders_annotation=|MissingRendersof'T|AvailableRendersof'M*('M,'T)Type.Renders.t[@@derivingshow]moduleTypeParam:sigtypebound_kind=|Colon|Extends[@@derivingshow]type('M,'T)t='M*('M,'T)t'and('M,'T)t'={name:('M,'M)Identifier.t;bound:('M,'T)Type.annotation_or_hint;bound_kind:bound_kind;variance:'MVariance.toption;default:('M,'T)Type.toption;}endmoduleTypeParams:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={params:('M,'T)TypeParam.tlist;comments:('M,'MComment.tlist)Syntax.toption;}endmoduleTypeArgs:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={arguments:('M,'T)Type.tlist;comments:('M,'MComment.tlist)Syntax.toption;}endmodulePredicate:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={kind:('M,'T)kind;comments:('M,unit)Syntax.toption;}and('M,'T)kind=|Declaredof('M,'T)Expression.t|Inferred[@@derivingshow]endmoduleTypeGuard:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={asserts:bool;guard:('M,'M)Identifier.t*('M,'T)Type.toption;comments:('M,'MComment.tlist)Syntax.toption;}[@@derivingshow]endend=TypeandStatement:sigmoduleBlock:sigtype('M,'T)t={body:('M,'T)Statement.tlist;comments:('M,'MComment.tlist)Syntax.toption;}endmoduleIf:sigmoduleAlternate:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={body:('M,'T)Statement.t;comments:('M,unit)Syntax.toption;}endtype('M,'T)t={test:('M,'T)Expression.t;consequent:('M,'T)Statement.t;alternate:('M,'T)Alternate.toption;comments:('M,unit)Syntax.toption;}endmoduleLabeled:sigtype('M,'T)t={label:('M,'M)Identifier.t;body:('M,'T)Statement.t;comments:('M,unit)Syntax.toption;}endmoduleBreak:sigtype'Mt={label:('M,'M)Identifier.toption;comments:('M,unit)Syntax.toption;}endmoduleContinue:sigtype'Mt={label:('M,'M)Identifier.toption;comments:('M,unit)Syntax.toption;}endmoduleDebugger:sigtype'Mt={comments:('M,unit)Syntax.toption}[@@derivingshow]endmoduleWith:sigtype('M,'T)t={_object:('M,'T)Expression.t;body:('M,'T)Statement.t;comments:('M,unit)Syntax.toption;}endmoduleTypeAlias:sigtype('M,'T)t={id:('M,'T)Identifier.t;tparams:('M,'T)Type.TypeParams.toption;right:('M,'T)Type.t;comments:('M,unit)Syntax.toption;}endmoduleOpaqueType:sigtype('M,'T)t={id:('M,'T)Identifier.t;tparams:('M,'T)Type.TypeParams.toption;impltype:('M,'T)Type.toption;supertype:('M,'T)Type.toption;comments:('M,unit)Syntax.toption;}endmoduleSwitch:sigmoduleCase:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={test:('M,'T)Expression.toption;consequent:('M,'T)Statement.tlist;comments:('M,unit)Syntax.toption;}endtype('M,'T)t={discriminant:('M,'T)Expression.t;cases:('M,'T)Case.tlist;comments:('M,unit)Syntax.toption;exhaustive_out:'T;}endmoduleReturn:sigtype('M,'T)t={argument:('M,'T)Expression.toption;comments:('M,unit)Syntax.toption;return_out:'T;}endmoduleThrow:sigtype('M,'T)t={argument:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}endmoduleTry:sigmoduleCatchClause:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={param:('M,'T)Pattern.toption;body:'M*('M,'T)Block.t;comments:('M,unit)Syntax.toption;}endtype('M,'T)t={block:'M*('M,'T)Block.t;handler:('M,'T)CatchClause.toption;finalizer:('M*('M,'T)Block.t)option;comments:('M,unit)Syntax.toption;}endmoduleVariableDeclaration:sigmoduleDeclarator:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={id:('M,'T)Pattern.t;init:('M,'T)Expression.toption;}endtype('M,'T)t={declarations:('M,'T)Declarator.tlist;kind:Variable.kind;comments:('M,unit)Syntax.toption;}[@@derivingshow]endmoduleWhile:sigtype('M,'T)t={test:('M,'T)Expression.t;body:('M,'T)Statement.t;comments:('M,unit)Syntax.toption;}endmoduleDoWhile:sigtype('M,'T)t={body:('M,'T)Statement.t;test:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}endmoduleFor:sigtype('M,'T)t={init:('M,'T)initoption;test:('M,'T)Expression.toption;update:('M,'T)Expression.toption;body:('M,'T)Statement.t;comments:('M,unit)Syntax.toption;}and('M,'T)init=|InitDeclarationof('M*('M,'T)VariableDeclaration.t)|InitExpressionof('M,'T)Expression.tendmoduleForIn:sigtype('M,'T)t={left:('M,'T)left;right:('M,'T)Expression.t;body:('M,'T)Statement.t;each:bool;comments:('M,unit)Syntax.toption;}and('M,'T)left=|LeftDeclarationof('M*('M,'T)VariableDeclaration.t)|LeftPatternof('M,'T)Pattern.tendmoduleForOf:sigtype('M,'T)t={left:('M,'T)left;right:('M,'T)Expression.t;body:('M,'T)Statement.t;await:bool;comments:('M,unit)Syntax.toption;}and('M,'T)left=|LeftDeclarationof('M*('M,'T)VariableDeclaration.t)|LeftPatternof('M,'T)Pattern.tendmoduleEnumDeclaration:sigmoduleDefaultedMember:sigtype'Mt='M*'Mt'and'Mt'={id:('M,'M)Identifier.t}[@@derivingshow]endmoduleInitializedMember:sigtype('I,'M)t='M*('I,'M)t'and('I,'M)t'={id:('M,'M)Identifier.t;init:'M*'I;}endmoduleBooleanBody:sigtype'Mt={members:('MBooleanLiteral.t,'M)InitializedMember.tlist;explicit_type:bool;has_unknown_members:bool;comments:('M,'MComment.tlist)Syntax.toption;}endmoduleNumberBody:sigtype'Mt={members:('MNumberLiteral.t,'M)InitializedMember.tlist;explicit_type:bool;has_unknown_members:bool;comments:('M,'MComment.tlist)Syntax.toption;}endmoduleStringBody:sigtype'Mt={members:('MStringLiteral.t,'M)members;explicit_type:bool;has_unknown_members:bool;comments:('M,'MComment.tlist)Syntax.toption;}and('I,'M)members=|Defaultedof'MDefaultedMember.tlist|Initializedof('I,'M)InitializedMember.tlistendmoduleSymbolBody:sigtype'Mt={members:'MDefaultedMember.tlist;has_unknown_members:bool;comments:('M,'MComment.tlist)Syntax.toption;}[@@derivingshow]endmoduleBigIntBody:sigtype'Mt={members:('MBigIntLiteral.t,'M)InitializedMember.tlist;explicit_type:bool;has_unknown_members:bool;comments:('M,'MComment.tlist)Syntax.toption;}[@@derivingshow]endtype('M,'T)t={id:('M,'T)Identifier.t;body:'Mbody;comments:('M,unit)Syntax.toption;}and'Mbody='M*'Mbody'and'Mbody'=|BooleanBodyof'MBooleanBody.t|NumberBodyof'MNumberBody.t|StringBodyof'MStringBody.t|SymbolBodyof'MSymbolBody.t|BigIntBodyof'MBigIntBody.t[@@derivingshow]endmoduleComponentDeclaration:sigmoduleRestParam:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={argument:('M,'T)Pattern.t;comments:('M,unit)Syntax.toption;}[@@derivingshow]endmoduleParam:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={(* Name should only be an Identifier or StringLiteral. However, we allow parsing
it as an option to have better error messages. *)name:('M,'T)param_name;local:('M,'T)Pattern.t;default:('M,'T)Expression.toption;shorthand:bool;}and('M,'T)param_name=|Identifierof('M,'T)Identifier.t|StringLiteralof('M*'MStringLiteral.t)[@@derivingshow]endmoduleParams:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={params:('M,'T)Param.tlist;rest:('M,'T)RestParam.toption;comments:('M,'MComment.tlist)Syntax.toption;}[@@derivingshow]endtype('M,'T)t={id:('M,'T)Identifier.t;tparams:('M,'T)Type.TypeParams.toption;params:('M,'T)Params.t;renders:('M,'T)Type.component_renders_annotation;body:'M*('M,'T)Statement.Block.t;comments:('M,unit)Syntax.toption;(* Location of the signature portion of a component, e.g.
* component Foo(): void {}
* ^^^^^^^^^^^^^^^^^^^^
*)sig_loc:'M;}[@@derivingshow]endmoduleInterface:sigtype('M,'T)t={id:('M,'T)Identifier.t;tparams:('M,'T)Type.TypeParams.toption;extends:('M*('M,'T)Type.Generic.t)list;body:'M*('M,'T)Type.Object.t;comments:('M,unit)Syntax.toption;}endmoduleDeclareClass:sigtype('M,'T)t={id:('M,'T)Identifier.t;tparams:('M,'T)Type.TypeParams.toption;body:'M*('M,'T)Type.Object.t;extends:('M*('M,'T)Type.Generic.t)option;mixins:('M*('M,'T)Type.Generic.t)list;implements:('M,'T)Class.Implements.toption;comments:('M,unit)Syntax.toption;}[@@derivingshow]endmoduleDeclareComponent:sigtype('M,'T)t={id:('M,'T)Identifier.t;tparams:('M,'T)Type.TypeParams.toption;params:('M,'T)Type.Component.Params.t;renders:('M,'T)Type.component_renders_annotation;comments:('M,unit)Syntax.toption;}[@@derivingshow]endmoduleDeclareVariable:sigtype('M,'T)t={id:('M,'T)Identifier.t;annot:('M,'T)Type.annotation;kind:Variable.kind;comments:('M,unit)Syntax.toption;}endmoduleDeclareFunction:sigtype('M,'T)t={id:('M,'T)Identifier.t;annot:('M,'T)Type.annotation;predicate:('M,'T)Type.Predicate.toption;comments:('M,unit)Syntax.toption;}endmoduleDeclareModule:sigtype('M,'T)id=|Identifierof('M,'T)Identifier.t|Literalof('T*'MStringLiteral.t)andmodule_kind=|CommonJS|ESand('M,'T)t={id:('M,'T)id;body:'M*('M,'T)Block.t;kind:module_kind;comments:('M,unit)Syntax.toption;}endmoduleDeclareModuleExports:sigtype('M,'T)t={annot:('M,'T)Type.annotation;comments:('M,unit)Syntax.toption;}endmoduleExportNamedDeclaration:sigmoduleExportSpecifier:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={local:('M,'T)Identifier.t;exported:('M,'T)Identifier.toption;}endmoduleExportBatchSpecifier:sigtype('M,'T)t='M*('M,'T)Identifier.toption[@@derivingshow]endtype('M,'T)t={declaration:('M,'T)Statement.toption;specifiers:('M,'T)specifieroption;source:('T*'MStringLiteral.t)option;export_kind:Statement.export_kind;comments:('M,unit)Syntax.toption;}and('M,'T)specifier=|ExportSpecifiersof('M,'T)ExportSpecifier.tlist|ExportBatchSpecifierof('M,'T)ExportBatchSpecifier.t[@@derivingshow]endmoduleExportDefaultDeclaration:sigtype('M,'T)t={default:'M;declaration:('M,'T)declaration;comments:('M,unit)Syntax.toption;}and('M,'T)declaration=|Declarationof('M,'T)Statement.t|Expressionof('M,'T)Expression.tendmoduleDeclareExportDeclaration:sigtype('M,'T)declaration=(* declare export var *)|Variableof('M*('M,'T)DeclareVariable.t)(* declare export function *)|Functionof('M*('M,'T)DeclareFunction.t)(* declare export class *)|Classof('M*('M,'T)DeclareClass.t)(* declare export component *)|Componentof('M*('M,'T)DeclareComponent.t)(* declare export default [type]
* this corresponds to things like
* export default 1+1; *)|DefaultTypeof('M,'T)Type.t(* declare export type *)|NamedTypeof('M*('M,'T)TypeAlias.t)(* declare export opaque type *)|NamedOpaqueTypeof('M*('M,'T)OpaqueType.t)(* declare export interface *)|Interfaceof('M*('M,'T)Interface.t)(* declare export enum *)|Enumof('M*('M,'T)EnumDeclaration.t)and('M,'T)t={default:'Moption;declaration:('M,'T)declarationoption;specifiers:('M,'T)ExportNamedDeclaration.specifieroption;source:('T*'MStringLiteral.t)option;comments:('M,unit)Syntax.toption;}endmoduleImportDeclaration:sigtypeimport_kind=|ImportType|ImportTypeof|ImportValueand('M,'T)specifier=|ImportNamedSpecifiersof('M,'T)named_specifierlist|ImportNamespaceSpecifierof('M*('M,'T)Identifier.t)and('M,'T)named_specifier={kind:import_kindoption;local:('M,'T)Identifier.toption;remote:('M,'T)Identifier.t;(* Remote name's definition location. It will be populated only in typed AST. *)remote_name_def_loc:'Moption;}and('M,'T)default_identifier={identifier:('M,'T)Identifier.t;(* Remote name's definition location. It will be populated only in typed AST. *)remote_default_name_def_loc:'Moption;}and('M,'T)t={import_kind:import_kind;source:'T*'MStringLiteral.t;default:('M,'T)default_identifieroption;specifiers:('M,'T)specifieroption;comments:('M,unit)Syntax.toption;}endmoduleExpression:sigtype('M,'T)t={expression:('M,'T)Expression.t;directive:stringoption;comments:('M,unit)Syntax.toption;}endmoduleEmpty:sigtype'Mt={comments:('M,unit)Syntax.toption}[@@derivingshow]endtypeexport_kind=|ExportType|ExportValueand('M,'T)t='M*('M,'T)t'and('M,'T)t'=|Blockof('M,'T)Block.t|Breakof'MBreak.t|ClassDeclarationof('M,'T)Class.t|ComponentDeclarationof('M,'T)ComponentDeclaration.t|Continueof'MContinue.t|Debuggerof'MDebugger.t|DeclareClassof('M,'T)DeclareClass.t|DeclareComponentof('M,'T)DeclareComponent.t|DeclareEnumof('M,'T)EnumDeclaration.t|DeclareExportDeclarationof('M,'T)DeclareExportDeclaration.t|DeclareFunctionof('M,'T)DeclareFunction.t|DeclareInterfaceof('M,'T)Interface.t|DeclareModuleof('M,'T)DeclareModule.t|DeclareModuleExportsof('M,'T)DeclareModuleExports.t|DeclareTypeAliasof('M,'T)TypeAlias.t|DeclareOpaqueTypeof('M,'T)OpaqueType.t|DeclareVariableof('M,'T)DeclareVariable.t|DoWhileof('M,'T)DoWhile.t|Emptyof'MEmpty.t|EnumDeclarationof('M,'T)EnumDeclaration.t|ExportDefaultDeclarationof('M,'T)ExportDefaultDeclaration.t|ExportNamedDeclarationof('M,'T)ExportNamedDeclaration.t|Expressionof('M,'T)Expression.t|Forof('M,'T)For.t|ForInof('M,'T)ForIn.t|ForOfof('M,'T)ForOf.t|FunctionDeclarationof('M,'T)Function.t|Ifof('M,'T)If.t|ImportDeclarationof('M,'T)ImportDeclaration.t|InterfaceDeclarationof('M,'T)Interface.t|Labeledof('M,'T)Labeled.t|Returnof('M,'T)Return.t|Switchof('M,'T)Switch.t|Throwof('M,'T)Throw.t|Tryof('M,'T)Try.t|TypeAliasof('M,'T)TypeAlias.t|OpaqueTypeof('M,'T)OpaqueType.t|VariableDeclarationof('M,'T)VariableDeclaration.t|Whileof('M,'T)While.t|Withof('M,'T)With.tend=StatementandExpression:sigmoduleCallTypeArg:sigmoduleImplicit:sigtype('M,'T)t='T*'Mt'and'Mt'={comments:('M,unit)Syntax.toption}[@@derivingshow]endtype('M,'T)t=|Explicitof('M,'T)Type.t|Implicitof('M,'T)Implicit.tendmoduleCallTypeArgs:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={arguments:('M,'T)CallTypeArg.tlist;comments:('M,'MComment.tlist)Syntax.toption;}endmoduleSpreadElement:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={argument:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}endmoduleArray:sigtype('M,'T)element=|Expressionof('M,'T)Expression.t|Spreadof('M,'T)SpreadElement.t|Holeof'Mtype('M,'T)t={elements:('M,'T)elementlist;comments:('M,'MComment.tlist)Syntax.toption;}endmoduleTemplateLiteral:sigmoduleElement:sigtypevalue={raw:string;cooked:string;}and'Mt='M*t'andt'={value:value;tail:bool;}endtype('M,'T)t={quasis:'MElement.tlist;expressions:('M,'T)Expression.tlist;comments:('M,unit)Syntax.toption;}endmoduleTaggedTemplate:sigtype('M,'T)t={tag:('M,'T)Expression.t;quasi:'M*('M,'T)TemplateLiteral.t;comments:('M,unit)Syntax.toption;}endmoduleObject:sigmoduleProperty:sigtype('M,'T)key=|StringLiteralof('T*'MStringLiteral.t)|NumberLiteralof('T*'MNumberLiteral.t)|BigIntLiteralof('T*'MBigIntLiteral.t)|Identifierof('M,'T)Identifier.t|PrivateNameof'MPrivateName.t|Computedof('M,'T)ComputedKey.tand('M,'T)t='M*('M,'T)t'and('M,'T)t'=|Initof{key:('M,'T)key;value:('M,'T)Expression.t;shorthand:bool;}|Methodof{key:('M,'T)key;value:'M*('M,'T)Function.t;}|Getof{key:('M,'T)key;value:'M*('M,'T)Function.t;comments:('M,unit)Syntax.toption;}|Setof{key:('M,'T)key;value:'M*('M,'T)Function.t;comments:('M,unit)Syntax.toption;}endmoduleSpreadProperty:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={argument:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}endtype('M,'T)property=|Propertyof('M,'T)Property.t|SpreadPropertyof('M,'T)SpreadProperty.tand('M,'T)t={properties:('M,'T)propertylist;comments:('M,'MComment.tlist)Syntax.toption;}endmoduleSequence:sigtype('M,'T)t={expressions:('M,'T)Expression.tlist;comments:('M,unit)Syntax.toption;}endmoduleUnary:sigtypeoperator=|Minus|Plus|Not|BitNot|Typeof|Void|Delete|Awaitand('M,'T)t={operator:operator;argument:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}endmoduleBinary:sigtypeoperator=|Equal|NotEqual|StrictEqual|StrictNotEqual|LessThan|LessThanEqual|GreaterThan|GreaterThanEqual|LShift|RShift|RShift3|Plus|Minus|Mult|Exp|Div|Mod|BitOr|Xor|BitAnd|In|Instanceofand('M,'T)t={operator:operator;left:('M,'T)Expression.t;right:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}endmoduleAssignment:sigtypeoperator=|PlusAssign|MinusAssign|MultAssign|ExpAssign|DivAssign|ModAssign|LShiftAssign|RShiftAssign|RShift3Assign|BitOrAssign|BitXorAssign|BitAndAssign|NullishAssign|AndAssign|OrAssignand('M,'T)t={operator:operatoroption;left:('M,'T)Pattern.t;right:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}endmoduleUpdate:sigtypeoperator=|Increment|Decrementand('M,'T)t={operator:operator;argument:('M,'T)Expression.t;prefix:bool;comments:('M,unit)Syntax.toption;}endmoduleLogical:sigtypeoperator=|Or|And|NullishCoalesceand('M,'T)t={operator:operator;left:('M,'T)Expression.t;right:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}endmoduleConditional:sigtype('M,'T)t={test:('M,'T)Expression.t;consequent:('M,'T)Expression.t;alternate:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}endtype('M,'T)expression_or_spread=|Expressionof('M,'T)Expression.t|Spreadof('M,'T)SpreadElement.tmoduleArgList:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={arguments:('M,'T)expression_or_spreadlist;comments:('M,'MComment.tlist)Syntax.toption;}endmoduleNew:sigtype('M,'T)t={callee:('M,'T)Expression.t;targs:('M,'T)Expression.CallTypeArgs.toption;arguments:('M,'T)ArgList.toption;comments:('M,unit)Syntax.toption;}endmoduleCall:sigtype('M,'T)t={callee:('M,'T)Expression.t;targs:('M,'T)Expression.CallTypeArgs.toption;arguments:('M,'T)ArgList.t;comments:('M,unit)Syntax.toption;}endmoduleOptionalCall:sigtype('M,'T)t={call:('M,'T)Call.t;filtered_out:'T;optional:bool;}endmoduleMember:sigtype('M,'T)property=|PropertyIdentifierof('M,'T)Identifier.t|PropertyPrivateNameof'MPrivateName.t|PropertyExpressionof('M,'T)Expression.tand('M,'T)t={_object:('M,'T)Expression.t;property:('M,'T)property;comments:('M,unit)Syntax.toption;}endmoduleOptionalMember:sigtype('M,'T)t={member:('M,'T)Member.t;filtered_out:'T;optional:bool;}endmoduleYield:sigtype('M,'T)t={argument:('M,'T)Expression.toption;comments:('M,unit)Syntax.toption;delegate:bool;result_out:'T;}endmoduleTypeCast:sigtype('M,'T)t={expression:('M,'T)Expression.t;annot:('M,'T)Type.annotation;comments:('M,unit)Syntax.toption;}endmoduleAsExpression:sigtype('M,'T)t={expression:('M,'T)Expression.t;annot:('M,'T)Type.annotation;comments:('M,unit)Syntax.toption;}endmoduleTSTypeCast:sigtype('M,'T)kind=|AsConst|Satisfiesof('M,'T)Type.t[@@derivingshow]type('M,'T)t={expression:('M,'T)Expression.t;kind:('M,'T)kind;comments:('M,unit)Syntax.toption;}endmoduleMetaProperty:sigtype'Mt={meta:('M,'M)Identifier.t;property:('M,'M)Identifier.t;comments:('M,unit)Syntax.toption;}endmoduleThis:sigtype'Mt={comments:('M,unit)Syntax.toption}[@@derivingshow]endmoduleSuper:sigtype'Mt={comments:('M,unit)Syntax.toption}[@@derivingshow]endmoduleImport:sigtype('M,'T)t={argument:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}endtype('M,'T)t='T*('M,'T)t'and('M,'T)t'=|Arrayof('M,'T)Array.t|ArrowFunctionof('M,'T)Function.t|AsExpressionof('M,'T)AsExpression.t|Assignmentof('M,'T)Assignment.t|Binaryof('M,'T)Binary.t|Callof('M,'T)Call.t|Classof('M,'T)Class.t|Conditionalof('M,'T)Conditional.t|Functionof('M,'T)Function.t|Identifierof('M,'T)Identifier.t|Importof('M,'T)Import.t|JSXElementof('M,'T)JSX.element|JSXFragmentof('M,'T)JSX.fragment|StringLiteralof'MStringLiteral.t|BooleanLiteralof'MBooleanLiteral.t|NullLiteralof('M,unit)Syntax.toption|NumberLiteralof'MNumberLiteral.t|BigIntLiteralof'MBigIntLiteral.t|RegExpLiteralof'MRegExpLiteral.t|ModuleRefLiteralof('M,'T)ModuleRefLiteral.t|Logicalof('M,'T)Logical.t|Memberof('M,'T)Member.t|MetaPropertyof'MMetaProperty.t|Newof('M,'T)New.t|Objectof('M,'T)Object.t|OptionalCallof('M,'T)OptionalCall.t|OptionalMemberof('M,'T)OptionalMember.t|Sequenceof('M,'T)Sequence.t|Superof'MSuper.t|TaggedTemplateof('M,'T)TaggedTemplate.t|TemplateLiteralof('M,'T)TemplateLiteral.t|Thisof'MThis.t|TypeCastof('M,'T)TypeCast.t|TSTypeCastof('M,'T)TSTypeCast.t|Unaryof('M,'T)Unary.t|Updateof('M,'T)Update.t|Yieldof('M,'T)Yield.tend=ExpressionandJSX:sigmoduleIdentifier:sigtype('M,'T)t='T*'Mt'and'Mt'={name:string;comments:('M,unit)Syntax.toption;}endmoduleNamespacedName:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={namespace:('M,'T)Identifier.t;name:('M,'T)Identifier.t;}endmoduleExpressionContainer:sigtype('M,'T)t={expression:('M,'T)expression;comments:('M,'MComment.tlist)Syntax.toption;}and('M,'T)expression=|Expressionof('M,'T)Expression.t|EmptyExpressionendmoduleText:sigtypet={value:string;raw:string;}endmoduleAttribute:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)name=|Identifierof('M,'T)Identifier.t|NamespacedNameof('M,'T)NamespacedName.tand('M,'T)value=|StringLiteralof('T*'MStringLiteral.t)|ExpressionContainerof('T*('M,'T)ExpressionContainer.t)and('M,'T)t'={name:('M,'T)name;value:('M,'T)valueoption;}endmoduleSpreadAttribute:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={argument:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}endmoduleMemberExpression:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)_object=|Identifierof('M,'T)Identifier.t|MemberExpressionof('M,'T)tand('M,'T)t'={_object:('M,'T)_object;property:('M,'T)Identifier.t;}endtype('M,'T)name=|Identifierof('M,'T)Identifier.t|NamespacedNameof('M,'T)NamespacedName.t|MemberExpressionof('M,'T)MemberExpression.tmoduleOpening:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)attribute=|Attributeof('M,'T)Attribute.t|SpreadAttributeof('M,'T)SpreadAttribute.tand('M,'T)t'={name:('M,'T)name;targs:('M,'T)Expression.CallTypeArgs.toption;self_closing:bool;attributes:('M,'T)attributelist;}endmoduleClosing:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={name:('M,'T)name}[@@derivingshow]endmoduleSpreadChild:sigtype('M,'T)t={expression:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}endtype('M,'T)child='M*('M,'T)child'and('M,'T)child'=|Elementof('M,'T)element|Fragmentof('M,'T)fragment|ExpressionContainerof('M,'T)ExpressionContainer.t|SpreadChildof('M,'T)SpreadChild.t|TextofText.tand('M,'T)element={opening_element:('M,'T)Opening.t;closing_element:('M,'T)Closing.toption;children:'M*('M,'T)childlist;comments:('M,unit)Syntax.toption;}and('M,'T)fragment={frag_opening_element:'M;frag_closing_element:'M;frag_children:'M*('M,'T)childlist;frag_comments:('M,unit)Syntax.toption;}end=JSXandPattern:sigmoduleRestElement:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={argument:('M,'T)Pattern.t;comments:('M,unit)Syntax.toption;}endmoduleObject:sigmoduleProperty:sigtype('M,'T)key=|StringLiteralof('M*'MStringLiteral.t)|NumberLiteralof('M*'MNumberLiteral.t)|BigIntLiteralof('M*'MBigIntLiteral.t)|Identifierof('M,'T)Identifier.t|Computedof('M,'T)ComputedKey.tand('M,'T)t='M*('M,'T)t'and('M,'T)t'={key:('M,'T)key;pattern:('M,'T)Pattern.t;default:('M,'T)Expression.toption;shorthand:bool;}endtype('M,'T)property=|Propertyof('M,'T)Property.t|RestElementof('M,'T)RestElement.tand('M,'T)t={properties:('M,'T)propertylist;annot:('M,'T)Type.annotation_or_hint;comments:('M,'MComment.tlist)Syntax.toption;}endmoduleArray:sigmoduleElement:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={argument:('M,'T)Pattern.t;default:('M,'T)Expression.toption;}endtype('M,'T)element=|Elementof('M,'T)Element.t|RestElementof('M,'T)RestElement.t|Holeof'Mand('M,'T)t={elements:('M,'T)elementlist;annot:('M,'T)Type.annotation_or_hint;comments:('M,'MComment.tlist)Syntax.toption;}endmoduleIdentifier:sigtype('M,'T)t={name:('M,'T)Identifier.t;annot:('M,'T)Type.annotation_or_hint;optional:bool;}endtype('M,'T)t='T*('M,'T)t'and('M,'T)t'=|Objectof('M,'T)Object.t|Arrayof('M,'T)Array.t|Identifierof('M,'T)Identifier.t|Expressionof('M,'T)Expression.tend=PatternandComment:sigtype'Mt='M*t'andkind=|Block|Lineandt'={kind:kind;text:string;on_newline:bool;}end=CommentandClass:sigmoduleMethod:sigtype('M,'T)t='T*('M,'T)t'andkind=|Constructor|Method|Get|Setand('M,'T)t'={kind:kind;key:('M,'T)Expression.Object.Property.key;value:'M*('M,'T)Function.t;static:bool;decorators:('M,'T)Class.Decorator.tlist;comments:('M,unit)Syntax.toption;}endmoduleProperty:sigtype('M,'T)t='T*('M,'T)t'and('M,'T)t'={key:('M,'T)Expression.Object.Property.key;value:('M,'T)value;annot:('M,'T)Type.annotation_or_hint;static:bool;variance:'MVariance.toption;decorators:('M,'T)Class.Decorator.tlist;comments:('M,unit)Syntax.toption;}and('M,'T)value=|Declared|Uninitialized|Initializedof('M,'T)Expression.tendmodulePrivateField:sigtype('M,'T)t='T*('M,'T)t'and('M,'T)t'={key:'MPrivateName.t;value:('M,'T)Class.Property.value;annot:('M,'T)Type.annotation_or_hint;static:bool;variance:'MVariance.toption;decorators:('M,'T)Class.Decorator.tlist;comments:('M,unit)Syntax.toption;}endmoduleExtends:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={expr:('M,'T)Expression.t;targs:('M,'T)Type.TypeArgs.toption;comments:('M,unit)Syntax.toption;}endmoduleImplements:sigmoduleInterface:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={id:('M,'T)Identifier.t;targs:('M,'T)Type.TypeArgs.toption;}endtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={interfaces:('M,'T)Interface.tlist;comments:('M,unit)Syntax.toption;}endmoduleBody:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={body:('M,'T)elementlist;comments:('M,unit)Syntax.toption;}and('M,'T)element=|Methodof('M,'T)Method.t|Propertyof('M,'T)Property.t|PrivateFieldof('M,'T)PrivateField.tendmoduleDecorator:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={expression:('M,'T)Expression.t;comments:('M,unit)Syntax.toption;}endtype('M,'T)t={id:('M,'T)Identifier.toption;body:('M,'T)Class.Body.t;tparams:('M,'T)Type.TypeParams.toption;extends:('M,'T)Extends.toption;implements:('M,'T)Implements.toption;class_decorators:('M,'T)Decorator.tlist;comments:('M,unit)Syntax.toption;}end=ClassandFunction:sigmoduleRestParam:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={argument:('M,'T)Pattern.t;comments:('M,unit)Syntax.toption;}endmoduleParam:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={argument:('M,'T)Pattern.t;default:('M,'T)Expression.toption;}endmoduleThisParam:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={annot:('M,'T)Type.annotation;comments:('M,unit)Syntax.toption;}endmoduleParams:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={this_:('M,'T)ThisParam.toption;params:('M,'T)Param.tlist;rest:('M,'T)RestParam.toption;comments:('M,'MComment.tlist)Syntax.toption;}[@@derivingshow]endmoduleReturnAnnot:sigtype('M,'T)t=|Missingof'T|Availableof('M,'T)Type.annotation|TypeGuardof('M,'T)Type.type_guard_annotation[@@derivingshow]endtype('M,'T)t={id:('M,'T)Identifier.toption;params:('M,'T)Params.t;body:('M,'T)body;async:bool;generator:bool;predicate:('M,'T)Type.Predicate.toption;return:('M,'T)ReturnAnnot.t;tparams:('M,'T)Type.TypeParams.toption;comments:('M,unit)Syntax.toption;(* Location of the signature portion of a function, e.g.
* function foo(): void {}
* ^^^^^^^^^^^^^^^^^^^^
*)sig_loc:'M;}and('M,'T)body=|BodyBlockof('M*('M,'T)Statement.Block.t)|BodyExpressionof('M,'T)Expression.tend=FunctionandProgram:sigtype('M,'T)t='M*('M,'T)t'and('M,'T)t'={statements:('M,'T)Statement.tlist;interpreter:('M*string)option;(** interpreter directive / shebang *)comments:('M,unit)Syntax.toption;all_comments:'MComment.tlist;}end=Program