@vendure/ngx-translate-extract
Version:
Extract strings from projects using ngx-translate
23 lines (22 loc) • 2.27 kB
TypeScript
import pkg, { Node, Identifier, ClassDeclaration, ConstructorDeclaration, CallExpression, Expression, SourceFile } from 'typescript';
export declare function getAST(source: string, fileName?: string): SourceFile;
export declare function getNamedImportIdentifiers(node: Node, moduleName: string, importPath: string | RegExp): Identifier[];
export declare function getNamedImport(node: Node, importName: string, importPath: string | RegExp): string | null;
export declare function getNamedImportAlias(node: Node, importName: string, importPath: string | RegExp): string | null;
export declare function findClassDeclarations(node: Node, name?: string): ClassDeclaration[];
export declare function findFunctionExpressions(node: Node): pkg.Node[];
export declare function getSuperClassName(node: Node): string | null;
export declare function getImportPath(node: Node, className: string): string | null;
export declare function findClassPropertiesByType(node: ClassDeclaration, type: string): string[];
export declare function findConstructorDeclaration(node: ClassDeclaration): ConstructorDeclaration;
export declare function findMethodParameterByType(node: Node, type: string): string | null;
export declare function findVariableNameByInjectType(node: Node, type: string): string | null;
export declare function findMethodCallExpressions(node: Node, propName: string, fnName: string | string[]): CallExpression[];
export declare function findClassPropertiesConstructorParameterByType(node: ClassDeclaration, type: string): string[];
export declare function findClassPropertiesDeclarationByType(node: ClassDeclaration, type: string): string[];
export declare function findClassPropertiesDeclarationByInject(node: ClassDeclaration, type: string): string[];
export declare function findClassPropertiesGetterByType(node: ClassDeclaration, type: string): string[];
export declare function findFunctionCallExpressions(node: Node, fnName: string | string[]): CallExpression[];
export declare function findSimpleCallExpressions(node: Node, fnName: string): pkg.CallExpression[];
export declare function findPropertyCallExpressions(node: Node, prop: string, fnName: string | string[]): CallExpression[];
export declare function getStringsFromExpression(expression: Expression): string[];