cardano-wasm: Add examples of object type names to objectType typescript documentation#1168
Open
cardano-wasm: Add examples of object type names to objectType typescript documentation#1168
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances cardano-wasm TypeScript declaration documentation by expanding the objectType JSDoc to include examples of other valid object type names, generated automatically from API metadata (closing #1024).
Changes:
- Update the TypeScript
.d.tsgenerator to inject an “Other types of objects would be:” list into each interface’sobjectTypedocumentation. - Add an Oxford-comma list formatter for cleaner English output.
- Regenerate the affected
cardano-wasm/lib-wrapper/*.d.tsfiles with the expanded docs.
Reviewed changes
Copilot reviewed 1 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
cardano-wasm/src-lib/Cardano/Wasm/Api/InfoToTypeScript.hs |
Adds generation logic to list sibling object type names in objectType docs. |
cardano-wasm/lib-wrapper/wallet.d.ts |
Regenerated objectType comment to include other object type examples. |
cardano-wasm/lib-wrapper/unsigned-tx.d.ts |
Regenerated objectType comment to include other object type examples. |
cardano-wasm/lib-wrapper/signed-tx.d.ts |
Regenerated objectType comment to include other object type examples. |
cardano-wasm/lib-wrapper/grpc-connection.d.ts |
Regenerated objectType comment to include other object type examples. |
cardano-wasm/lib-wrapper/cardano-api.d.ts |
Regenerated objectType comment, but currently includes the current type in the “other types” list. |
227d14b to
87153f4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog
Context
Closes #1024
The
objectTypeproperty in eachcardano-wasminterface had a comment that only mentioned the current object's type string. This made it hard for users to know what other values were possible. This PR generates the list of sibling object type names automatically and injects it into every declaration file'sobjectTypecomment.How to trust this PR
The generated
.d.tsfiles incardano-wasm/lib-wrapper/now each contain a line like:(with the current object excluded from the list). You can verify by inspecting the five updated
*.d.tsfiles incardano-wasm/lib-wrapper/.Checklist