@spec2ts/core
Version:
Core module for @spec2ts modules, includes codegen helpers and common parsing methods
11 lines (10 loc) • 790 B
TypeScript
import * as ts from "typescript";
export declare function findNode<T extends ts.Node>(nodes: ts.NodeArray<ts.Node>, kind: T extends {
kind: infer K;
} ? K : never, test?: (node: T) => boolean | undefined): T | undefined;
export declare function filterNodes<T extends ts.Node>(nodes: ts.NodeArray<ts.Node>, kind: T extends {
kind: infer K;
} ? K : never, test?: (node: T) => boolean | undefined): T[];
export declare function findFirstVariableDeclaration(nodes: ts.NodeArray<ts.Node>, name: string): ts.VariableDeclaration | undefined;
export declare function findFirstVariableDeclarationName(n: ts.VariableStatement): string | ts.__String | undefined;
export declare function findVariableDeclarationName(variable: ts.VariableStatement, name: string): ts.VariableDeclaration | null;