Skip to content

docs: add JSDoc documentation to useConnect hook and requestRaw function#493

Open
Dark-Brain07 wants to merge 8 commits intostx-labs:mainfrom
Dark-Brain07:improve/docs-and-types
Open

docs: add JSDoc documentation to useConnect hook and requestRaw function#493
Dark-Brain07 wants to merge 8 commits intostx-labs:mainfrom
Dark-Brain07:improve/docs-and-types

Conversation

@Dark-Brain07
Copy link
Copy Markdown

Description

Added comprehensive JSDoc documentation to undocumented functions in the @stacks/connect and @stacks/connect-react packages to improve the developer experience and IDE support.

Changes

packages/connect/src/request.ts

  • Added JSDoc to requestRaw with @param, @returns, @throws, and cross-reference to request via @link

packages/connect-react/src/react/hooks/use-connect.ts

  • Added JSDoc to the useConnect hook with usage example
  • Added JSDoc to all 7 returned action functions:
    • doContractCall - contract call transaction popup
    • doContractDeploy - contract deploy popup
    • doSTXTransfer - STX transfer popup
    • doProfileUpdate - profile update popup
    • doSignTransaction - sign pre-built transaction hex
    • sign - arbitrary message signing
    • signPsbt - PSBT signing

Motivation

The useConnect hook is the primary React integration point for Stacks wallets, but its functions had no documentation. Developers using useConnect had to read the source to understand what each function does and what parameters it accepts.

Testing

Documentation-only changes. No functional code was modified.

@Dark-Brain07 Dark-Brain07 force-pushed the improve/docs-and-types branch from d255fc9 to 0403aa6 Compare February 14, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant