You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// A *self-contained* demonstration of the problem follows...// There doesn't seem to be an API to create an Interface in the AST programmaticallyconst_implementsClause=ts.createHeritageClause(ts.SyntaxKind.ImplementsKeyword,[ts.createExpressionWithTypeArguments([],ts.createIdentifier('MyInterface'))]);const_exportModifier=ts.createToken(ts.SyntaxKind.ExportKeyword);const_classExpression=ts.createClassExpression([_exportModifier],'MyClass',[],[_implementsClause],[]);const_classStatement=ts.createStatement(_classExpression);letsrc=ts.createSourceFile('output.ts','',ts.ScriptTarget.ES5,false,ts.ScriptKind.TS);src=ts.updateSourceFileNode(src,[_classStatement]);
Expected behavior:
There should be an API for creating an Interface definition in a synthetic AST.
Actual behavior:
Doesn't seem like the API exists.
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.3.2
Code
Expected behavior:
There should be an API for creating an Interface definition in a synthetic AST.
Actual behavior:
Doesn't seem like the API exists.
The text was updated successfully, but these errors were encountered: