-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow free function exports in typewriter #1379
Conversation
…mcalvi/function-exports
Signed-off-by: github-actions <[email protected]>
@@ -411,11 +411,10 @@ export class TypeScriptRenderer extends Renderer { | |||
throw new Error(`Symbol ${sym} (in ${sym.scope}) not visible from ${this.scopes[0]} (missing import?)`); | |||
} | |||
|
|||
protected renderFunction(func: CallableDeclaration) { | |||
protected renderFunction(func: CallableDeclaration & TypeDeclaration) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct, we want to accept all CallableDeclarations
not, just the ones that are also a TypeDeclaration
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we keep the signature as it is.
Then w can have a guard isExported(x): is { exported: true } { ... }
to check if exported
exists and is true.
…-service-spec into comcalvi/function-exports
@aws-cdk/aws-service-spec: No model change detected |
…mcalvi/function-exports
/** | ||
* Whether this type is being exported from its scope | ||
*/ | ||
public get export() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we have two things that do the same. I rather have 2 different interface.
Signed-off-by: github-actions <[email protected]>
Typewriter does not allow free functions to be exported today. This PR enables exporting free functions.
Required for aws/aws-cdk#31850.