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%
Build a TypeScript tool that analyzes class declarations and reports on the access patterns of their members. The tool should identify which class members have specific access modifiers and categorize them accordingly.
Your tool should:
publicprivateprotectedreadonlystaticabstractprivate readonly, public static)The tool should output a JSON structure with the following format:
{
"className": string,
"members": {
"public": string[],
"private": string[],
"protected": string[],
"readonly": string[],
"static": string[],
"abstract": string[]
}
}[]private readonly, the member appears in both arrays @test@generates
/**
* Analyzes a TypeScript source file and returns information about class member modifiers
* @param sourceFilePath - Path to the TypeScript source file to analyze
* @returns Array of analysis results, one per class found in the source file
*/
export function analyzeClassModifiers(sourceFilePath: string): ClassAnalysisResult[];
export interface ClassAnalysisResult {
className: string;
members: {
public: string[];
private: string[];
protected: string[];
readonly: string[];
static: string[];
abstract: string[];
};
}Provides TypeScript compiler API for parsing and analyzing TypeScript code.
Provides utility functions for working with TypeScript's API, including modifier checking capabilities.