feat: add TypeScript definitions for bech32.js#34
Conversation
.gitignore
Outdated
| coverage | ||
| playground | ||
| *.tgz | ||
| package-lock.json |
bech32.d.ts
Outdated
| * Implements bech32 and bech32m from [BIP173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) | ||
| * and [BIP350](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki). |
There was a problem hiding this comment.
| * Implements bech32 and bech32m from [BIP173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) | |
| * and [BIP350](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki). | |
| * Implements bech32 and bech32m from | |
| * [BIP173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) | |
| * and [BIP350](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki). |
And sync that into README
There was a problem hiding this comment.
Updated the formatting in both bech32.d.ts and README.md as suggested. (608f3e8)
Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
608f3e8 to
548047b
Compare
.gitignore
Outdated
bech32.d.ts
Outdated
bech32.d.ts
Outdated
| * [BIP173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) | ||
| * and [BIP350](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki). |
bech32.d.ts
Outdated
| * and [BIP350](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki). | ||
| * | ||
| * ```js | ||
| * import { fromBech32, toBech32, fromBech32m, toBech32m, getPrefix } from '@exodus/bytes/bech32.js' |
Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
bech32.d.ts
Outdated
| } | ||
|
|
||
| /** | ||
| * Encode bytes to a bech32 string (BIP 173) |
There was a problem hiding this comment.
- Remove
(BIP 173)here and below - Sync these docs into README.md
There was a problem hiding this comment.
Removed BIP references from function docs and synced the descriptions to README.md. (2e0c199)
Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds TypeScript definitions for the bech32.js module, enabling TypeScript users to have proper type checking and IntelliSense support when working with bech32 and bech32m encoding/decoding functions.
Changes:
- Added TypeScript definition file (bech32.d.ts) with type definitions for all exported functions
- Updated package.json to include the type definitions in exports and files
- Enhanced README.md documentation with clearer function descriptions
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| bech32.d.ts | Complete TypeScript definitions for bech32/bech32m encode/decode functions with comprehensive JSDoc documentation |
| package.json | Added bech32.d.ts to files array and exports configuration to properly expose TypeScript types |
| README.md | Improved documentation formatting with clearer descriptions for each function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Plan: Add TypeScript definitions for bech32.js
bech32.d.tsfile with proper type definitions for:toBech32(prefix, bytes, limit?)functionfromBech32(str, limit?)functiontoBech32m(prefix, bytes, limit?)functionfromBech32m(str, limit?)functiongetPrefix(str, limit?)functionpackage.jsonexports to include types for bech32.jspackage.jsonfiles section to include bech32.d.tsOriginal prompt
bech32.js#28💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.