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 TypeScript static analysis utility that inspects types for specific properties and callable signatures.
@generates
import * as ts from 'typescript';
/**
* Extracts information about all call signatures from a type.
* Returns an array of objects describing each signature's parameters and return type.
*
* @param type - The TypeScript type to inspect
* @param typeChecker - The TypeScript type checker instance
* @returns Array of signature information objects
*/
export function inspectCallSignatures(
type: ts.Type,
typeChecker: ts.TypeChecker
): Array<{ parameters: string[]; returnType: string }>;
/**
* Retrieves a specific property from a type by name.
* Returns the property symbol if found, undefined otherwise.
*
* @param type - The TypeScript type to inspect
* @param propertyName - The name of the property to retrieve
* @returns The property symbol or undefined
*/
export function getTypeProperty(
type: ts.Type,
propertyName: string
): ts.Symbol | undefined;
/**
* Retrieves a well-known symbol property from a type.
* Returns the symbol property if found, undefined otherwise.
*
* @param type - The TypeScript type to inspect
* @param symbolName - The well-known symbol name (e.g., 'iterator', 'toStringTag')
* @param typeChecker - The TypeScript type checker instance
* @returns The symbol property or undefined
*/
export function getWellKnownSymbol(
type: ts.Type,
symbolName: string,
typeChecker: ts.TypeChecker
): ts.Symbol | undefined;The TypeScript compiler API for type inspection.
Provides utility functions for working with TypeScript's API.