(
program: ts.Program,
input: ts.ClassDeclaration,
importer: (name: string, module: string) => void
)
| 298 | } |
| 299 | |
| 300 | function createCloneMethod( |
| 301 | program: ts.Program, |
| 302 | input: ts.ClassDeclaration, |
| 303 | importer: (name: string, module: string) => void |
| 304 | ) { |
| 305 | return ts.factory.createMethodDeclaration( |
| 306 | [ |
| 307 | ts.factory.createModifier(ts.SyntaxKind.PublicKeyword), |
| 308 | ts.factory.createModifier(ts.SyntaxKind.StaticKeyword) |
| 309 | ], |
| 310 | undefined, |
| 311 | 'clone', |
| 312 | undefined, |
| 313 | undefined, |
| 314 | [ |
| 315 | ts.factory.createParameterDeclaration( |
| 316 | undefined, |
| 317 | undefined, |
| 318 | 'original', |
| 319 | undefined, |
| 320 | ts.factory.createTypeReferenceNode(input.name!.text, undefined), |
| 321 | undefined |
| 322 | ) |
| 323 | ], |
| 324 | ts.factory.createTypeReferenceNode(input.name!.text, undefined), |
| 325 | generateCloneBody(program, input, importer) |
| 326 | ); |
| 327 | } |
| 328 | |
| 329 | export default createEmitter('cloneable', (program, input) => { |
| 330 | console.log(`Writing Cloner for ${input.name!.text}`); |
no test coverage detected