Skip to content
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 custom types with inner types #278

Merged
merged 2 commits into from
Oct 20, 2024

Conversation

samuelmaddock
Copy link
Member

I'm considering making some of the IPC types support generics for electron/rfcs#8. While experimenting, I noticed we don't generate them for custom types.

@samuelmaddock samuelmaddock requested review from a team as code owners October 3, 2024 01:35
src/utils.ts Outdated
@@ -255,6 +255,8 @@ export const typify = (
// we'll have to qualify it with the Node.js namespace.
return 'NodeJS.ReadableStream';
}
// Custom type
if (innerTypes) return `${typeAsString}<${typify(innerTypes[0])}>`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

innerTypes is an array, we should technically do this for any number of inner types not just the first one. E.g. Foo<T, R> should be supported (I think the docs parser will read this)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed. I tested with docs-parser and received multiple innerTypes (nice work btw!)

@MarshallOfSound
Copy link
Member

This will be blocked on electron/electron#43985 just FYI, but should be good to go if you have the CFA token merge at will. Otherwise ping me on Slack and I can merge / release it.

@ckerr
Copy link
Member

ckerr commented Oct 20, 2024

electron/electron#43985 is merged so it shouldn't be blocking this PR anymore. @samuelmaddock @MarshallOfSound is this PR ready to merge?

@samuelmaddock samuelmaddock merged commit c57ff0c into electron:main Oct 20, 2024
3 checks passed
@samuelmaddock samuelmaddock deleted the feat/custom-inner-types branch October 20, 2024 21:11
Copy link

🎉 This PR is included in version 9.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants