index.d.cts 82 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063
  1. import ts from 'typescript';
  2. /**
  3. * Callback type used for {@link forEachComment}.
  4. * @category Callbacks
  5. */
  6. type ForEachCommentCallback = (fullText: string, comment: ts.CommentRange) => void;
  7. /**
  8. * Iterates over all comments owned by `node` or its children.
  9. * @category Nodes - Other Utilities
  10. * @example
  11. * ```ts
  12. * declare const node: ts.Node;
  13. *
  14. * forEachComment(node, (fullText, comment) => {
  15. * console.log(`Found comment at position ${comment.pos}: '${fullText}'.`);
  16. * });
  17. * ```
  18. */
  19. declare function forEachComment(node: ts.Node, callback: ForEachCommentCallback, sourceFile?: ts.SourceFile): void;
  20. /**
  21. * An option that can be tested with {@link isCompilerOptionEnabled}.
  22. * @category Compiler Options
  23. */
  24. type BooleanCompilerOptions = keyof {
  25. [K in keyof ts.CompilerOptions as NonNullable<ts.CompilerOptions[K]> extends boolean ? K : never]: unknown;
  26. };
  27. /**
  28. * Checks if a given compiler option is enabled.
  29. * It handles dependencies of options, e.g. `declaration` is implicitly enabled by `composite` or `strictNullChecks` is enabled by `strict`.
  30. * However, it does not check dependencies that are already checked and reported as errors, e.g. `checkJs` without `allowJs`.
  31. * This function only handles boolean flags.
  32. * @category Compiler Options
  33. * @example
  34. * ```ts
  35. * const options = {
  36. * allowJs: true,
  37. * };
  38. *
  39. * isCompilerOptionEnabled(options, "allowJs"); // true
  40. * isCompilerOptionEnabled(options, "allowSyntheticDefaultImports"); // false
  41. * ```
  42. */
  43. declare function isCompilerOptionEnabled(options: ts.CompilerOptions, option: BooleanCompilerOptions): boolean;
  44. /**
  45. * An option that can be tested with {@link isStrictCompilerOptionEnabled}.
  46. * @category Compiler Options
  47. */
  48. type StrictCompilerOption = "alwaysStrict" | "noImplicitAny" | "noImplicitThis" | "strictBindCallApply" | "strictFunctionTypes" | "strictNullChecks" | "strictPropertyInitialization";
  49. /**
  50. * Checks if a given compiler option is enabled, accounting for whether all flags
  51. * (except `strictPropertyInitialization`) have been enabled by `strict: true`.
  52. * @category Compiler Options
  53. * @example
  54. * ```ts
  55. * const optionsLenient = {
  56. * noImplicitAny: true,
  57. * };
  58. *
  59. * isStrictCompilerOptionEnabled(optionsLenient, "noImplicitAny"); // true
  60. * isStrictCompilerOptionEnabled(optionsLenient, "noImplicitThis"); // false
  61. * ```
  62. * @example
  63. * ```ts
  64. * const optionsStrict = {
  65. * noImplicitThis: false,
  66. * strict: true,
  67. * };
  68. *
  69. * isStrictCompilerOptionEnabled(optionsStrict, "noImplicitAny"); // true
  70. * isStrictCompilerOptionEnabled(optionsStrict, "noImplicitThis"); // false
  71. * ```
  72. */
  73. declare function isStrictCompilerOptionEnabled(options: ts.CompilerOptions, option: StrictCompilerOption): boolean;
  74. /**
  75. * Test if the given node has the given `ModifierFlags` set.
  76. * @category Nodes - Flag Utilities
  77. * @example
  78. * ```ts
  79. * declare const node: ts.Node;
  80. *
  81. * if (isModifierFlagSet(node, ts.ModifierFlags.Abstract)) {
  82. * // ...
  83. * }
  84. * ```
  85. */
  86. declare function isModifierFlagSet(node: ts.Declaration, flag: ts.ModifierFlags): boolean;
  87. /**
  88. * Test if the given node has the given `NodeFlags` set.
  89. * @category Nodes - Flag Utilities
  90. * @example
  91. * ```ts
  92. * declare const node: ts.Node;
  93. *
  94. * if (isNodeFlagSet(node, ts.NodeFlags.AwaitContext)) {
  95. * // ...
  96. * }
  97. * ```
  98. */
  99. declare const isNodeFlagSet: (node: ts.Node, flag: ts.NodeFlags) => boolean;
  100. /**
  101. * Test if the given node has the given `ObjectFlags` set.
  102. * @category Nodes - Flag Utilities
  103. * @example
  104. * ```ts
  105. * declare const node: ts.Node;
  106. *
  107. * if (isObjectFlagSet(node, ts.ObjectFlags.Anonymous)) {
  108. * // ...
  109. * }
  110. * ```
  111. */
  112. declare function isObjectFlagSet(objectType: ts.ObjectType, flag: ts.ObjectFlags): boolean;
  113. /**
  114. * Test if the given node has the given `SymbolFlags` set.
  115. * @category Nodes - Flag Utilities
  116. * @example
  117. * ```ts
  118. * declare const symbol: ts.Symbol;
  119. *
  120. * if (isSymbolFlagSet(symbol, ts.SymbolFlags.Accessor)) {
  121. * // ...
  122. * }
  123. * ```
  124. */
  125. declare const isSymbolFlagSet: (symbol: ts.Symbol, flag: ts.SymbolFlags) => boolean;
  126. /**
  127. * Test if the given symbol's links has the given `CheckFlags` set.
  128. * @internal
  129. */
  130. declare function isTransientSymbolLinksFlagSet(links: ts.TransientSymbolLinks, flag: ts.CheckFlags): boolean;
  131. /**
  132. * Test if the given node has the given `TypeFlags` set.
  133. * @category Nodes - Flag Utilities
  134. * @example
  135. * ```ts
  136. * declare const type: ts.Type;
  137. *
  138. * if (isTypeFlagSet(type, ts.TypeFlags.Any)) {
  139. * // ...
  140. * }
  141. * ```
  142. */
  143. declare const isTypeFlagSet: (type: ts.Type, flag: ts.TypeFlags) => boolean;
  144. /**
  145. * Test if the given iterable includes a modifier of any of the given kinds.
  146. * @category Modifier Utilities
  147. * @example
  148. * ```ts
  149. * declare const modifiers: ts.Modifier[];
  150. *
  151. * includesModifier(modifiers, ts.SyntaxKind.AbstractKeyword);
  152. * ```
  153. */
  154. declare function includesModifier(modifiers: Iterable<ts.ModifierLike> | undefined, ...kinds: ts.ModifierSyntaxKind[]): boolean;
  155. /**
  156. * What operations(s), if any, an expression applies.
  157. */
  158. declare enum AccessKind {
  159. None = 0,
  160. Read = 1,
  161. Write = 2,
  162. Delete = 4,
  163. ReadWrite = 3
  164. }
  165. /**
  166. * Determines which operation(s), if any, an expression applies.
  167. * @example
  168. * ```ts
  169. * declare const node: ts.Expression;
  170. *
  171. * if (getAccessKind(node).Write & AccessKind.Write) !== 0) {
  172. * // this is a reassignment (write)
  173. * }
  174. * ```
  175. */
  176. declare function getAccessKind(node: ts.Expression): AccessKind;
  177. /**
  178. * An `AssertionExpression` that is declared as const.
  179. * @category Node Types
  180. */
  181. type ConstAssertionExpression = {
  182. type: ts.TypeReferenceNode;
  183. typeName: ConstAssertionIdentifier;
  184. } & ts.AssertionExpression;
  185. /**
  186. * An `Identifier` with an `escapedText` value of `"const"`.
  187. * @category Node Types
  188. */
  189. type ConstAssertionIdentifier = {
  190. escapedText: "const" & ts.__String;
  191. } & ts.Identifier;
  192. /**
  193. * Test if a node is a {@link ConstAssertionExpression}.
  194. * @category Nodes - Type Guards
  195. * @example
  196. * ```ts
  197. * declare const node: ts.Node;
  198. *
  199. * if (isConstAssertionExpression(node)) {
  200. * // ...
  201. * }
  202. * ```
  203. * @returns Whether the given node appears to be a {@link ConstAssertionExpression}.
  204. */
  205. declare function isConstAssertionExpression(node: ts.AssertionExpression): node is ConstAssertionExpression;
  206. /**
  207. * Test if a node is an `IterationStatement`.
  208. * @category Nodes - Type Guards
  209. * @example
  210. * ```ts
  211. * declare const node: ts.Node;
  212. *
  213. * if (isIterationStatement(node)) {
  214. * // ...
  215. * }
  216. * ```
  217. * @returns Whether the given node appears to be an `IterationStatement`.
  218. */
  219. declare function isIterationStatement(node: ts.Node): node is ts.IterationStatement;
  220. /**
  221. * Test if a node is a `JSDocNamespaceDeclaration`.
  222. * @category Nodes - Type Guards
  223. * @example
  224. * ```ts
  225. * declare const node: ts.Node;
  226. *
  227. * if (isJSDocNamespaceDeclaration(node)) {
  228. * // ...
  229. * }
  230. * ```
  231. * @returns Whether the given node appears to be a `JSDocNamespaceDeclaration`.
  232. */
  233. declare function isJSDocNamespaceDeclaration(node: ts.Node): node is ts.JSDocNamespaceDeclaration;
  234. /**
  235. * Test if a node is a `JsxTagNamePropertyAccess`.
  236. * @category Nodes - Type Guards
  237. * @example
  238. * ```ts
  239. * declare const node: ts.Node;
  240. *
  241. * if (isJsxTagNamePropertyAccess(node)) {
  242. * // ...
  243. * }
  244. * ```
  245. * @returns Whether the given node appears to be a `JsxTagNamePropertyAccess`.
  246. */
  247. declare function isJsxTagNamePropertyAccess(node: ts.Node): node is ts.JsxTagNamePropertyAccess;
  248. /**
  249. * a `NamedDeclaration` that definitely has a name.
  250. * @category Node Types
  251. */
  252. interface NamedDeclarationWithName extends ts.NamedDeclaration {
  253. name: ts.DeclarationName;
  254. }
  255. /**
  256. * Test if a node is a {@link NamedDeclarationWithName}.
  257. * @category Nodes - Type Guards
  258. * @example
  259. * ```ts
  260. * declare const node: ts.Node;
  261. *
  262. * if (isNamedDeclarationWithName(node)) {
  263. * // ...
  264. * }
  265. * ```
  266. * @returns Whether the given node appears to be a {@link NamedDeclarationWithName}.
  267. */
  268. declare function isNamedDeclarationWithName(node: ts.Declaration): node is NamedDeclarationWithName;
  269. /**
  270. * Test if a node is a `NamespaceDeclaration`.
  271. * @category Nodes - Type Guards
  272. * @example
  273. * ```ts
  274. * declare const node: ts.Node;
  275. *
  276. * if (isNamespaceDeclaration(node)) {
  277. * // ...
  278. * }
  279. * ```
  280. * @returns Whether the given node appears to be a `NamespaceDeclaration`.
  281. */
  282. declare function isNamespaceDeclaration(node: ts.Node): node is ts.NamespaceDeclaration;
  283. /**
  284. * A number or string-like literal.
  285. * @category Node Types
  286. */
  287. type NumericOrStringLikeLiteral = ts.NumericLiteral | ts.StringLiteralLike;
  288. /**
  289. * Test if a node is a {@link NumericOrStringLikeLiteral}.
  290. * @category Nodes - Type Guards
  291. * @example
  292. * ```ts
  293. * declare const node: ts.Node;
  294. *
  295. * if (isNumericOrStringLikeLiteral(node)) {
  296. * // ...
  297. * }
  298. * ```
  299. * @returns Whether the given node appears to be a {@link NumericOrStringLikeLiteral}.
  300. */
  301. declare function isNumericOrStringLikeLiteral(node: ts.Node): node is NumericOrStringLikeLiteral;
  302. /**
  303. * Test if a node is a `PropertyAccessEntityNameExpression`.
  304. * @category Nodes - Type Guards
  305. * @example
  306. * ```ts
  307. * declare const node: ts.Node;
  308. *
  309. * if (isPropertyAccessEntityNameExpression(node)) {
  310. * // ...
  311. * }
  312. * ```
  313. * @returns Whether the given node appears to be a `PropertyAccessEntityNameExpression`.
  314. */
  315. declare function isPropertyAccessEntityNameExpression(node: ts.Node): node is ts.PropertyAccessEntityNameExpression;
  316. /**
  317. * Test if a node is a `SuperElementAccessExpression`.
  318. * @category Nodes - Type Guards
  319. * @example
  320. * ```ts
  321. * declare const node: ts.Node;
  322. *
  323. * if (isSuperElementAccessExpression(node)) {
  324. * // ...
  325. * }
  326. * ```
  327. * @returns Whether the given node appears to be a `SuperElementAccessExpression`.
  328. */
  329. declare function isSuperElementAccessExpression(node: ts.Node): node is ts.SuperElementAccessExpression;
  330. /**
  331. * Test if a node is a `SuperPropertyAccessExpression`.
  332. * @category Nodes - Type Guards
  333. * @example
  334. * ```ts
  335. * declare const node: ts.Node;
  336. *
  337. * if (isSuperPropertyAccessExpression(node)) {
  338. * // ...
  339. * }
  340. * ```
  341. * @returns Whether the given node appears to be a `SuperPropertyAccessExpression`.
  342. */
  343. declare function isSuperPropertyAccessExpression(node: ts.Node): node is ts.SuperPropertyAccessExpression;
  344. /**
  345. * A node that represents the any keyword.
  346. * @category Node Types
  347. */
  348. type AnyKeyword = ts.KeywordToken<ts.SyntaxKind.AnyKeyword>;
  349. /**
  350. * A node that represents the bigint keyword.
  351. * @category Node Types
  352. */
  353. type BigIntKeyword = ts.KeywordToken<ts.SyntaxKind.BigIntKeyword>;
  354. /**
  355. * A node that represents the boolean keyword.
  356. * @category Node Types
  357. */
  358. type BooleanKeyword = ts.KeywordToken<ts.SyntaxKind.BooleanKeyword>;
  359. /**
  360. * A node that represents the false keyword.
  361. * @category Node Types
  362. */
  363. type FalseKeyword = ts.KeywordToken<ts.SyntaxKind.FalseKeyword>;
  364. /**
  365. * A node that represents the import keyword.
  366. * @category Node Types
  367. */
  368. type ImportKeyword = ts.KeywordToken<ts.SyntaxKind.ImportKeyword>;
  369. /**
  370. * A node that represents the never keyword.
  371. * @category Node Types
  372. */
  373. type NeverKeyword = ts.KeywordToken<ts.SyntaxKind.NeverKeyword>;
  374. /**
  375. * A node that represents the null keyword.
  376. * @category Node Types
  377. */
  378. type NullKeyword = ts.KeywordToken<ts.SyntaxKind.NullKeyword>;
  379. /**
  380. * A node that represents the number keyword.
  381. * @category Node Types
  382. */
  383. type NumberKeyword = ts.KeywordToken<ts.SyntaxKind.NumberKeyword>;
  384. /**
  385. * A node that represents the object keyword.
  386. * @category Node Types
  387. */
  388. type ObjectKeyword = ts.KeywordToken<ts.SyntaxKind.ObjectKeyword>;
  389. /**
  390. * A node that represents the string keyword.
  391. * @category Node Types
  392. */
  393. type StringKeyword = ts.KeywordToken<ts.SyntaxKind.StringKeyword>;
  394. /**
  395. * A node that represents the super keyword.
  396. * @category Node Types
  397. */
  398. type SuperKeyword = ts.KeywordToken<ts.SyntaxKind.SuperKeyword>;
  399. /**
  400. * A node that represents the symbol keyword.
  401. * @category Node Types
  402. */
  403. type SymbolKeyword = ts.KeywordToken<ts.SyntaxKind.SymbolKeyword>;
  404. /**
  405. * A node that represents the this keyword.
  406. * @category Node Types
  407. */
  408. type ThisKeyword = ts.KeywordToken<ts.SyntaxKind.ThisKeyword>;
  409. /**
  410. * A node that represents the true keyword.
  411. * @category Node Types
  412. */
  413. type TrueKeyword = ts.KeywordToken<ts.SyntaxKind.TrueKeyword>;
  414. /**
  415. * A node that represents the undefined keyword.
  416. * @category Node Types
  417. */
  418. type UndefinedKeyword = ts.KeywordToken<ts.SyntaxKind.UndefinedKeyword>;
  419. /**
  420. * A node that represents the unknown keyword.
  421. * @category Node Types
  422. */
  423. type UnknownKeyword = ts.KeywordToken<ts.SyntaxKind.UnknownKeyword>;
  424. /**
  425. * A node that represents the void keyword.
  426. * @category Node Types
  427. */
  428. type VoidKeyword = ts.KeywordToken<ts.SyntaxKind.VoidKeyword>;
  429. /**
  430. * Test if a node is an `AbstractKeyword`.
  431. * @category Nodes - Type Guards
  432. * @example
  433. * ```ts
  434. * declare const node: ts.Node;
  435. *
  436. * if (isAbstractKeyword(node)) {
  437. * // ...
  438. * }
  439. * ```
  440. * @returns Whether the given node appears to be an `AbstractKeyword`.
  441. */
  442. declare function isAbstractKeyword(node: ts.Node): node is ts.AbstractKeyword;
  443. /**
  444. * Test if a node is an `AccessorKeyword`.
  445. * @category Nodes - Type Guards
  446. * @example
  447. * ```ts
  448. * declare const node: ts.Node;
  449. *
  450. * if (isAccessorKeyword(node)) {
  451. * // ...
  452. * }
  453. * ```
  454. * @returns Whether the given node appears to be an `AccessorKeyword`.
  455. */
  456. declare function isAccessorKeyword(node: ts.Node): node is ts.AccessorKeyword;
  457. /**
  458. * Test if a node is an {@link AnyKeyword}.
  459. * @category Nodes - Type Guards
  460. * @example
  461. * ```ts
  462. * declare const node: ts.Node;
  463. *
  464. * if (isAnyKeyword(node)) {
  465. * // ...
  466. * }
  467. * ```
  468. * @returns Whether the given node appears to be an {@link AnyKeyword}.
  469. */
  470. declare function isAnyKeyword(node: ts.Node): node is AnyKeyword;
  471. /**
  472. * Test if a node is an `AssertKeyword`.
  473. * @category Nodes - Type Guards
  474. * @example
  475. * ```ts
  476. * declare const node: ts.Node;
  477. *
  478. * if (isAssertKeyword(node)) {
  479. * // ...
  480. * }
  481. * ```
  482. * @returns Whether the given node appears to be an `AssertKeyword`.
  483. */
  484. declare function isAssertKeyword(node: ts.Node): node is ts.AssertKeyword;
  485. /**
  486. * Test if a node is an `AssertsKeyword`.
  487. * @deprecated With TypeScript v5, in favor of typescript's `isAssertsKeyword`.
  488. * @category Nodes - Type Guards
  489. * @example
  490. * ```ts
  491. * declare const node: ts.Node;
  492. *
  493. * if (isAssertsKeyword(node)) {
  494. * // ...
  495. * }
  496. * ```
  497. * @returns Whether the given node appears to be an `AssertsKeyword`.
  498. */
  499. declare function isAssertsKeyword(node: ts.Node): node is ts.AssertsKeyword;
  500. /**
  501. * Test if a node is an `AsyncKeyword`.
  502. * @category Nodes - Type Guards
  503. * @example
  504. * ```ts
  505. * declare const node: ts.Node;
  506. *
  507. * if (isAsyncKeyword(node)) {
  508. * // ...
  509. * }
  510. * ```
  511. * @returns Whether the given node appears to be an `AsyncKeyword`.
  512. */
  513. declare function isAsyncKeyword(node: ts.Node): node is ts.AsyncKeyword;
  514. /**
  515. * Test if a node is an `AwaitKeyword`.
  516. * @deprecated With TypeScript v5, in favor of typescript's `isAwaitKeyword`.
  517. * @category Nodes - Type Guards
  518. * @example
  519. * ```ts
  520. * declare const node: ts.Node;
  521. *
  522. * if (isAwaitKeyword(node)) {
  523. * // ...
  524. * }
  525. * ```
  526. * @returns Whether the given node appears to be an `AwaitKeyword`.
  527. */
  528. declare function isAwaitKeyword(node: ts.Node): node is ts.AwaitKeyword;
  529. /**
  530. * Test if a node is a {@link BigIntKeyword}.
  531. * @deprecated With TypeScript v5, in favor of typescript's `isBigIntKeyword`.
  532. * @category Nodes - Type Guards
  533. * @example
  534. * ```ts
  535. * declare const node: ts.Node;
  536. *
  537. * if (isBigIntKeyword(node)) {
  538. * // ...
  539. * }
  540. * ```
  541. * @returns Whether the given node appears to be a {@link BigIntKeyword}.
  542. */
  543. declare function isBigIntKeyword(node: ts.Node): node is BigIntKeyword;
  544. /**
  545. * Test if a node is a {@link BooleanKeyword}.
  546. * @deprecated With TypeScript v5, in favor of typescript's `isBooleanKeyword`.
  547. * @category Nodes - Type Guards
  548. * @example
  549. * ```ts
  550. * declare const node: ts.Node;
  551. *
  552. * if (isBooleanKeyword(node)) {
  553. * // ...
  554. * }
  555. * ```
  556. * @returns Whether the given node appears to be a {@link BooleanKeyword}.
  557. */
  558. declare function isBooleanKeyword(node: ts.Node): node is BooleanKeyword;
  559. /**
  560. * Test if a node is a `ColonToken`.
  561. * @deprecated With TypeScript v5, in favor of typescript's `isColonToken`.
  562. * @category Nodes - Type Guards
  563. * @example
  564. * ```ts
  565. * declare const node: ts.Node;
  566. *
  567. * if (isColonToken(node)) {
  568. * // ...
  569. * }
  570. * ```
  571. * @returns Whether the given node appears to be a `ColonToken`.
  572. */
  573. declare function isColonToken(node: ts.Node): node is ts.ColonToken;
  574. /**
  575. * Test if a node is a `ConstKeyword`.
  576. * @category Nodes - Type Guards
  577. * @example
  578. * ```ts
  579. * declare const node: ts.Node;
  580. *
  581. * if (isConstKeyword(node)) {
  582. * // ...
  583. * }
  584. * ```
  585. * @returns Whether the given node appears to be a `ConstKeyword`.
  586. */
  587. declare function isConstKeyword(node: ts.Node): node is ts.ConstKeyword;
  588. /**
  589. * Test if a node is a `DeclareKeyword`.
  590. * @category Nodes - Type Guards
  591. * @example
  592. * ```ts
  593. * declare const node: ts.Node;
  594. *
  595. * if (isDeclareKeyword(node)) {
  596. * // ...
  597. * }
  598. * ```
  599. * @returns Whether the given node appears to be a `DeclareKeyword`.
  600. */
  601. declare function isDeclareKeyword(node: ts.Node): node is ts.DeclareKeyword;
  602. /**
  603. * Test if a node is a `DefaultKeyword`.
  604. * @category Nodes - Type Guards
  605. * @example
  606. * ```ts
  607. * declare const node: ts.Node;
  608. *
  609. * if (isDefaultKeyword(node)) {
  610. * // ...
  611. * }
  612. * ```
  613. * @returns Whether the given node appears to be a `DefaultKeyword`.
  614. */
  615. declare function isDefaultKeyword(node: ts.Node): node is ts.DefaultKeyword;
  616. /**
  617. * Test if a node is a `DotToken`.
  618. * @category Nodes - Type Guards
  619. * @example
  620. * ```ts
  621. * declare const node: ts.Node;
  622. *
  623. * if (isDotToken(node)) {
  624. * // ...
  625. * }
  626. * ```
  627. * @returns Whether the given node appears to be a `DotToken`.
  628. */
  629. declare function isDotToken(node: ts.Node): node is ts.DotToken;
  630. /**
  631. * Test if a node is an `EndOfFileToken`.
  632. * @category Nodes - Type Guards
  633. * @example
  634. * ```ts
  635. * declare const node: ts.Node;
  636. *
  637. * if (isEndOfFileToken(node)) {
  638. * // ...
  639. * }
  640. * ```
  641. * @returns Whether the given node appears to be an `EndOfFileToken`.
  642. */
  643. declare function isEndOfFileToken(node: ts.Node): node is ts.EndOfFileToken;
  644. /**
  645. * Test if a node is an `EqualsGreaterThanToken`.
  646. * @deprecated With TypeScript v5, in favor of typescript's `isEqualsGreaterThanToken`.
  647. * @category Nodes - Type Guards
  648. * @example
  649. * ```ts
  650. * declare const node: ts.Node;
  651. *
  652. * if (isEqualsGreaterThanToken(node)) {
  653. * // ...
  654. * }
  655. * ```
  656. * @returns Whether the given node appears to be an `EqualsGreaterThanToken`.
  657. */
  658. declare function isEqualsGreaterThanToken(node: ts.Node): node is ts.EqualsGreaterThanToken;
  659. /**
  660. * Test if a node is an `EqualsToken`.
  661. * @category Nodes - Type Guards
  662. * @example
  663. * ```ts
  664. * declare const node: ts.Node;
  665. *
  666. * if (isEqualsToken(node)) {
  667. * // ...
  668. * }
  669. * ```
  670. * @returns Whether the given node appears to be an `EqualsToken`.
  671. */
  672. declare function isEqualsToken(node: ts.Node): node is ts.EqualsToken;
  673. /**
  674. * Test if a node is an `ExclamationToken`.
  675. * @deprecated With TypeScript v5, in favor of typescript's `isExclamationToken`.
  676. * @category Nodes - Type Guards
  677. * @example
  678. * ```ts
  679. * declare const node: ts.Node;
  680. *
  681. * if (isExclamationToken(node)) {
  682. * // ...
  683. * }
  684. * ```
  685. * @returns Whether the given node appears to be an `ExclamationToken`.
  686. */
  687. declare function isExclamationToken(node: ts.Node): node is ts.ExclamationToken;
  688. /**
  689. * Test if a node is an `ExportKeyword`.
  690. * @category Nodes - Type Guards
  691. * @example
  692. * ```ts
  693. * declare const node: ts.Node;
  694. *
  695. * if (isExportKeyword(node)) {
  696. * // ...
  697. * }
  698. * ```
  699. * @returns Whether the given node appears to be an `ExportKeyword`.
  700. */
  701. declare function isExportKeyword(node: ts.Node): node is ts.ExportKeyword;
  702. /**
  703. * Test if a node is a {@link FalseKeyword}.
  704. * @category Nodes - Type Guards
  705. * @example
  706. * ```ts
  707. * declare const node: ts.Node;
  708. *
  709. * if (isFalseKeyword(node)) {
  710. * // ...
  711. * }
  712. * ```
  713. * @returns Whether the given node appears to be a {@link FalseKeyword}.
  714. */
  715. declare function isFalseKeyword(node: ts.Node): node is FalseKeyword;
  716. /**
  717. * Test if a node is a `FalseLiteral`.
  718. * @category Nodes - Type Guards
  719. * @example
  720. * ```ts
  721. * declare const node: ts.Node;
  722. *
  723. * if (isFalseLiteral(node)) {
  724. * // ...
  725. * }
  726. * ```
  727. * @returns Whether the given node appears to be a `FalseLiteral`.
  728. */
  729. declare function isFalseLiteral(node: ts.Node): node is ts.FalseLiteral;
  730. /**
  731. * Test if a node is an `ImportExpression`.
  732. * @category Nodes - Type Guards
  733. * @example
  734. * ```ts
  735. * declare const node: ts.Node;
  736. *
  737. * if (isImportExpression(node)) {
  738. * // ...
  739. * }
  740. * ```
  741. * @returns Whether the given node appears to be an `ImportExpression`.
  742. */
  743. declare function isImportExpression(node: ts.Node): node is ts.ImportExpression;
  744. /**
  745. * Test if a node is an {@link ImportKeyword}.
  746. * @category Nodes - Type Guards
  747. * @example
  748. * ```ts
  749. * declare const node: ts.Node;
  750. *
  751. * if (isImportKeyword(node)) {
  752. * // ...
  753. * }
  754. * ```
  755. * @returns Whether the given node appears to be an {@link ImportKeyword}.
  756. */
  757. declare function isImportKeyword(node: ts.Node): node is ImportKeyword;
  758. /**
  759. * Test if a node is an `InKeyword`.
  760. * @category Nodes - Type Guards
  761. * @example
  762. * ```ts
  763. * declare const node: ts.Node;
  764. *
  765. * if (isInKeyword(node)) {
  766. * // ...
  767. * }
  768. * ```
  769. * @returns Whether the given node appears to be an `InKeyword`.
  770. */
  771. declare function isInKeyword(node: ts.Node): node is ts.InKeyword;
  772. /**
  773. * Test if a node is an `InputFiles`.
  774. * @deprecated With TypeScript v5
  775. * @category Nodes - Type Guards
  776. * @example
  777. * ```ts
  778. * declare const node: ts.Node;
  779. *
  780. * if (isInputFiles(node)) {
  781. * // ...
  782. * }
  783. * ```
  784. * @returns Whether the given node appears to be an `InputFiles`.
  785. */
  786. declare function isInputFiles(node: ts.Node): node is ts.InputFiles;
  787. /**
  788. * Test if a node is a `JSDocText`.
  789. * @category Nodes - Type Guards
  790. * @example
  791. * ```ts
  792. * declare const node: ts.Node;
  793. *
  794. * if (isJSDocText(node)) {
  795. * // ...
  796. * }
  797. * ```
  798. * @returns Whether the given node appears to be a `JSDocText`.
  799. */
  800. declare function isJSDocText(node: ts.Node): node is ts.JSDocText;
  801. /**
  802. * Test if a node is a `JsonMinusNumericLiteral`.
  803. * @category Nodes - Type Guards
  804. * @example
  805. * ```ts
  806. * declare const node: ts.Node;
  807. *
  808. * if (isJsonMinusNumericLiteral(node)) {
  809. * // ...
  810. * }
  811. * ```
  812. * @returns Whether the given node appears to be a `JsonMinusNumericLiteral`.
  813. */
  814. declare function isJsonMinusNumericLiteral(node: ts.Node): node is ts.JsonMinusNumericLiteral;
  815. /**
  816. * Test if a node is a {@link NeverKeyword}.
  817. * @category Nodes - Type Guards
  818. * @example
  819. * ```ts
  820. * declare const node: ts.Node;
  821. *
  822. * if (isNeverKeyword(node)) {
  823. * // ...
  824. * }
  825. * ```
  826. * @returns Whether the given node appears to be a {@link NeverKeyword}.
  827. */
  828. declare function isNeverKeyword(node: ts.Node): node is NeverKeyword;
  829. /**
  830. * Test if a node is a {@link NullKeyword}.
  831. * @category Nodes - Type Guards
  832. * @example
  833. * ```ts
  834. * declare const node: ts.Node;
  835. *
  836. * if (isNullKeyword(node)) {
  837. * // ...
  838. * }
  839. * ```
  840. * @returns Whether the given node appears to be a {@link NullKeyword}.
  841. */
  842. declare function isNullKeyword(node: ts.Node): node is NullKeyword;
  843. /**
  844. * Test if a node is a `NullLiteral`.
  845. * @category Nodes - Type Guards
  846. * @example
  847. * ```ts
  848. * declare const node: ts.Node;
  849. *
  850. * if (isNullLiteral(node)) {
  851. * // ...
  852. * }
  853. * ```
  854. * @returns Whether the given node appears to be a `NullLiteral`.
  855. */
  856. declare function isNullLiteral(node: ts.Node): node is ts.NullLiteral;
  857. /**
  858. * Test if a node is a {@link NumberKeyword}.
  859. * @category Nodes - Type Guards
  860. * @example
  861. * ```ts
  862. * declare const node: ts.Node;
  863. *
  864. * if (isNumberKeyword(node)) {
  865. * // ...
  866. * }
  867. * ```
  868. * @returns Whether the given node appears to be a {@link NumberKeyword}.
  869. */
  870. declare function isNumberKeyword(node: ts.Node): node is NumberKeyword;
  871. /**
  872. * Test if a node is an {@link ObjectKeyword}.
  873. * @category Nodes - Type Guards
  874. * @example
  875. * ```ts
  876. * declare const node: ts.Node;
  877. *
  878. * if (isObjectKeyword(node)) {
  879. * // ...
  880. * }
  881. * ```
  882. * @returns Whether the given node appears to be an {@link ObjectKeyword}.
  883. */
  884. declare function isObjectKeyword(node: ts.Node): node is ObjectKeyword;
  885. /**
  886. * Test if a node is an `OutKeyword`.
  887. * @category Nodes - Type Guards
  888. * @example
  889. * ```ts
  890. * declare const node: ts.Node;
  891. *
  892. * if (isOutKeyword(node)) {
  893. * // ...
  894. * }
  895. * ```
  896. * @returns Whether the given node appears to be an `OutKeyword`.
  897. */
  898. declare function isOutKeyword(node: ts.Node): node is ts.OutKeyword;
  899. /**
  900. * Test if a node is an `OverrideKeyword`.
  901. * @category Nodes - Type Guards
  902. * @example
  903. * ```ts
  904. * declare const node: ts.Node;
  905. *
  906. * if (isOverrideKeyword(node)) {
  907. * // ...
  908. * }
  909. * ```
  910. * @returns Whether the given node appears to be an `OverrideKeyword`.
  911. */
  912. declare function isOverrideKeyword(node: ts.Node): node is ts.OverrideKeyword;
  913. /**
  914. * Test if a node is a `PrivateKeyword`.
  915. * @category Nodes - Type Guards
  916. * @example
  917. * ```ts
  918. * declare const node: ts.Node;
  919. *
  920. * if (isPrivateKeyword(node)) {
  921. * // ...
  922. * }
  923. * ```
  924. * @returns Whether the given node appears to be a `PrivateKeyword`.
  925. */
  926. declare function isPrivateKeyword(node: ts.Node): node is ts.PrivateKeyword;
  927. /**
  928. * Test if a node is a `ProtectedKeyword`.
  929. * @category Nodes - Type Guards
  930. * @example
  931. * ```ts
  932. * declare const node: ts.Node;
  933. *
  934. * if (isProtectedKeyword(node)) {
  935. * // ...
  936. * }
  937. * ```
  938. * @returns Whether the given node appears to be a `ProtectedKeyword`.
  939. */
  940. declare function isProtectedKeyword(node: ts.Node): node is ts.ProtectedKeyword;
  941. /**
  942. * Test if a node is a `PublicKeyword`.
  943. * @category Nodes - Type Guards
  944. * @example
  945. * ```ts
  946. * declare const node: ts.Node;
  947. *
  948. * if (isPublicKeyword(node)) {
  949. * // ...
  950. * }
  951. * ```
  952. * @returns Whether the given node appears to be a `PublicKeyword`.
  953. */
  954. declare function isPublicKeyword(node: ts.Node): node is ts.PublicKeyword;
  955. /**
  956. * Test if a node is a `QuestionDotToken`.
  957. * @deprecated With TypeScript v5, in favor of typescript's `isQuestionDotToken`.
  958. * @category Nodes - Type Guards
  959. * @example
  960. * ```ts
  961. * declare const node: ts.Node;
  962. *
  963. * if (isQuestionDotToken(node)) {
  964. * // ...
  965. * }
  966. * ```
  967. * @returns Whether the given node appears to be a `QuestionDotToken`.
  968. */
  969. declare function isQuestionDotToken(node: ts.Node): node is ts.QuestionDotToken;
  970. /**
  971. * Test if a node is a `QuestionToken`.
  972. * @deprecated With TypeScript v5, in favor of typescript's `isQuestionToken`.
  973. * @category Nodes - Type Guards
  974. * @example
  975. * ```ts
  976. * declare const node: ts.Node;
  977. *
  978. * if (isQuestionToken(node)) {
  979. * // ...
  980. * }
  981. * ```
  982. * @returns Whether the given node appears to be a `QuestionToken`.
  983. */
  984. declare function isQuestionToken(node: ts.Node): node is ts.QuestionToken;
  985. /**
  986. * Test if a node is a `ReadonlyKeyword`.
  987. * @category Nodes - Type Guards
  988. * @example
  989. * ```ts
  990. * declare const node: ts.Node;
  991. *
  992. * if (isReadonlyKeyword(node)) {
  993. * // ...
  994. * }
  995. * ```
  996. * @returns Whether the given node appears to be a `ReadonlyKeyword`.
  997. */
  998. declare function isReadonlyKeyword(node: ts.Node): node is ts.ReadonlyKeyword;
  999. /**
  1000. * Test if a node is a `StaticKeyword`.
  1001. * @category Nodes - Type Guards
  1002. * @example
  1003. * ```ts
  1004. * declare const node: ts.Node;
  1005. *
  1006. * if (isStaticKeyword(node)) {
  1007. * // ...
  1008. * }
  1009. * ```
  1010. * @returns Whether the given node appears to be a `StaticKeyword`.
  1011. */
  1012. declare function isStaticKeyword(node: ts.Node): node is ts.StaticKeyword;
  1013. /**
  1014. * Test if a node is a {@link StringKeyword}.
  1015. * @category Nodes - Type Guards
  1016. * @example
  1017. * ```ts
  1018. * declare const node: ts.Node;
  1019. *
  1020. * if (isStringKeyword(node)) {
  1021. * // ...
  1022. * }
  1023. * ```
  1024. * @returns Whether the given node appears to be a {@link StringKeyword}.
  1025. */
  1026. declare function isStringKeyword(node: ts.Node): node is StringKeyword;
  1027. /**
  1028. * Test if a node is a `SuperExpression`.
  1029. * @category Nodes - Type Guards
  1030. * @example
  1031. * ```ts
  1032. * declare const node: ts.Node;
  1033. *
  1034. * if (isSuperExpression(node)) {
  1035. * // ...
  1036. * }
  1037. * ```
  1038. * @returns Whether the given node appears to be a `SuperExpression`.
  1039. */
  1040. declare function isSuperExpression(node: ts.Node): node is ts.SuperExpression;
  1041. /**
  1042. * Test if a node is a {@link SuperKeyword}.
  1043. * @category Nodes - Type Guards
  1044. * @example
  1045. * ```ts
  1046. * declare const node: ts.Node;
  1047. *
  1048. * if (isSuperKeyword(node)) {
  1049. * // ...
  1050. * }
  1051. * ```
  1052. * @returns Whether the given node appears to be a {@link SuperKeyword}.
  1053. */
  1054. declare function isSuperKeyword(node: ts.Node): node is SuperKeyword;
  1055. /**
  1056. * Test if a node is a {@link SymbolKeyword}.
  1057. * @category Nodes - Type Guards
  1058. * @example
  1059. * ```ts
  1060. * declare const node: ts.Node;
  1061. *
  1062. * if (isSymbolKeyword(node)) {
  1063. * // ...
  1064. * }
  1065. * ```
  1066. * @returns Whether the given node appears to be a {@link SymbolKeyword}.
  1067. */
  1068. declare function isSymbolKeyword(node: ts.Node): node is SymbolKeyword;
  1069. /**
  1070. * Test if a node is a `SyntaxList`.
  1071. * @category Nodes - Type Guards
  1072. * @example
  1073. * ```ts
  1074. * declare const node: ts.Node;
  1075. *
  1076. * if (isSyntaxList(node)) {
  1077. * // ...
  1078. * }
  1079. * ```
  1080. * @returns Whether the given node appears to be a `SyntaxList`.
  1081. */
  1082. declare function isSyntaxList(node: ts.Node): node is ts.SyntaxList;
  1083. /**
  1084. * Test if a node is a `ThisExpression`.
  1085. * @category Nodes - Type Guards
  1086. * @example
  1087. * ```ts
  1088. * declare const node: ts.Node;
  1089. *
  1090. * if (isThisExpression(node)) {
  1091. * // ...
  1092. * }
  1093. * ```
  1094. * @returns Whether the given node appears to be a `ThisExpression`.
  1095. */
  1096. declare function isThisExpression(node: ts.Node): node is ts.ThisExpression;
  1097. /**
  1098. * Test if a node is a {@link ThisKeyword}.
  1099. * @category Nodes - Type Guards
  1100. * @example
  1101. * ```ts
  1102. * declare const node: ts.Node;
  1103. *
  1104. * if (isThisKeyword(node)) {
  1105. * // ...
  1106. * }
  1107. * ```
  1108. * @returns Whether the given node appears to be a {@link ThisKeyword}.
  1109. */
  1110. declare function isThisKeyword(node: ts.Node): node is ThisKeyword;
  1111. /**
  1112. * Test if a node is a {@link TrueKeyword}.
  1113. * @category Nodes - Type Guards
  1114. * @example
  1115. * ```ts
  1116. * declare const node: ts.Node;
  1117. *
  1118. * if (isTrueKeyword(node)) {
  1119. * // ...
  1120. * }
  1121. * ```
  1122. * @returns Whether the given node appears to be a {@link TrueKeyword}.
  1123. */
  1124. declare function isTrueKeyword(node: ts.Node): node is TrueKeyword;
  1125. /**
  1126. * Test if a node is a `TrueLiteral`.
  1127. * @category Nodes - Type Guards
  1128. * @example
  1129. * ```ts
  1130. * declare const node: ts.Node;
  1131. *
  1132. * if (isTrueLiteral(node)) {
  1133. * // ...
  1134. * }
  1135. * ```
  1136. * @returns Whether the given node appears to be a `TrueLiteral`.
  1137. */
  1138. declare function isTrueLiteral(node: ts.Node): node is ts.TrueLiteral;
  1139. /**
  1140. * Test if a node is an {@link UndefinedKeyword}.
  1141. * @category Nodes - Type Guards
  1142. * @example
  1143. * ```ts
  1144. * declare const node: ts.Node;
  1145. *
  1146. * if (isUndefinedKeyword(node)) {
  1147. * // ...
  1148. * }
  1149. * ```
  1150. * @returns Whether the given node appears to be an {@link UndefinedKeyword}.
  1151. */
  1152. declare function isUndefinedKeyword(node: ts.Node): node is UndefinedKeyword;
  1153. /**
  1154. * Test if a node is an {@link UnknownKeyword}.
  1155. * @category Nodes - Type Guards
  1156. * @example
  1157. * ```ts
  1158. * declare const node: ts.Node;
  1159. *
  1160. * if (isUnknownKeyword(node)) {
  1161. * // ...
  1162. * }
  1163. * ```
  1164. * @returns Whether the given node appears to be an {@link UnknownKeyword}.
  1165. */
  1166. declare function isUnknownKeyword(node: ts.Node): node is UnknownKeyword;
  1167. /**
  1168. * Test if a node is an `UnparsedPrologue`.
  1169. * @deprecated With TypeScript v5
  1170. * @category Nodes - Type Guards
  1171. * @example
  1172. * ```ts
  1173. * declare const node: ts.Node;
  1174. *
  1175. * if (isUnparsedPrologue(node)) {
  1176. * // ...
  1177. * }
  1178. * ```
  1179. * @returns Whether the given node appears to be an `UnparsedPrologue`.
  1180. */
  1181. declare function isUnparsedPrologue(node: ts.Node): node is ts.UnparsedPrologue;
  1182. /**
  1183. * Test if a node is an `UnparsedSyntheticReference`.
  1184. * @deprecated With TypeScript v5
  1185. * @category Nodes - Type Guards
  1186. * @example
  1187. * ```ts
  1188. * declare const node: ts.Node;
  1189. *
  1190. * if (isUnparsedSyntheticReference(node)) {
  1191. * // ...
  1192. * }
  1193. * ```
  1194. * @returns Whether the given node appears to be an `UnparsedSyntheticReference`.
  1195. */
  1196. declare function isUnparsedSyntheticReference(node: ts.Node): node is ts.UnparsedSyntheticReference;
  1197. /**
  1198. * Test if a node is a {@link VoidKeyword}.
  1199. * @category Nodes - Type Guards
  1200. * @example
  1201. * ```ts
  1202. * declare const node: ts.Node;
  1203. *
  1204. * if (isVoidKeyword(node)) {
  1205. * // ...
  1206. * }
  1207. * ```
  1208. * @returns Whether the given node appears to be a {@link VoidKeyword}.
  1209. */
  1210. declare function isVoidKeyword(node: ts.Node): node is VoidKeyword;
  1211. /**
  1212. * Test if a node is an `AccessExpression`.
  1213. * @category Nodes - Type Guards
  1214. * @example
  1215. * ```ts
  1216. * declare const node: ts.Node;
  1217. *
  1218. * if (isAccessExpression(node)) {
  1219. * // ...
  1220. * }
  1221. * ```
  1222. * @returns Whether the given node appears to be an `AccessExpression`.
  1223. */
  1224. declare function isAccessExpression(node: ts.Node): node is ts.AccessExpression;
  1225. /**
  1226. * Test if a node is an `AccessibilityModifier`.
  1227. * @category Nodes - Type Guards
  1228. * @example
  1229. * ```ts
  1230. * declare const node: ts.Node;
  1231. *
  1232. * if (isAccessibilityModifier(node)) {
  1233. * // ...
  1234. * }
  1235. * ```
  1236. * @returns Whether the given node appears to be an `AccessibilityModifier`.
  1237. */
  1238. declare function isAccessibilityModifier(node: ts.Node): node is ts.AccessibilityModifier;
  1239. /**
  1240. * Test if a node is an `AccessorDeclaration`.
  1241. * @deprecated With TypeScript v5, in favor of typescript's `isAccessor`.
  1242. * @category Nodes - Type Guards
  1243. * @example
  1244. * ```ts
  1245. * declare const node: ts.Node;
  1246. *
  1247. * if (isAccessorDeclaration(node)) {
  1248. * // ...
  1249. * }
  1250. * ```
  1251. * @returns Whether the given node appears to be an `AccessorDeclaration`.
  1252. */
  1253. declare function isAccessorDeclaration(node: ts.Node): node is ts.AccessorDeclaration;
  1254. /**
  1255. * Test if a node is an `ArrayBindingElement`.
  1256. * @deprecated With TypeScript v5, in favor of typescript's `isArrayBindingElement`.
  1257. * @category Nodes - Type Guards
  1258. * @example
  1259. * ```ts
  1260. * declare const node: ts.Node;
  1261. *
  1262. * if (isArrayBindingElement(node)) {
  1263. * // ...
  1264. * }
  1265. * ```
  1266. * @returns Whether the given node appears to be an `ArrayBindingElement`.
  1267. */
  1268. declare function isArrayBindingElement(node: ts.Node): node is ts.ArrayBindingElement;
  1269. /**
  1270. * Test if a node is an `ArrayBindingOrAssignmentPattern`.
  1271. * @category Nodes - Type Guards
  1272. * @example
  1273. * ```ts
  1274. * declare const node: ts.Node;
  1275. *
  1276. * if (isArrayBindingOrAssignmentPattern(node)) {
  1277. * // ...
  1278. * }
  1279. * ```
  1280. * @returns Whether the given node appears to be an `ArrayBindingOrAssignmentPattern`.
  1281. */
  1282. declare function isArrayBindingOrAssignmentPattern(node: ts.Node): node is ts.ArrayBindingOrAssignmentPattern;
  1283. /**
  1284. * Test if a node is an `AssignmentPattern`.
  1285. * @category Nodes - Type Guards
  1286. * @example
  1287. * ```ts
  1288. * declare const node: ts.Node;
  1289. *
  1290. * if (isAssignmentPattern(node)) {
  1291. * // ...
  1292. * }
  1293. * ```
  1294. * @returns Whether the given node appears to be an `AssignmentPattern`.
  1295. */
  1296. declare function isAssignmentPattern(node: ts.Node): node is ts.AssignmentPattern;
  1297. /**
  1298. * Test if a node is a `BindingOrAssignmentElementRestIndicator`.
  1299. * @category Nodes - Type Guards
  1300. * @example
  1301. * ```ts
  1302. * declare const node: ts.Node;
  1303. *
  1304. * if (isBindingOrAssignmentElementRestIndicator(node)) {
  1305. * // ...
  1306. * }
  1307. * ```
  1308. * @returns Whether the given node appears to be a `BindingOrAssignmentElementRestIndicator`.
  1309. */
  1310. declare function isBindingOrAssignmentElementRestIndicator(node: ts.Node): node is ts.BindingOrAssignmentElementRestIndicator;
  1311. /**
  1312. * Test if a node is a `BindingOrAssignmentElementTarget`.
  1313. * @category Nodes - Type Guards
  1314. * @example
  1315. * ```ts
  1316. * declare const node: ts.Node;
  1317. *
  1318. * if (isBindingOrAssignmentElementTarget(node)) {
  1319. * // ...
  1320. * }
  1321. * ```
  1322. * @returns Whether the given node appears to be a `BindingOrAssignmentElementTarget`.
  1323. */
  1324. declare function isBindingOrAssignmentElementTarget(node: ts.Node): node is ts.BindingOrAssignmentElementTarget;
  1325. /**
  1326. * Test if a node is a `BindingOrAssignmentPattern`.
  1327. * @category Nodes - Type Guards
  1328. * @example
  1329. * ```ts
  1330. * declare const node: ts.Node;
  1331. *
  1332. * if (isBindingOrAssignmentPattern(node)) {
  1333. * // ...
  1334. * }
  1335. * ```
  1336. * @returns Whether the given node appears to be a `BindingOrAssignmentPattern`.
  1337. */
  1338. declare function isBindingOrAssignmentPattern(node: ts.Node): node is ts.BindingOrAssignmentPattern;
  1339. /**
  1340. * Test if a node is a `BindingPattern`.
  1341. * @category Nodes - Type Guards
  1342. * @example
  1343. * ```ts
  1344. * declare const node: ts.Node;
  1345. *
  1346. * if (isBindingPattern(node)) {
  1347. * // ...
  1348. * }
  1349. * ```
  1350. * @returns Whether the given node appears to be a `BindingPattern`.
  1351. */
  1352. declare function isBindingPattern(node: ts.Node): node is ts.BindingPattern;
  1353. /**
  1354. * Test if a node is a `BlockLike`.
  1355. * @category Nodes - Type Guards
  1356. * @example
  1357. * ```ts
  1358. * declare const node: ts.Node;
  1359. *
  1360. * if (isBlockLike(node)) {
  1361. * // ...
  1362. * }
  1363. * ```
  1364. * @returns Whether the given node appears to be a `BlockLike`.
  1365. */
  1366. declare function isBlockLike(node: ts.Node): node is ts.BlockLike;
  1367. /**
  1368. * Test if a node is a `BooleanLiteral`.
  1369. * @category Nodes - Type Guards
  1370. * @example
  1371. * ```ts
  1372. * declare const node: ts.Node;
  1373. *
  1374. * if (isBooleanLiteral(node)) {
  1375. * // ...
  1376. * }
  1377. * ```
  1378. * @returns Whether the given node appears to be a `BooleanLiteral`.
  1379. */
  1380. declare function isBooleanLiteral(node: ts.Node): node is ts.BooleanLiteral;
  1381. /**
  1382. * Test if a node is a `ClassLikeDeclaration`.
  1383. * @deprecated With TypeScript v5, in favor of typescript's `isClassLike`.
  1384. * @category Nodes - Type Guards
  1385. * @example
  1386. * ```ts
  1387. * declare const node: ts.Node;
  1388. *
  1389. * if (isClassLikeDeclaration(node)) {
  1390. * // ...
  1391. * }
  1392. * ```
  1393. * @returns Whether the given node appears to be a `ClassLikeDeclaration`.
  1394. */
  1395. declare function isClassLikeDeclaration(node: ts.Node): node is ts.ClassLikeDeclaration;
  1396. /**
  1397. * Test if a node is a `ClassMemberModifier`.
  1398. * @category Nodes - Type Guards
  1399. * @example
  1400. * ```ts
  1401. * declare const node: ts.Node;
  1402. *
  1403. * if (isClassMemberModifier(node)) {
  1404. * // ...
  1405. * }
  1406. * ```
  1407. * @returns Whether the given node appears to be a `ClassMemberModifier`.
  1408. */
  1409. declare function isClassMemberModifier(node: ts.Node): node is ts.ClassMemberModifier;
  1410. /**
  1411. * Test if a node is a `DeclarationName`.
  1412. * @category Nodes - Type Guards
  1413. * @example
  1414. * ```ts
  1415. * declare const node: ts.Node;
  1416. *
  1417. * if (isDeclarationName(node)) {
  1418. * // ...
  1419. * }
  1420. * ```
  1421. * @returns Whether the given node appears to be a `DeclarationName`.
  1422. */
  1423. declare function isDeclarationName(node: ts.Node): node is ts.DeclarationName;
  1424. /**
  1425. * Test if a node is a `DeclarationWithTypeParameterChildren`.
  1426. * @category Nodes - Type Guards
  1427. * @example
  1428. * ```ts
  1429. * declare const node: ts.Node;
  1430. *
  1431. * if (isDeclarationWithTypeParameterChildren(node)) {
  1432. * // ...
  1433. * }
  1434. * ```
  1435. * @returns Whether the given node appears to be a `DeclarationWithTypeParameterChildren`.
  1436. */
  1437. declare function isDeclarationWithTypeParameterChildren(node: ts.Node): node is ts.DeclarationWithTypeParameterChildren;
  1438. /**
  1439. * Test if a node is a `DeclarationWithTypeParameters`.
  1440. * @category Nodes - Type Guards
  1441. * @example
  1442. * ```ts
  1443. * declare const node: ts.Node;
  1444. *
  1445. * if (isDeclarationWithTypeParameters(node)) {
  1446. * // ...
  1447. * }
  1448. * ```
  1449. * @returns Whether the given node appears to be a `DeclarationWithTypeParameters`.
  1450. */
  1451. declare function isDeclarationWithTypeParameters(node: ts.Node): node is ts.DeclarationWithTypeParameters;
  1452. /**
  1453. * Test if a node is a `DestructuringPattern`.
  1454. * @category Nodes - Type Guards
  1455. * @example
  1456. * ```ts
  1457. * declare const node: ts.Node;
  1458. *
  1459. * if (isDestructuringPattern(node)) {
  1460. * // ...
  1461. * }
  1462. * ```
  1463. * @returns Whether the given node appears to be a `DestructuringPattern`.
  1464. */
  1465. declare function isDestructuringPattern(node: ts.Node): node is ts.DestructuringPattern;
  1466. /**
  1467. * Test if a node is an `EntityNameExpression`.
  1468. * @category Nodes - Type Guards
  1469. * @example
  1470. * ```ts
  1471. * declare const node: ts.Node;
  1472. *
  1473. * if (isEntityNameExpression(node)) {
  1474. * // ...
  1475. * }
  1476. * ```
  1477. * @returns Whether the given node appears to be an `EntityNameExpression`.
  1478. */
  1479. declare function isEntityNameExpression(node: ts.Node): node is ts.EntityNameExpression;
  1480. /**
  1481. * Test if a node is an `EntityNameOrEntityNameExpression`.
  1482. * @category Nodes - Type Guards
  1483. * @example
  1484. * ```ts
  1485. * declare const node: ts.Node;
  1486. *
  1487. * if (isEntityNameOrEntityNameExpression(node)) {
  1488. * // ...
  1489. * }
  1490. * ```
  1491. * @returns Whether the given node appears to be an `EntityNameOrEntityNameExpression`.
  1492. */
  1493. declare function isEntityNameOrEntityNameExpression(node: ts.Node): node is ts.EntityNameOrEntityNameExpression;
  1494. /**
  1495. * Test if a node is a `ForInOrOfStatement`.
  1496. * @category Nodes - Type Guards
  1497. * @example
  1498. * ```ts
  1499. * declare const node: ts.Node;
  1500. *
  1501. * if (isForInOrOfStatement(node)) {
  1502. * // ...
  1503. * }
  1504. * ```
  1505. * @returns Whether the given node appears to be a `ForInOrOfStatement`.
  1506. */
  1507. declare function isForInOrOfStatement(node: ts.Node): node is ts.ForInOrOfStatement;
  1508. /**
  1509. * Test if a node is a `FunctionLikeDeclaration`.
  1510. * @deprecated With TypeScript v5, in favor of typescript's `isFunctionLike`.
  1511. * @category Nodes - Type Guards
  1512. * @example
  1513. * ```ts
  1514. * declare const node: ts.Node;
  1515. *
  1516. * if (isFunctionLikeDeclaration(node)) {
  1517. * // ...
  1518. * }
  1519. * ```
  1520. * @returns Whether the given node appears to be a `FunctionLikeDeclaration`.
  1521. */
  1522. declare function isFunctionLikeDeclaration(node: ts.Node): node is ts.FunctionLikeDeclaration;
  1523. /**
  1524. * Test if a node is a `HasDecorators`.
  1525. * @category Nodes - Type Guards
  1526. * @example
  1527. * ```ts
  1528. * declare const node: ts.Node;
  1529. *
  1530. * if (hasDecorators(node)) {
  1531. * // ...
  1532. * }
  1533. * ```
  1534. * @returns Whether the given node appears to be a `HasDecorators`.
  1535. */
  1536. declare function hasDecorators(node: ts.Node): node is ts.HasDecorators;
  1537. /**
  1538. * Test if a node is a `HasExpressionInitializer`.
  1539. * @category Nodes - Type Guards
  1540. * @example
  1541. * ```ts
  1542. * declare const node: ts.Node;
  1543. *
  1544. * if (hasExpressionInitializer(node)) {
  1545. * // ...
  1546. * }
  1547. * ```
  1548. * @returns Whether the given node appears to be a `HasExpressionInitializer`.
  1549. */
  1550. declare function hasExpressionInitializer(node: ts.Node): node is ts.HasExpressionInitializer;
  1551. /**
  1552. * Test if a node is a `HasInitializer`.
  1553. * @category Nodes - Type Guards
  1554. * @example
  1555. * ```ts
  1556. * declare const node: ts.Node;
  1557. *
  1558. * if (hasInitializer(node)) {
  1559. * // ...
  1560. * }
  1561. * ```
  1562. * @returns Whether the given node appears to be a `HasInitializer`.
  1563. */
  1564. declare function hasInitializer(node: ts.Node): node is ts.HasInitializer;
  1565. /**
  1566. * Test if a node is a `HasJSDoc`.
  1567. * @category Nodes - Type Guards
  1568. * @example
  1569. * ```ts
  1570. * declare const node: ts.Node;
  1571. *
  1572. * if (hasJSDoc(node)) {
  1573. * // ...
  1574. * }
  1575. * ```
  1576. * @returns Whether the given node appears to be a `HasJSDoc`.
  1577. */
  1578. declare function hasJSDoc(node: ts.Node): node is ts.HasJSDoc;
  1579. /**
  1580. * Test if a node is a `HasModifiers`.
  1581. * @category Nodes - Type Guards
  1582. * @example
  1583. * ```ts
  1584. * declare const node: ts.Node;
  1585. *
  1586. * if (hasModifiers(node)) {
  1587. * // ...
  1588. * }
  1589. * ```
  1590. * @returns Whether the given node appears to be a `HasModifiers`.
  1591. */
  1592. declare function hasModifiers(node: ts.Node): node is ts.HasModifiers;
  1593. /**
  1594. * Test if a node is a `HasType`.
  1595. * @category Nodes - Type Guards
  1596. * @example
  1597. * ```ts
  1598. * declare const node: ts.Node;
  1599. *
  1600. * if (hasType(node)) {
  1601. * // ...
  1602. * }
  1603. * ```
  1604. * @returns Whether the given node appears to be a `HasType`.
  1605. */
  1606. declare function hasType(node: ts.Node): node is ts.HasType;
  1607. /**
  1608. * Test if a node is a `HasTypeArguments`.
  1609. * @category Nodes - Type Guards
  1610. * @example
  1611. * ```ts
  1612. * declare const node: ts.Node;
  1613. *
  1614. * if (hasTypeArguments(node)) {
  1615. * // ...
  1616. * }
  1617. * ```
  1618. * @returns Whether the given node appears to be a `HasTypeArguments`.
  1619. */
  1620. declare function hasTypeArguments(node: ts.Node): node is ts.HasTypeArguments;
  1621. /**
  1622. * Test if a node is a `JSDocComment`.
  1623. * @category Nodes - Type Guards
  1624. * @example
  1625. * ```ts
  1626. * declare const node: ts.Node;
  1627. *
  1628. * if (isJSDocComment(node)) {
  1629. * // ...
  1630. * }
  1631. * ```
  1632. * @returns Whether the given node appears to be a `JSDocComment`.
  1633. */
  1634. declare function isJSDocComment(node: ts.Node): node is ts.JSDocComment;
  1635. /**
  1636. * Test if a node is a `JSDocNamespaceBody`.
  1637. * @category Nodes - Type Guards
  1638. * @example
  1639. * ```ts
  1640. * declare const node: ts.Node;
  1641. *
  1642. * if (isJSDocNamespaceBody(node)) {
  1643. * // ...
  1644. * }
  1645. * ```
  1646. * @returns Whether the given node appears to be a `JSDocNamespaceBody`.
  1647. */
  1648. declare function isJSDocNamespaceBody(node: ts.Node): node is ts.JSDocNamespaceBody;
  1649. /**
  1650. * Test if a node is a `JSDocTypeReferencingNode`.
  1651. * @category Nodes - Type Guards
  1652. * @example
  1653. * ```ts
  1654. * declare const node: ts.Node;
  1655. *
  1656. * if (isJSDocTypeReferencingNode(node)) {
  1657. * // ...
  1658. * }
  1659. * ```
  1660. * @returns Whether the given node appears to be a `JSDocTypeReferencingNode`.
  1661. */
  1662. declare function isJSDocTypeReferencingNode(node: ts.Node): node is ts.JSDocTypeReferencingNode;
  1663. /**
  1664. * Test if a node is a `JsonObjectExpression`.
  1665. * @category Nodes - Type Guards
  1666. * @example
  1667. * ```ts
  1668. * declare const node: ts.Node;
  1669. *
  1670. * if (isJsonObjectExpression(node)) {
  1671. * // ...
  1672. * }
  1673. * ```
  1674. * @returns Whether the given node appears to be a `JsonObjectExpression`.
  1675. */
  1676. declare function isJsonObjectExpression(node: ts.Node): node is ts.JsonObjectExpression;
  1677. /**
  1678. * Test if a node is a `JsxAttributeLike`.
  1679. * @deprecated With TypeScript v5, in favor of typescript's `isJsxAttributeLike`.
  1680. * @category Nodes - Type Guards
  1681. * @example
  1682. * ```ts
  1683. * declare const node: ts.Node;
  1684. *
  1685. * if (isJsxAttributeLike(node)) {
  1686. * // ...
  1687. * }
  1688. * ```
  1689. * @returns Whether the given node appears to be a `JsxAttributeLike`.
  1690. */
  1691. declare function isJsxAttributeLike(node: ts.Node): node is ts.JsxAttributeLike;
  1692. /**
  1693. * Test if a node is a `JsxAttributeValue`.
  1694. * @category Nodes - Type Guards
  1695. * @example
  1696. * ```ts
  1697. * declare const node: ts.Node;
  1698. *
  1699. * if (isJsxAttributeValue(node)) {
  1700. * // ...
  1701. * }
  1702. * ```
  1703. * @returns Whether the given node appears to be a `JsxAttributeValue`.
  1704. */
  1705. declare function isJsxAttributeValue(node: ts.Node): node is ts.JsxAttributeValue;
  1706. /**
  1707. * Test if a node is a `JsxChild`.
  1708. * @deprecated With TypeScript v5, in favor of typescript's `isJsxChild`.
  1709. * @category Nodes - Type Guards
  1710. * @example
  1711. * ```ts
  1712. * declare const node: ts.Node;
  1713. *
  1714. * if (isJsxChild(node)) {
  1715. * // ...
  1716. * }
  1717. * ```
  1718. * @returns Whether the given node appears to be a `JsxChild`.
  1719. */
  1720. declare function isJsxChild(node: ts.Node): node is ts.JsxChild;
  1721. /**
  1722. * Test if a node is a `JsxTagNameExpression`.
  1723. * @deprecated With TypeScript v5, in favor of typescript's `isJsxTagNameExpression`.
  1724. * @category Nodes - Type Guards
  1725. * @example
  1726. * ```ts
  1727. * declare const node: ts.Node;
  1728. *
  1729. * if (isJsxTagNameExpression(node)) {
  1730. * // ...
  1731. * }
  1732. * ```
  1733. * @returns Whether the given node appears to be a `JsxTagNameExpression`.
  1734. */
  1735. declare function isJsxTagNameExpression(node: ts.Node): node is ts.JsxTagNameExpression;
  1736. /**
  1737. * Test if a node is a `LiteralToken`.
  1738. * @category Nodes - Type Guards
  1739. * @example
  1740. * ```ts
  1741. * declare const node: ts.Node;
  1742. *
  1743. * if (isLiteralToken(node)) {
  1744. * // ...
  1745. * }
  1746. * ```
  1747. * @returns Whether the given node appears to be a `LiteralToken`.
  1748. */
  1749. declare function isLiteralToken(node: ts.Node): node is ts.LiteralToken;
  1750. /**
  1751. * Test if a node is a `ModuleBody`.
  1752. * @deprecated With TypeScript v5, in favor of typescript's `isModuleBody`.
  1753. * @category Nodes - Type Guards
  1754. * @example
  1755. * ```ts
  1756. * declare const node: ts.Node;
  1757. *
  1758. * if (isModuleBody(node)) {
  1759. * // ...
  1760. * }
  1761. * ```
  1762. * @returns Whether the given node appears to be a `ModuleBody`.
  1763. */
  1764. declare function isModuleBody(node: ts.Node): node is ts.ModuleBody;
  1765. /**
  1766. * Test if a node is a `ModuleName`.
  1767. * @deprecated With TypeScript v5, in favor of typescript's `isModuleName`.
  1768. * @category Nodes - Type Guards
  1769. * @example
  1770. * ```ts
  1771. * declare const node: ts.Node;
  1772. *
  1773. * if (isModuleName(node)) {
  1774. * // ...
  1775. * }
  1776. * ```
  1777. * @returns Whether the given node appears to be a `ModuleName`.
  1778. */
  1779. declare function isModuleName(node: ts.Node): node is ts.ModuleName;
  1780. /**
  1781. * Test if a node is a `ModuleReference`.
  1782. * @deprecated With TypeScript v5, in favor of typescript's `isModuleReference`.
  1783. * @category Nodes - Type Guards
  1784. * @example
  1785. * ```ts
  1786. * declare const node: ts.Node;
  1787. *
  1788. * if (isModuleReference(node)) {
  1789. * // ...
  1790. * }
  1791. * ```
  1792. * @returns Whether the given node appears to be a `ModuleReference`.
  1793. */
  1794. declare function isModuleReference(node: ts.Node): node is ts.ModuleReference;
  1795. /**
  1796. * Test if a node is a `NamedImportBindings`.
  1797. * @deprecated With TypeScript v5, in favor of typescript's `isNamedImportBindings`.
  1798. * @category Nodes - Type Guards
  1799. * @example
  1800. * ```ts
  1801. * declare const node: ts.Node;
  1802. *
  1803. * if (isNamedImportBindings(node)) {
  1804. * // ...
  1805. * }
  1806. * ```
  1807. * @returns Whether the given node appears to be a `NamedImportBindings`.
  1808. */
  1809. declare function isNamedImportBindings(node: ts.Node): node is ts.NamedImportBindings;
  1810. /**
  1811. * Test if a node is a `NamedImportsOrExports`.
  1812. * @category Nodes - Type Guards
  1813. * @example
  1814. * ```ts
  1815. * declare const node: ts.Node;
  1816. *
  1817. * if (isNamedImportsOrExports(node)) {
  1818. * // ...
  1819. * }
  1820. * ```
  1821. * @returns Whether the given node appears to be a `NamedImportsOrExports`.
  1822. */
  1823. declare function isNamedImportsOrExports(node: ts.Node): node is ts.NamedImportsOrExports;
  1824. /**
  1825. * Test if a node is a `NamespaceBody`.
  1826. * @category Nodes - Type Guards
  1827. * @example
  1828. * ```ts
  1829. * declare const node: ts.Node;
  1830. *
  1831. * if (isNamespaceBody(node)) {
  1832. * // ...
  1833. * }
  1834. * ```
  1835. * @returns Whether the given node appears to be a `NamespaceBody`.
  1836. */
  1837. declare function isNamespaceBody(node: ts.Node): node is ts.NamespaceBody;
  1838. /**
  1839. * Test if a node is an `ObjectBindingOrAssignmentElement`.
  1840. * @category Nodes - Type Guards
  1841. * @example
  1842. * ```ts
  1843. * declare const node: ts.Node;
  1844. *
  1845. * if (isObjectBindingOrAssignmentElement(node)) {
  1846. * // ...
  1847. * }
  1848. * ```
  1849. * @returns Whether the given node appears to be an `ObjectBindingOrAssignmentElement`.
  1850. */
  1851. declare function isObjectBindingOrAssignmentElement(node: ts.Node): node is ts.ObjectBindingOrAssignmentElement;
  1852. /**
  1853. * Test if a node is an `ObjectBindingOrAssignmentPattern`.
  1854. * @category Nodes - Type Guards
  1855. * @example
  1856. * ```ts
  1857. * declare const node: ts.Node;
  1858. *
  1859. * if (isObjectBindingOrAssignmentPattern(node)) {
  1860. * // ...
  1861. * }
  1862. * ```
  1863. * @returns Whether the given node appears to be an `ObjectBindingOrAssignmentPattern`.
  1864. */
  1865. declare function isObjectBindingOrAssignmentPattern(node: ts.Node): node is ts.ObjectBindingOrAssignmentPattern;
  1866. /**
  1867. * Test if a node is an `ObjectTypeDeclaration`.
  1868. * @category Nodes - Type Guards
  1869. * @example
  1870. * ```ts
  1871. * declare const node: ts.Node;
  1872. *
  1873. * if (isObjectTypeDeclaration(node)) {
  1874. * // ...
  1875. * }
  1876. * ```
  1877. * @returns Whether the given node appears to be an `ObjectTypeDeclaration`.
  1878. */
  1879. declare function isObjectTypeDeclaration(node: ts.Node): node is ts.ObjectTypeDeclaration;
  1880. /**
  1881. * Test if a node is a `ParameterPropertyModifier`.
  1882. * @category Nodes - Type Guards
  1883. * @example
  1884. * ```ts
  1885. * declare const node: ts.Node;
  1886. *
  1887. * if (isParameterPropertyModifier(node)) {
  1888. * // ...
  1889. * }
  1890. * ```
  1891. * @returns Whether the given node appears to be a `ParameterPropertyModifier`.
  1892. */
  1893. declare function isParameterPropertyModifier(node: ts.Node): node is ts.ParameterPropertyModifier;
  1894. /**
  1895. * Test if a node is a `PropertyNameLiteral`.
  1896. * @category Nodes - Type Guards
  1897. * @example
  1898. * ```ts
  1899. * declare const node: ts.Node;
  1900. *
  1901. * if (isPropertyNameLiteral(node)) {
  1902. * // ...
  1903. * }
  1904. * ```
  1905. * @returns Whether the given node appears to be a `PropertyNameLiteral`.
  1906. */
  1907. declare function isPropertyNameLiteral(node: ts.Node): node is ts.PropertyNameLiteral;
  1908. /**
  1909. * Test if a node is a `PseudoLiteralToken`.
  1910. * @category Nodes - Type Guards
  1911. * @example
  1912. * ```ts
  1913. * declare const node: ts.Node;
  1914. *
  1915. * if (isPseudoLiteralToken(node)) {
  1916. * // ...
  1917. * }
  1918. * ```
  1919. * @returns Whether the given node appears to be a `PseudoLiteralToken`.
  1920. */
  1921. declare function isPseudoLiteralToken(node: ts.Node): node is ts.PseudoLiteralToken;
  1922. /**
  1923. * Test if a node is a `SignatureDeclaration`.
  1924. * @category Nodes - Type Guards
  1925. * @example
  1926. * ```ts
  1927. * declare const node: ts.Node;
  1928. *
  1929. * if (isSignatureDeclaration(node)) {
  1930. * // ...
  1931. * }
  1932. * ```
  1933. * @returns Whether the given node appears to be a `SignatureDeclaration`.
  1934. */
  1935. declare function isSignatureDeclaration(node: ts.Node): node is ts.SignatureDeclaration;
  1936. /**
  1937. * Test if a node is a `SuperProperty`.
  1938. * @category Nodes - Type Guards
  1939. * @example
  1940. * ```ts
  1941. * declare const node: ts.Node;
  1942. *
  1943. * if (isSuperProperty(node)) {
  1944. * // ...
  1945. * }
  1946. * ```
  1947. * @returns Whether the given node appears to be a `SuperProperty`.
  1948. */
  1949. declare function isSuperProperty(node: ts.Node): node is ts.SuperProperty;
  1950. /**
  1951. * Test if a node is a `TypeOnlyCompatibleAliasDeclaration`.
  1952. * @category Nodes - Type Guards
  1953. * @example
  1954. * ```ts
  1955. * declare const node: ts.Node;
  1956. *
  1957. * if (isTypeOnlyCompatibleAliasDeclaration(node)) {
  1958. * // ...
  1959. * }
  1960. * ```
  1961. * @returns Whether the given node appears to be a `TypeOnlyCompatibleAliasDeclaration`.
  1962. */
  1963. declare function isTypeOnlyCompatibleAliasDeclaration(node: ts.Node): node is ts.TypeOnlyCompatibleAliasDeclaration;
  1964. /**
  1965. * Test if a node is a `TypeReferenceType`.
  1966. * @category Nodes - Type Guards
  1967. * @example
  1968. * ```ts
  1969. * declare const node: ts.Node;
  1970. *
  1971. * if (isTypeReferenceType(node)) {
  1972. * // ...
  1973. * }
  1974. * ```
  1975. * @returns Whether the given node appears to be a `TypeReferenceType`.
  1976. */
  1977. declare function isTypeReferenceType(node: ts.Node): node is ts.TypeReferenceType;
  1978. /**
  1979. * Test if a node is an `UnionOrIntersectionTypeNode`.
  1980. * @category Nodes - Type Guards
  1981. * @example
  1982. * ```ts
  1983. * declare const node: ts.Node;
  1984. *
  1985. * if (isUnionOrIntersectionTypeNode(node)) {
  1986. * // ...
  1987. * }
  1988. * ```
  1989. * @returns Whether the given node appears to be an `UnionOrIntersectionTypeNode`.
  1990. */
  1991. declare function isUnionOrIntersectionTypeNode(node: ts.Node): node is ts.UnionOrIntersectionTypeNode;
  1992. /**
  1993. * Test if a node is an `UnparsedSourceText`.
  1994. * @deprecated With TypeScript v5
  1995. * @category Nodes - Type Guards
  1996. * @example
  1997. * ```ts
  1998. * declare const node: ts.Node;
  1999. *
  2000. * if (isUnparsedSourceText(node)) {
  2001. * // ...
  2002. * }
  2003. * ```
  2004. * @returns Whether the given node appears to be an `UnparsedSourceText`.
  2005. */
  2006. declare function isUnparsedSourceText(node: ts.Node): node is ts.UnparsedSourceText;
  2007. /**
  2008. * Test if a node is a `VariableLikeDeclaration`.
  2009. * @category Nodes - Type Guards
  2010. * @example
  2011. * ```ts
  2012. * declare const node: ts.Node;
  2013. *
  2014. * if (isVariableLikeDeclaration(node)) {
  2015. * // ...
  2016. * }
  2017. * ```
  2018. * @returns Whether the given node appears to be a `VariableLikeDeclaration`.
  2019. */
  2020. declare function isVariableLikeDeclaration(node: ts.Node): node is ts.VariableLikeDeclaration;
  2021. /**
  2022. * Is the node a scope boundary, specifically due to it being a function.
  2023. * @category Scope Utilities
  2024. * @example
  2025. * ```ts
  2026. * declare const node: ts.Node;
  2027. *
  2028. * if (isFunctionScopeBoundary(node, ts.ObjectFlags.Anonymous)) {
  2029. * // ...
  2030. * }
  2031. * ```
  2032. */
  2033. declare function isFunctionScopeBoundary(node: ts.Node): boolean;
  2034. /**
  2035. * Test of the kind given is for assignment.
  2036. * @category Syntax Utilities
  2037. * @example
  2038. * ```ts
  2039. * declare const kind: ts.SyntaxKind;
  2040. *
  2041. * isAssignmentKind(kind);
  2042. * ```
  2043. */
  2044. declare function isAssignmentKind(kind: ts.SyntaxKind): boolean;
  2045. /**
  2046. * Test if a string is numeric.
  2047. * @category Syntax Utilities
  2048. * @example
  2049. * ```ts
  2050. * isNumericPropertyName("abc"); // false
  2051. * isNumericPropertyName("123"); // true
  2052. * ```
  2053. */
  2054. declare function isNumericPropertyName(name: string | ts.__String): boolean;
  2055. /**
  2056. * Determines whether the given text can be used to access a property with a `PropertyAccessExpression` while preserving the property's name.
  2057. * @category Syntax Utilities
  2058. * @example
  2059. * ```ts
  2060. * isValidPropertyAccess("abc"); // true
  2061. * isValidPropertyAccess("123"); // false
  2062. * ```
  2063. */
  2064. declare function isValidPropertyAccess(text: string, languageVersion?: ts.ScriptTarget): boolean;
  2065. /**
  2066. * Callback type used for {@link forEachToken}.
  2067. * @category Callbacks
  2068. */
  2069. type ForEachTokenCallback = (token: ts.Node) => void;
  2070. /**
  2071. * Iterates over all tokens of `node`
  2072. * @category Nodes - Other Utilities
  2073. * @example
  2074. * ```ts
  2075. * declare const node: ts.Node;
  2076. *
  2077. * forEachToken(node, (token) => {
  2078. * console.log("Found token:", token.getText());
  2079. * });
  2080. * ```
  2081. * @param node - The node whose tokens should be visited
  2082. * @param callback - Is called for every token contained in `node`
  2083. */
  2084. declare function forEachToken(node: ts.Node, callback: ForEachTokenCallback, sourceFile?: ts.SourceFile): void;
  2085. /**
  2086. * Get the `CallSignatures` of the given type.
  2087. * @category Types - Getters
  2088. * @example
  2089. * ```ts
  2090. * declare const type: ts.Type;
  2091. *
  2092. * getCallSignaturesOfType(type);
  2093. * ```
  2094. */
  2095. declare function getCallSignaturesOfType(type: ts.Type): readonly ts.Signature[];
  2096. /**
  2097. * Get the property with the given name on the given type (if it exists).
  2098. * @category Types - Getters
  2099. * @example
  2100. * ```ts
  2101. * declare const property: ts.Symbol;
  2102. * declare const type: ts.Type;
  2103. *
  2104. * getPropertyOfType(type, property.getEscapedName());
  2105. * ```
  2106. */
  2107. declare function getPropertyOfType(type: ts.Type, name: ts.__String): ts.Symbol | undefined;
  2108. /**
  2109. * Retrieves a type symbol corresponding to a well-known string name.
  2110. * @category Types - Getters
  2111. * @example
  2112. * ```ts
  2113. * declare const type: ts.Type;
  2114. * declare const typeChecker: ts.TypeChecker;
  2115. *
  2116. * getWellKnownSymbolPropertyOfType(type, "asyncIterator", typeChecker);
  2117. * ```
  2118. */
  2119. declare function getWellKnownSymbolPropertyOfType(type: ts.Type, wellKnownSymbolName: string, typeChecker: ts.TypeChecker): ts.Symbol | undefined;
  2120. /**
  2121. * A "any" intrinsic type.
  2122. * @category Type Types
  2123. */
  2124. interface IntrinsicAnyType extends IntrinsicType {
  2125. intrinsicName: "any";
  2126. }
  2127. /**
  2128. * Determines whether the given type is the "any" intrinsic type.
  2129. * @category Types - Type Guards
  2130. * @example
  2131. * ```ts
  2132. * declare const type: ts.Type;
  2133. *
  2134. * if (isIntrinsicAnyType(type)) {
  2135. * // ...
  2136. * }
  2137. * ```
  2138. */
  2139. declare function isIntrinsicAnyType(type: ts.Type): type is IntrinsicAnyType;
  2140. /**
  2141. * A "boolean" intrinsic type.
  2142. * @category Type Types
  2143. */
  2144. interface IntrinsicBooleanType extends IntrinsicType {
  2145. intrinsicName: "boolean";
  2146. }
  2147. /**
  2148. * Determines whether the given type is the "boolean" intrinsic type.
  2149. * @category Types - Type Guards
  2150. * @example
  2151. * ```ts
  2152. * declare const type: ts.Type;
  2153. *
  2154. * if (isIntrinsicBooleanType(type)) {
  2155. * // ...
  2156. * }
  2157. * ```
  2158. */
  2159. declare function isIntrinsicBooleanType(type: ts.Type): type is IntrinsicBooleanType;
  2160. /**
  2161. * A "bigint" intrinsic type.
  2162. * @category Type Types
  2163. */
  2164. interface IntrinsicBigIntType extends IntrinsicType {
  2165. intrinsicName: "bigint";
  2166. }
  2167. /**
  2168. * Determines whether the given type is the "bigint" intrinsic type.
  2169. * @category Types - Type Guards
  2170. * @example
  2171. * ```ts
  2172. * declare const type: ts.Type;
  2173. *
  2174. * if (isIntrinsicBigIntType(type)) {
  2175. * // ...
  2176. * }
  2177. * ```
  2178. */
  2179. declare function isIntrinsicBigIntType(type: ts.Type): type is IntrinsicBigIntType;
  2180. /**
  2181. * An "error" intrinsic type.
  2182. *
  2183. * This refers to a type generated when TypeScript encounters an error while
  2184. * trying to resolve the type.
  2185. * @category Type Types
  2186. */
  2187. interface IntrinsicErrorType extends IntrinsicType {
  2188. intrinsicName: "error";
  2189. }
  2190. /**
  2191. * Determines whether the given type is the "error" intrinsic type.
  2192. *
  2193. * The intrinsic error type occurs when TypeScript encounters an error while
  2194. * trying to resolve the type.
  2195. * @category Types - Type Guards
  2196. * @example
  2197. * ```ts
  2198. * declare const type: ts.Type;
  2199. *
  2200. * if (isIntrinsicErrorType(type)) {
  2201. * // ...
  2202. * }
  2203. * ```
  2204. */
  2205. declare function isIntrinsicErrorType(type: ts.Type): type is IntrinsicErrorType;
  2206. /**
  2207. * A "symbol" intrinsic type.
  2208. * @category Type Types
  2209. */
  2210. interface IntrinsicESSymbolType extends IntrinsicType {
  2211. intrinsicName: "symbol";
  2212. }
  2213. /**
  2214. * Determines whether the given type is the "symbol" intrinsic type.
  2215. * @category Types - Type Guards
  2216. * @example
  2217. * ```ts
  2218. * declare const type: ts.Type;
  2219. *
  2220. * if (isIntrinsicESSymbolType(type)) {
  2221. * // ...
  2222. * }
  2223. * ```
  2224. */
  2225. declare function isIntrinsicESSymbolType(type: ts.Type): type is IntrinsicESSymbolType;
  2226. /**
  2227. * An "intrinsic" (built-in to TypeScript) type.
  2228. * @category Type Types
  2229. */
  2230. interface IntrinsicType extends ts.Type {
  2231. intrinsicName: string;
  2232. objectFlags: ts.ObjectFlags;
  2233. }
  2234. /**
  2235. * Test if a type is an {@link IntrinsicType}.
  2236. * @category Types - Type Guards
  2237. * @example
  2238. * ```ts
  2239. * declare const type: ts.Type;
  2240. *
  2241. * if (isIntrinsicType(type)) {
  2242. * // ...
  2243. * }
  2244. * ```
  2245. */
  2246. declare function isIntrinsicType(type: ts.Type): type is IntrinsicType;
  2247. /**
  2248. * A "never" intrinsic type.
  2249. * @category Type Types
  2250. */
  2251. interface IntrinsicNeverType extends IntrinsicType {
  2252. intrinsicName: "never";
  2253. }
  2254. /**
  2255. * Determines whether the given type is the "never" intrinsic type.
  2256. * @category Types - Type Guards
  2257. * @example
  2258. * ```ts
  2259. * declare const type: ts.Type;
  2260. *
  2261. * if (isIntrinsicNeverType(type)) {
  2262. * // ...
  2263. * }
  2264. * ```
  2265. */
  2266. declare function isIntrinsicNeverType(type: ts.Type): type is IntrinsicNeverType;
  2267. /**
  2268. * A non-primitive intrinsic type.
  2269. * E.g. An "object" intrinsic type.
  2270. * @category Type Types
  2271. */
  2272. interface IntrinsicNonPrimitiveType extends IntrinsicType {
  2273. intrinsicName: "";
  2274. }
  2275. /**
  2276. * Determines whether the given type is a non-primitive intrinsic type.
  2277. * E.g. An "object" intrinsic type.
  2278. * @category Types - Type Guards
  2279. * @example
  2280. * ```ts
  2281. * declare const type: ts.Type;
  2282. *
  2283. * if (isIntrinsicNonPrimitiveType(type)) {
  2284. * // ...
  2285. * }
  2286. * ```
  2287. */
  2288. declare function isIntrinsicNonPrimitiveType(type: ts.Type): type is IntrinsicNonPrimitiveType;
  2289. /**
  2290. * A "null" intrinsic type.
  2291. * @category Type Types
  2292. */
  2293. interface IntrinsicNullType extends IntrinsicType {
  2294. intrinsicName: "null";
  2295. }
  2296. /**
  2297. * Determines whether the given type is the "null" intrinsic type.
  2298. * @category Types - Type Guards
  2299. * @example
  2300. * ```ts
  2301. * declare const type: ts.Type;
  2302. *
  2303. * if (isIntrinsicNullType(type)) {
  2304. * // ...
  2305. * }
  2306. * ```
  2307. */
  2308. declare function isIntrinsicNullType(type: ts.Type): type is IntrinsicNullType;
  2309. /**
  2310. * A "number" intrinsic type.
  2311. * @category Type Types
  2312. */
  2313. interface IntrinsicNumberType extends IntrinsicType {
  2314. intrinsicName: "number";
  2315. }
  2316. /**
  2317. * Determines whether the given type is the "number" intrinsic type.
  2318. * @category Types - Type Guards
  2319. * @example
  2320. * ```ts
  2321. * declare const type: ts.Type;
  2322. *
  2323. * if (isIntrinsicNumberType(type)) {
  2324. * // ...
  2325. * }
  2326. * ```
  2327. */
  2328. declare function isIntrinsicNumberType(type: ts.Type): type is IntrinsicNumberType;
  2329. /**
  2330. * A "string" intrinsic type.
  2331. * @category Type Types
  2332. */
  2333. interface IntrinsicStringType extends IntrinsicType {
  2334. intrinsicName: "string";
  2335. }
  2336. /**
  2337. * Determines whether the given type is the "string" intrinsic type.
  2338. * @category Types - Type Guards
  2339. * @example
  2340. * ```ts
  2341. * declare const type: ts.Type;
  2342. *
  2343. * if (isIntrinsicStringType(type)) {
  2344. * // ...
  2345. * }
  2346. * ```
  2347. */
  2348. declare function isIntrinsicStringType(type: ts.Type): type is IntrinsicStringType;
  2349. /**
  2350. * The built-in `undefined` type.
  2351. * @category Type Types
  2352. */
  2353. interface IntrinsicUndefinedType extends IntrinsicType {
  2354. intrinsicName: "undefined";
  2355. }
  2356. /**
  2357. * Determines whether the given type is the "undefined" intrinsic type.
  2358. * @category Types - Type Guards
  2359. * @example
  2360. * ```ts
  2361. * declare const type: ts.Type;
  2362. *
  2363. * if (isIntrinsicUndefinedType(type)) {
  2364. * // ...
  2365. * }
  2366. * ```
  2367. */
  2368. declare function isIntrinsicUndefinedType(type: ts.Type): type is IntrinsicUndefinedType;
  2369. /**
  2370. * The built-in `unknown` type.
  2371. * @category Type Types
  2372. */
  2373. interface IntrinsicUnknownType extends IntrinsicType {
  2374. intrinsicName: "unknown";
  2375. }
  2376. /**
  2377. * Determines whether the given type is the "unknown" intrinsic type.
  2378. * @category Types - Type Guards
  2379. * @example
  2380. * ```ts
  2381. * declare const type: ts.Type;
  2382. *
  2383. * if (isIntrinsicUnknownType(type)) {
  2384. * // ...
  2385. * }
  2386. * ```
  2387. */
  2388. declare function isIntrinsicUnknownType(type: ts.Type): type is IntrinsicUnknownType;
  2389. /**
  2390. * A "void" intrinsic type.
  2391. * @category Type Types
  2392. */
  2393. interface IntrinsicVoidType extends IntrinsicType {
  2394. intrinsicName: "void";
  2395. }
  2396. /**
  2397. * Determines whether the given type is the "void" intrinsic type.
  2398. * @category Types - Type Guards
  2399. * @example
  2400. * ```ts
  2401. * declare const type: ts.Type;
  2402. *
  2403. * if (isIntrinsicVoidType(type)) {
  2404. * // ...
  2405. * }
  2406. * ```
  2407. */
  2408. declare function isIntrinsicVoidType(type: ts.Type): type is IntrinsicVoidType;
  2409. /**
  2410. * A type that is both an {@link IntrinsicType} and a `FreshableType`
  2411. * @category Type Types
  2412. */
  2413. interface FreshableIntrinsicType extends ts.FreshableType, IntrinsicType {
  2414. }
  2415. /**
  2416. * Test if a type is a `FreshableIntrinsicType`.
  2417. * @category Types - Type Guards
  2418. * @example
  2419. * ```ts
  2420. * declare const type: ts.Type;
  2421. *
  2422. * if (isFreshableIntrinsicType(type)) {
  2423. * // ...
  2424. * }
  2425. */
  2426. declare function isFreshableIntrinsicType(type: ts.Type): type is FreshableIntrinsicType;
  2427. /**
  2428. * Test if a type is a `TupleTypeReference`.
  2429. * @category Types - Type Guards
  2430. * @example
  2431. * ```ts
  2432. * declare const type: ts.Type;
  2433. *
  2434. * if (isTupleTypeReference(type)) {
  2435. * // ...
  2436. * }
  2437. */
  2438. declare function isTupleTypeReference(type: ts.Type): type is ts.TupleTypeReference;
  2439. /**
  2440. * A boolean literal.
  2441. * i.e. Either a "true" or "false" literal.
  2442. * @category Type Types
  2443. */
  2444. interface BooleanLiteralType extends FreshableIntrinsicType {
  2445. intrinsicName: "false" | "true";
  2446. }
  2447. /**
  2448. * Determines whether the given type is a boolean literal type.
  2449. * @category Types - Type Guards
  2450. * @example
  2451. * ```ts
  2452. * declare const type: ts.Type;
  2453. *
  2454. * if (isBooleanLiteralType(type)) {
  2455. * // ...
  2456. * }
  2457. * ```
  2458. */
  2459. declare function isBooleanLiteralType(type: ts.Type): type is BooleanLiteralType;
  2460. /**
  2461. * Test if a type is a `BigIntLiteralType`.
  2462. * @category Types - Type Guards
  2463. * @example
  2464. * ```ts
  2465. * declare const type: ts.Type;
  2466. *
  2467. * if (isBigIntLiteralType(type)) {
  2468. * // ...
  2469. * }
  2470. * ```
  2471. */
  2472. declare function isBigIntLiteralType(type: ts.Type): type is ts.BigIntLiteralType;
  2473. /**
  2474. * A "false" literal.
  2475. * @category Type Types
  2476. */
  2477. interface FalseLiteralType extends BooleanLiteralType {
  2478. intrinsicName: "false";
  2479. }
  2480. /**
  2481. * Determines whether the given type is a boolean literal type for "false".
  2482. * @category Types - Type Guards
  2483. * @example
  2484. * ```ts
  2485. * declare const type: ts.Type;
  2486. *
  2487. * if (isFalseLiteralType(type)) {
  2488. * // ...
  2489. * }
  2490. * ```
  2491. */
  2492. declare function isFalseLiteralType(type: ts.Type): type is FalseLiteralType;
  2493. /**
  2494. * Test if a type is a `LiteralType`.
  2495. * @category Types - Type Guards
  2496. * @example
  2497. * ```ts
  2498. * declare const type: ts.Type;
  2499. *
  2500. * if (isLiteralType(type)) {
  2501. * // ...
  2502. * }
  2503. * ```
  2504. */
  2505. declare function isLiteralType(type: ts.Type): type is ts.LiteralType;
  2506. /**
  2507. * Test if a type is a `NumberLiteralType`.
  2508. * @category Types - Type Guards
  2509. * @example
  2510. * ```ts
  2511. * declare const type: ts.Type;
  2512. *
  2513. * if (isNumberLiteralType(type)) {
  2514. * // ...
  2515. * }
  2516. * ```
  2517. */
  2518. declare function isNumberLiteralType(type: ts.Type): type is ts.NumberLiteralType;
  2519. /**
  2520. * Test if a type is a `StringLiteralType`.
  2521. * @category Types - Type Guards
  2522. * @example
  2523. * ```ts
  2524. * declare const type: ts.Type;
  2525. *
  2526. * if (isStringLiteralType(type)) {
  2527. * // ...
  2528. * }
  2529. * ```
  2530. */
  2531. declare function isStringLiteralType(type: ts.Type): type is ts.StringLiteralType;
  2532. /**
  2533. * Test if a type is a `TemplateLiteralType`.
  2534. * @category Types - Type Guards
  2535. * @example
  2536. * ```ts
  2537. * declare const type: ts.Type;
  2538. *
  2539. * if (isTemplateLiteralType(type)) {
  2540. * // ...
  2541. * }
  2542. * ```
  2543. */
  2544. declare function isTemplateLiteralType(type: ts.Type): type is ts.TemplateLiteralType;
  2545. /**
  2546. * A "true" literal.
  2547. * @category Type Types
  2548. */
  2549. interface TrueLiteralType extends BooleanLiteralType {
  2550. intrinsicName: "true";
  2551. }
  2552. /**
  2553. * Determines whether the given type is a boolean literal type for "true".
  2554. * @category Types - Type Guards
  2555. * @example
  2556. * ```ts
  2557. * declare const type: ts.Type;
  2558. *
  2559. * if (isTrueLiteralType(type)) {
  2560. * // ...
  2561. * }
  2562. * ```
  2563. */
  2564. declare function isTrueLiteralType(type: ts.Type): type is TrueLiteralType;
  2565. /**
  2566. * `LiteralType` from typescript except that it allows for it to work on arbitrary types.
  2567. * @deprecated Use {@link FreshableIntrinsicType} instead.
  2568. * @category Type Types
  2569. */
  2570. interface UnknownLiteralType extends FreshableIntrinsicType {
  2571. value?: unknown;
  2572. }
  2573. /**
  2574. * Test if a type is a {@link UnknownLiteralType}.
  2575. * @deprecated Use {@link isFreshableIntrinsicType} instead.
  2576. * @category Types - Type Guards
  2577. * @example
  2578. * ```ts
  2579. * declare const type: ts.Type;
  2580. *
  2581. * if (isUnknownLiteralType(type)) {
  2582. * // ...
  2583. * }
  2584. * ```
  2585. */
  2586. declare function isUnknownLiteralType(type: ts.Type): type is UnknownLiteralType;
  2587. /**
  2588. * Test if a type is a `EvolvingArrayType`.
  2589. * @category Types - Type Guards
  2590. * @example
  2591. * ```ts
  2592. * declare const type: ts.Type;
  2593. *
  2594. * if (isEvolvingArrayType(type)) {
  2595. * // ...
  2596. * }
  2597. * ```
  2598. */
  2599. declare function isEvolvingArrayType(type: ts.Type): type is ts.EvolvingArrayType;
  2600. /**
  2601. * Test if a type is a `TupleType`.
  2602. * @category Types - Type Guards
  2603. * @example
  2604. * ```ts
  2605. * declare const type: ts.Type;
  2606. *
  2607. * if (isTupleType(type)) {
  2608. * // ...
  2609. * }
  2610. * ```
  2611. */
  2612. declare function isTupleType(type: ts.Type): type is ts.TupleType;
  2613. /**
  2614. * Test if a type is a `TypeReference`.
  2615. * @category Types - Type Guards
  2616. * @example
  2617. * ```ts
  2618. * declare const type: ts.Type;
  2619. *
  2620. * if (isTypeReference(type)) {
  2621. * // ...
  2622. * }
  2623. * ```
  2624. */
  2625. declare function isTypeReference(type: ts.Type): type is ts.TypeReference;
  2626. /**
  2627. * Test if a type is a `ConditionalType`.
  2628. * @category Types - Type Guards
  2629. * @example
  2630. * ```ts
  2631. * declare const type: ts.Type;
  2632. *
  2633. * if (isConditionalType(type)) {
  2634. * // ...
  2635. * }
  2636. * ```
  2637. */
  2638. declare function isConditionalType(type: ts.Type): type is ts.ConditionalType;
  2639. /**
  2640. * Test if a type is a `EnumType`.
  2641. * @category Types - Type Guards
  2642. * @example
  2643. * ```ts
  2644. * declare const type: ts.Type;
  2645. *
  2646. * if (isEnumType(type)) {
  2647. * // ...
  2648. * }
  2649. * ```
  2650. */
  2651. declare function isEnumType(type: ts.Type): type is ts.EnumType;
  2652. /**
  2653. * Test if a type is a `FreshableType`.
  2654. * @category Types - Type Guards
  2655. * @example
  2656. * ```ts
  2657. * declare const type: ts.Type;
  2658. *
  2659. * if (isFreshableType(type)) {
  2660. * // ...
  2661. * }
  2662. * ```
  2663. */
  2664. declare function isFreshableType(type: ts.Type): type is ts.FreshableType;
  2665. /**
  2666. * Test if a type is a `IndexType`.
  2667. * @category Types - Type Guards
  2668. * @example
  2669. * ```ts
  2670. * declare const type: ts.Type;
  2671. *
  2672. * if (isIndexType(type)) {
  2673. * // ...
  2674. * }
  2675. * ```
  2676. */
  2677. declare function isIndexType(type: ts.Type): type is ts.IndexType;
  2678. /**
  2679. * Test if a type is a `IndexedAccessType`.
  2680. * @category Types - Type Guards
  2681. * @example
  2682. * ```ts
  2683. * declare const type: ts.Type;
  2684. *
  2685. * if (isIndexedAccessType(type)) {
  2686. * // ...
  2687. * }
  2688. * ```
  2689. */
  2690. declare function isIndexedAccessType(type: ts.Type): type is ts.IndexedAccessType;
  2691. /**
  2692. * Test if a type is a `InstantiableType`.
  2693. * @category Types - Type Guards
  2694. * @example
  2695. * ```ts
  2696. * declare const type: ts.Type;
  2697. *
  2698. * if (isInstantiableType(type)) {
  2699. * // ...
  2700. * }
  2701. * ```
  2702. */
  2703. declare function isInstantiableType(type: ts.Type): type is ts.InstantiableType;
  2704. /**
  2705. * Test if a type is a `IntersectionType`.
  2706. * @category Types - Type Guards
  2707. * @example
  2708. * ```ts
  2709. * declare const type: ts.Type;
  2710. *
  2711. * if (isIntersectionType(type)) {
  2712. * // ...
  2713. * }
  2714. * ```
  2715. */
  2716. declare function isIntersectionType(type: ts.Type): type is ts.IntersectionType;
  2717. /**
  2718. * Test if a type is a `ObjectType`.
  2719. * @category Types - Type Guards
  2720. * @example
  2721. * ```ts
  2722. * declare const type: ts.Type;
  2723. *
  2724. * if (isObjectType(type)) {
  2725. * // ...
  2726. * }
  2727. * ```
  2728. */
  2729. declare function isObjectType(type: ts.Type): type is ts.ObjectType;
  2730. /**
  2731. * Test if a type is a `StringMappingType`.
  2732. * @category Types - Type Guards
  2733. * @example
  2734. * ```ts
  2735. * declare const type: ts.Type;
  2736. *
  2737. * if (isStringMappingType(type)) {
  2738. * // ...
  2739. * }
  2740. * ```
  2741. */
  2742. declare function isStringMappingType(type: ts.Type): type is ts.StringMappingType;
  2743. /**
  2744. * Test if a type is a `SubstitutionType`.
  2745. * @category Types - Type Guards
  2746. * @example
  2747. * ```ts
  2748. * declare const type: ts.Type;
  2749. *
  2750. * if (isSubstitutionType(type)) {
  2751. * // ...
  2752. * }
  2753. * ```
  2754. */
  2755. declare function isSubstitutionType(type: ts.Type): type is ts.SubstitutionType;
  2756. /**
  2757. * Test if a type is a `TypeParameter`.
  2758. *
  2759. * Note: It is intentional that this is not a type guard.
  2760. * @see https://github.com/JoshuaKGoldberg/ts-api-utils/issues/382
  2761. * @category Types - Type Guards
  2762. * @example
  2763. * ```ts
  2764. * declare const type: ts.Type;
  2765. *
  2766. * if (isTypeParameter(type)) {
  2767. * // ...
  2768. * }
  2769. * ```
  2770. */
  2771. declare function isTypeParameter(type: ts.Type): boolean;
  2772. /**
  2773. * Test if a type is a `TypeVariable`.
  2774. * @category Types - Type Guards
  2775. * @example
  2776. * ```ts
  2777. * declare const type: ts.Type;
  2778. *
  2779. * if (isTypeVariable(type)) {
  2780. * // ...
  2781. * }
  2782. * ```
  2783. */
  2784. declare function isTypeVariable(type: ts.Type): type is ts.TypeVariable;
  2785. /**
  2786. * Test if a type is a `UnionType`.
  2787. * @category Types - Type Guards
  2788. * @example
  2789. * ```ts
  2790. * declare const type: ts.Type;
  2791. *
  2792. * if (isUnionType(type)) {
  2793. * // ...
  2794. * }
  2795. * ```
  2796. */
  2797. declare function isUnionType(type: ts.Type): type is ts.UnionType;
  2798. /**
  2799. * Test if a type is a `UnionOrIntersectionType`.
  2800. * @category Types - Type Guards
  2801. * @example
  2802. * ```ts
  2803. * declare const type: ts.Type;
  2804. *
  2805. * if (isUnionOrIntersectionType(type)) {
  2806. * // ...
  2807. * }
  2808. * ```
  2809. */
  2810. declare function isUnionOrIntersectionType(type: ts.Type): type is ts.UnionOrIntersectionType;
  2811. /**
  2812. * Test if a type is a `UniqueESSymbolType`.
  2813. * @category Types - Type Guards
  2814. * @example
  2815. * ```ts
  2816. * declare const type: ts.Type;
  2817. *
  2818. * if (isUniqueESSymbolType(type)) {
  2819. * // ...
  2820. * }
  2821. * ```
  2822. */
  2823. declare function isUniqueESSymbolType(type: ts.Type): type is ts.UniqueESSymbolType;
  2824. /**
  2825. * Determines whether a type is definitely falsy. This function doesn't unwrap union types.
  2826. * @category Types - Utilities
  2827. * @example
  2828. * ```ts
  2829. * declare const type: ts.Type;
  2830. *
  2831. * if (isFalsyType(type)) {
  2832. * // ...
  2833. * }
  2834. * ```
  2835. */
  2836. declare function isFalsyType(type: ts.Type): boolean;
  2837. /**
  2838. * Get the intersection type parts of the given type.
  2839. *
  2840. * If the given type is not a intersection type, an array contain only that type will be returned.
  2841. * @category Types - Utilities
  2842. * @example
  2843. * ```ts
  2844. * declare const type: ts.Type;
  2845. *
  2846. * for (const typePart of intersectionTypeParts(type)) {
  2847. * // ...
  2848. * }
  2849. * ```
  2850. */
  2851. declare function intersectionTypeParts(type: ts.Type): ts.Type[];
  2852. /**
  2853. * Get the intersection or union type parts of the given type.
  2854. *
  2855. * Note that this is a shallow collection: it only returns `type.types` or `[type]`.
  2856. *
  2857. * If the given type is not an intersection or union type, an array contain only that type will be returned.
  2858. * @category Types - Utilities
  2859. * @example
  2860. * ```ts
  2861. * declare const type: ts.Type;
  2862. *
  2863. * for (const typePart of intersectionTypeParts(type)) {
  2864. * // ...
  2865. * }
  2866. * ```
  2867. */
  2868. declare function typeParts(type: ts.Type): ts.Type[];
  2869. /**
  2870. * Determines whether writing to a certain property of a given type is allowed.
  2871. * @category Types - Utilities
  2872. * @example
  2873. * ```ts
  2874. * declare const property: ts.Symbol;
  2875. * declare const type: ts.Type;
  2876. * declare const typeChecker: ts.TypeChecker;
  2877. *
  2878. * if (isPropertyReadonlyInType(type, property.getEscapedName(), typeChecker)) {
  2879. * // ...
  2880. * }
  2881. * ```
  2882. */
  2883. declare function isPropertyReadonlyInType(type: ts.Type, name: ts.__String, typeChecker: ts.TypeChecker): boolean;
  2884. /**
  2885. * Determines whether a type is thenable and thus can be used with `await`.
  2886. * @category Types - Utilities
  2887. * @example
  2888. * ```ts
  2889. * declare const node: ts.Node;
  2890. * declare const type: ts.Type;
  2891. * declare const typeChecker: ts.TypeChecker;
  2892. *
  2893. * if (isThenableType(typeChecker, node, type)) {
  2894. * // ...
  2895. * }
  2896. * ```
  2897. */
  2898. declare function isThenableType(typeChecker: ts.TypeChecker, node: ts.Node, type: ts.Type): boolean;
  2899. /**
  2900. * Determines whether a type is thenable and thus can be used with `await`.
  2901. * @category Types - Utilities
  2902. * @example
  2903. * ```ts
  2904. * declare const expression: ts.Expression;
  2905. * declare const typeChecker: ts.TypeChecker;
  2906. *
  2907. * if (isThenableType(typeChecker, expression)) {
  2908. * // ...
  2909. * }
  2910. * ```
  2911. * @example
  2912. * ```ts
  2913. * declare const expression: ts.Expression;
  2914. * declare const typeChecker: ts.TypeChecker;
  2915. * declare const type: ts.Type;
  2916. *
  2917. * if (isThenableType(typeChecker, expression, type)) {
  2918. * // ...
  2919. * }
  2920. * ```
  2921. */
  2922. declare function isThenableType(typeChecker: ts.TypeChecker, node: ts.Expression, type?: ts.Type): boolean;
  2923. /**
  2924. * Test if the given symbol has a readonly declaration.
  2925. * @category Symbols - Utilities
  2926. * @example
  2927. * ```ts
  2928. * declare const symbol: ts.Symbol;
  2929. * declare const typeChecker: ts.TypeChecker;
  2930. *
  2931. * if (symbolHasReadonlyDeclaration(symbol, typeChecker)) {
  2932. * // ...
  2933. * }
  2934. * ```
  2935. */
  2936. declare function symbolHasReadonlyDeclaration(symbol: ts.Symbol, typeChecker: ts.TypeChecker): boolean;
  2937. /**
  2938. * Get the union type parts of the given type.
  2939. *
  2940. * If the given type is not a union type, an array contain only that type will be returned.
  2941. * @category Types - Utilities
  2942. * @example
  2943. * ```ts
  2944. * declare const type: ts.Type;
  2945. *
  2946. * for (const typePart of unionTypeParts(type)) {
  2947. * // ...
  2948. * }
  2949. * ```
  2950. */
  2951. declare function unionTypeParts(type: ts.Type): ts.Type[];
  2952. /**
  2953. * TS's `type.isLiteral()` is bugged before TS v5.0 and won't return `true` for
  2954. * bigint literals. Use this function instead if you need to check for bigint
  2955. * literals in TS versions before v5.0. Otherwise, you should just use
  2956. * `type.isLiteral()`.
  2957. * @see https://github.com/microsoft/TypeScript/pull/50929
  2958. * @category Types - Utilities
  2959. * @example
  2960. * ```ts
  2961. * declare const type: ts.Type;
  2962. *
  2963. * if (typeIsLiteral(type)) {
  2964. * // ...
  2965. * }
  2966. * ```
  2967. */
  2968. declare function typeIsLiteral(type: ts.Type): type is ts.LiteralType;
  2969. /**
  2970. * Which "domain"(s) (most commonly, type or value space) a declaration is within.
  2971. */
  2972. declare enum DeclarationDomain {
  2973. Import = 8,
  2974. Namespace = 1,
  2975. Type = 2,
  2976. Value = 4,
  2977. Any = 7
  2978. }
  2979. /**
  2980. * Which "domain"(s) (most commonly, type or value space) a usage is within.
  2981. */
  2982. declare enum UsageDomain {
  2983. Namespace = 1,
  2984. Type = 2,
  2985. TypeQuery = 8,
  2986. Value = 4,
  2987. ValueOrNamespace = 5,
  2988. Any = 7
  2989. }
  2990. /**
  2991. * How an item (type or value) was declared and/or referenced.
  2992. */
  2993. interface UsageInfo {
  2994. /**
  2995. * Locations where the item was declared.
  2996. */
  2997. declarations: ts.Identifier[];
  2998. /**
  2999. * Which space(s) the item is within.
  3000. */
  3001. domain: DeclarationDomain;
  3002. /**
  3003. * Whether the item was exported from its module or namespace scope.
  3004. */
  3005. exported: boolean;
  3006. /**
  3007. * Whether the item's declaration was in the global scope.
  3008. */
  3009. inGlobalScope: boolean;
  3010. /**
  3011. * Each reference to the item in the file.
  3012. */
  3013. uses: Usage[];
  3014. }
  3015. /**
  3016. * An instance of an item (type or value) being used.
  3017. */
  3018. interface Usage {
  3019. /**
  3020. * Which space(s) the usage is within.
  3021. */
  3022. domain: UsageDomain;
  3023. location: ts.Identifier;
  3024. }
  3025. /**
  3026. * Creates a mapping of each declared type and value to its type information.
  3027. * @category Nodes - Other Utilities
  3028. * @example
  3029. * ```ts
  3030. * declare const sourceFile: ts.SourceFile;
  3031. *
  3032. * const usage = collectVariableUsage(sourceFile);
  3033. *
  3034. * for (const [identifier, information] of usage) {
  3035. * console.log(`${identifier.getText()} is used ${information.uses.length} time(s).`);
  3036. * }
  3037. * ```
  3038. */
  3039. declare function collectVariableUsage(sourceFile: ts.SourceFile): Map<ts.Identifier, UsageInfo>;
  3040. export { AccessKind, type AnyKeyword, type BigIntKeyword, type BooleanCompilerOptions, type BooleanKeyword, type BooleanLiteralType, type ConstAssertionExpression, type ConstAssertionIdentifier, DeclarationDomain, type FalseKeyword, type FalseLiteralType, type ForEachCommentCallback, type ForEachTokenCallback, type FreshableIntrinsicType, type ImportKeyword, type IntrinsicAnyType, type IntrinsicBigIntType, type IntrinsicBooleanType, type IntrinsicESSymbolType, type IntrinsicErrorType, type IntrinsicNeverType, type IntrinsicNonPrimitiveType, type IntrinsicNullType, type IntrinsicNumberType, type IntrinsicStringType, type IntrinsicType, type IntrinsicUndefinedType, type IntrinsicUnknownType, type IntrinsicVoidType, type NamedDeclarationWithName, type NeverKeyword, type NullKeyword, type NumberKeyword, type NumericOrStringLikeLiteral, type ObjectKeyword, type StrictCompilerOption, type StringKeyword, type SuperKeyword, type SymbolKeyword, type ThisKeyword, type TrueKeyword, type TrueLiteralType, type UndefinedKeyword, type UnknownKeyword, type UnknownLiteralType, UsageDomain, type UsageInfo as VariableInfo, type Usage as VariableUse, type VoidKeyword, collectVariableUsage, forEachComment, forEachToken, getAccessKind, getCallSignaturesOfType, getPropertyOfType, getWellKnownSymbolPropertyOfType, hasDecorators, hasExpressionInitializer, hasInitializer, hasJSDoc, hasModifiers, hasType, hasTypeArguments, includesModifier, intersectionTypeParts, isAbstractKeyword, isAccessExpression, isAccessibilityModifier, isAccessorDeclaration, isAccessorKeyword, isAnyKeyword, isArrayBindingElement, isArrayBindingOrAssignmentPattern, isAssertKeyword, isAssertsKeyword, isAssignmentKind, isAssignmentPattern, isAsyncKeyword, isAwaitKeyword, isBigIntKeyword, isBigIntLiteralType, isBindingOrAssignmentElementRestIndicator, isBindingOrAssignmentElementTarget, isBindingOrAssignmentPattern, isBindingPattern, isBlockLike, isBooleanKeyword, isBooleanLiteral, isBooleanLiteralType, isClassLikeDeclaration, isClassMemberModifier, isColonToken, isCompilerOptionEnabled, isConditionalType, isConstAssertionExpression, isConstKeyword, isDeclarationName, isDeclarationWithTypeParameterChildren, isDeclarationWithTypeParameters, isDeclareKeyword, isDefaultKeyword, isDestructuringPattern, isDotToken, isEndOfFileToken, isEntityNameExpression, isEntityNameOrEntityNameExpression, isEnumType, isEqualsGreaterThanToken, isEqualsToken, isEvolvingArrayType, isExclamationToken, isExportKeyword, isFalseKeyword, isFalseLiteral, isFalseLiteralType, isFalsyType, isForInOrOfStatement, isFreshableIntrinsicType, isFreshableType, isFunctionLikeDeclaration, isFunctionScopeBoundary, isImportExpression, isImportKeyword, isInKeyword, isIndexType, isIndexedAccessType, isInputFiles, isInstantiableType, isIntersectionType, isIntrinsicAnyType, isIntrinsicBigIntType, isIntrinsicBooleanType, isIntrinsicESSymbolType, isIntrinsicErrorType, isIntrinsicNeverType, isIntrinsicNonPrimitiveType, isIntrinsicNullType, isIntrinsicNumberType, isIntrinsicStringType, isIntrinsicType, isIntrinsicUndefinedType, isIntrinsicUnknownType, isIntrinsicVoidType, isIterationStatement, isJSDocComment, isJSDocNamespaceBody, isJSDocNamespaceDeclaration, isJSDocText, isJSDocTypeReferencingNode, isJsonMinusNumericLiteral, isJsonObjectExpression, isJsxAttributeLike, isJsxAttributeValue, isJsxChild, isJsxTagNameExpression, isJsxTagNamePropertyAccess, isLiteralToken, isLiteralType, isModifierFlagSet, isModuleBody, isModuleName, isModuleReference, isNamedDeclarationWithName, isNamedImportBindings, isNamedImportsOrExports, isNamespaceBody, isNamespaceDeclaration, isNeverKeyword, isNodeFlagSet, isNullKeyword, isNullLiteral, isNumberKeyword, isNumberLiteralType, isNumericOrStringLikeLiteral, isNumericPropertyName, isObjectBindingOrAssignmentElement, isObjectBindingOrAssignmentPattern, isObjectFlagSet, isObjectKeyword, isObjectType, isObjectTypeDeclaration, isOutKeyword, isOverrideKeyword, isParameterPropertyModifier, isPrivateKeyword, isPropertyAccessEntityNameExpression, isPropertyNameLiteral, isPropertyReadonlyInType, isProtectedKeyword, isPseudoLiteralToken, isPublicKeyword, isQuestionDotToken, isQuestionToken, isReadonlyKeyword, isSignatureDeclaration, isStaticKeyword, isStrictCompilerOptionEnabled, isStringKeyword, isStringLiteralType, isStringMappingType, isSubstitutionType, isSuperElementAccessExpression, isSuperExpression, isSuperKeyword, isSuperProperty, isSuperPropertyAccessExpression, isSymbolFlagSet, isSymbolKeyword, isSyntaxList, isTemplateLiteralType, isThenableType, isThisExpression, isThisKeyword, isTransientSymbolLinksFlagSet, isTrueKeyword, isTrueLiteral, isTrueLiteralType, isTupleType, isTupleTypeReference, isTypeFlagSet, isTypeOnlyCompatibleAliasDeclaration, isTypeParameter, isTypeReference, isTypeReferenceType, isTypeVariable, isUndefinedKeyword, isUnionOrIntersectionType, isUnionOrIntersectionTypeNode, isUnionType, isUniqueESSymbolType, isUnknownKeyword, isUnknownLiteralType, isUnparsedPrologue, isUnparsedSourceText, isUnparsedSyntheticReference, isValidPropertyAccess, isVariableLikeDeclaration, isVoidKeyword, symbolHasReadonlyDeclaration, typeIsLiteral, typeParts, unionTypeParts };