| 319 | } |
| 320 | |
| 321 | render(): string { |
| 322 | let source = ''; |
| 323 | for (const [moduleName, alias] of this.imports) { |
| 324 | source += `import * as ${alias} from '${moduleName}';\n`; |
| 325 | } |
| 326 | source += '\n'; |
| 327 | for (const expr of [...this.pipeInstStatements, ...this.typeCtorStatements]) { |
| 328 | source += `${expr.print()};\n`; |
| 329 | } |
| 330 | source += '\n'; |
| 331 | for (const stmt of this.tcbStatements) { |
| 332 | source += stmt + '\n'; |
| 333 | } |
| 334 | return source + '\nexport const IS_A_MODULE = true;\n'; |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | /** Generates a declared (non-inline) type constructor for a directive. */ |