Skip to content

cardano-wasm: Add examples of object type names to objectType typescript documentation#1168

Open
palas wants to merge 1 commit intomasterfrom
improve-comment-for-object-type
Open

cardano-wasm: Add examples of object type names to objectType typescript documentation#1168
palas wants to merge 1 commit intomasterfrom
improve-comment-for-object-type

Conversation

@palas
Copy link
Copy Markdown
Contributor

@palas palas commented Mar 31, 2026

Changelog

- description: |
    Added examples of all possible object type names to the `objectType` property
    documentation in `cardano-wasm` TypeScript declaration files.
  type:
  - documentation
  projects:
  - cardano-wasm

Context

Closes #1024

The objectType property in each cardano-wasm interface 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's objectType comment.

How to trust this PR

The generated .d.ts files in cardano-wasm/lib-wrapper/ now each contain a line like:

 * Other types of objects would be:
 * "CardanoApi", "GrpcConnection", "SignedTx", and "Wallet"

(with the current object excluded from the list). You can verify by inspecting the five updated *.d.ts files in cardano-wasm/lib-wrapper/.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

Copilot AI review requested due to automatic review settings March 31, 2026 20:49
@palas palas linked an issue Mar 31, 2026 that may be closed by this pull request
@palas palas self-assigned this Mar 31, 2026
@palas palas added the WASM label Mar 31, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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.ts generator to inject an “Other types of objects would be:” list into each interface’s objectType documentation.
  • Add an Oxford-comma list formatter for cleaner English output.
  • Regenerate the affected cardano-wasm/lib-wrapper/*.d.ts files 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.

@palas palas force-pushed the improve-comment-for-object-type branch from 227d14b to 87153f4 Compare March 31, 2026 21:37
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.

Improve the comment about objectType property in cardano-wasm

2 participants