(sf: ts.SourceFile, name: string)
| 890 | } |
| 891 | |
| 892 | export function getClass(sf: ts.SourceFile, name: string): ClassDeclaration<ts.ClassDeclaration> { |
| 893 | for (const stmt of sf.statements) { |
| 894 | if (isNamedClassDeclaration(stmt) && stmt.name.text === name) { |
| 895 | return stmt; |
| 896 | } |
| 897 | } |
| 898 | throw new Error(`Class ${name} not found in file: ${sf.fileName}: ${sf.text}`); |
| 899 | } |
| 900 | |
| 901 | export function getFunction( |
| 902 | sf: ts.SourceFile, |