tessl install tessl/npm-ts-api-utils@2.0.0Utility functions for working with TypeScript's API, providing comprehensive tools for analyzing and manipulating TypeScript AST nodes, types, and compiler APIs.
Agent Success
Agent success rate when using this tile
79%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.98x
Baseline
Agent success rate without this tile
40%
A tool that analyzes TypeScript source code and classifies different types of nodes found in the Abstract Syntax Tree (AST).
any, boolean, number, and string type keywords, the classifier identifies and counts each type keyword category @testtrue and false literals, the classifier identifies and counts true literals and false literals separately @testpublic, private, protected, static, readonly, and abstract modifiers, the classifier identifies and counts each modifier type @test@generates
/**
* Represents the classification results for a TypeScript source file
*/
export interface ClassificationResult {
typeKeywords: {
any: number;
boolean: number;
number: number;
string: number;
null: number;
};
booleanLiterals: {
true: number;
false: number;
};
modifiers: {
public: number;
private: number;
protected: number;
static: number;
readonly: number;
abstract: number;
};
}
/**
* Analyzes a TypeScript source file and classifies the different types of nodes
*
* @param sourceCode - The TypeScript source code to analyze
* @returns A ClassificationResult object containing counts of different node types
*/
export function classifyNodes(sourceCode: string): ClassificationResult;Provides type guard functions for TypeScript AST nodes.
@satisfied-by
Provides the TypeScript compiler API for parsing and analyzing TypeScript code.
@satisfied-by