(sourceFile: ts.SourceFile)
| 74 | } |
| 75 | |
| 76 | function extractViewModelProps(sourceFile: ts.SourceFile): string[] { |
| 77 | const props: string[] = []; |
| 78 | |
| 79 | for (const statement of sourceFile.statements) { |
| 80 | if (!ts.isInterfaceDeclaration(statement)) continue; |
| 81 | const name = statement.name.text; |
| 82 | if (!name.endsWith('ViewModel') && !name.endsWith('VM') && !name.endsWith('Props')) continue; |
| 83 | |
| 84 | for (const member of statement.members) { |
| 85 | if (ts.isPropertySignature(member) && member.name && ts.isIdentifier(member.name)) { |
| 86 | props.push(member.name.text); |
| 87 | } |
| 88 | } |
| 89 | if (props.length > 0) break; |
| 90 | } |
| 91 | |
| 92 | return props; |
| 93 | } |
| 94 | |
| 95 | function extractStateProps(sourceFile: ts.SourceFile): string[] { |
| 96 | const props: string[] = []; |
no test coverage detected