(sf: ts.SourceFile, name: string)
| 913 | } |
| 914 | |
| 915 | export function getClass(sf: ts.SourceFile, name: string): ClassDeclaration<ts.ClassDeclaration> { |
| 916 | for (const stmt of sf.statements) { |
| 917 | if (isNamedClassDeclaration(stmt) && stmt.name.text === name) { |
| 918 | return stmt; |
| 919 | } |
| 920 | } |
| 921 | throw new Error(`Class ${name} not found in file: ${sf.fileName}: ${sf.text}`); |
| 922 | } |
| 923 | |
| 924 | export function getFunction( |
| 925 | sf: ts.SourceFile, |