-
Notifications
You must be signed in to change notification settings - Fork 227
[js-api-parser] add interface generator #13453
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
Conversation
KarishmaGhiya
commented
Jan 5, 2026
- adding interface generator
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.
Pull request overview
This PR adds an interface token generator to the js-api-parser tool, enabling the APIView parser to process TypeScript interface declarations. The implementation follows the existing pattern established by enum and function generators, with comprehensive test coverage.
Key Changes:
- Adds interface token generator with support for type parameters, constraints, and heritage clauses
- Refactors shared helper functions from the function generator into a common helpers module
- Includes extensive test coverage with 18 test cases covering various interface scenarios
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tools/apiview/parsers/js-api-parser/src/tokenGenerators/interfaces.ts |
New interface token generator implementation that handles interface declarations with type parameters and extends clauses |
tools/apiview/parsers/js-api-parser/test/tokenGenerators/inteface.spec.ts |
Comprehensive test suite for the interface generator (note: filename has typo) |
tools/apiview/parsers/js-api-parser/src/tokenGenerators/helpers.ts |
New shared helper module containing common token creation and processing utilities |
tools/apiview/parsers/js-api-parser/src/tokenGenerators/function.ts |
Refactored to use shared helpers, with cleaner type parameter access |
tools/apiview/parsers/js-api-parser/src/tokenGenerators/index.ts |
Updated to register the new interface generator and fix formatting |
tools/apiview/parsers/js-api-parser/test/tokenGenerators/interface.spec.ts
Show resolved
Hide resolved
tools/apiview/parsers/js-api-parser/src/tokenGenerators/interfaces.ts
Outdated
Show resolved
Hide resolved
maorleger
left a comment
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.
This looks good to me I think, @jeremymeng any concerns?
Would be good to see the diff in APIView staging for a few libraries... coming along well and I love how the refactor is broken down to small chunks!
|
Looks good! |
…aces.ts Co-authored-by: Copilot <[email protected]>
…aces.ts Co-authored-by: Copilot <[email protected]>
maorleger
left a comment
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.
Just wanted to flag the missing default type - let me know when I should review again 👍
maorleger
left a comment
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.
🚀