@ply-ct/ply
Version:
REST API Automated Testing
34 lines (33 loc) • 1.25 kB
TypeScript
import * as ts from 'typescript';
export declare type Args = {
[key: string]: string | number | boolean;
};
export interface Decorator {
file: string;
class: string;
method?: string;
decorator: string;
arg?: string;
args?: Args;
}
export declare class Ts {
readonly program: ts.Program;
readonly checker: ts.TypeChecker;
constructor(tsConfig?: string, sourcePatterns?: string[]);
scanClassDecorators(decs: string[]): Decorator[];
findClassDecorators(sourceFile: ts.SourceFile, classDeclaration: ts.ClassDeclaration, decs: string[]): Decorator[];
findMethodDecorators(classDecorator: Decorator, decs: string[]): Decorator[];
getClassDeclaration(file: string, className: string): ts.ClassDeclaration | undefined;
getDecoratorSymbol(decorator: ts.Decorator): ts.Symbol | undefined;
static decoratorArgs(decorator: ts.Decorator): {
arg?: string;
args?: Args;
};
static methodDeclarations(classDeclaration: ts.ClassDeclaration): ts.MethodDeclaration[];
static symbolAtNode(node: ts.Node): ts.Symbol | undefined;
static isExported(node: ts.Node): boolean;
/**
* Only handles simple types
*/
static parseObjectLiteral(objLit: any): Args;
}