index.d.cts 82 KB

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