feat: added types for encoding.js for ts packages to consume it#12
Conversation
1f99b6d to
92aad68
Compare
7f7da95 to
107c189
Compare
a8c8797 to
2a825b0
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds TypeScript type definitions for the encoding.js module to enable TypeScript packages to consume it. This addresses an issue where the deprecated whatwg-encoding package was being replaced with @exodus/bytes, but the consuming package encoding-sniffer failed at type checking due to missing types.
Key Changes:
- Added
encoding.d.tsfile with type definitions for encoding functions and classes - Updated
package.jsonto include the type definition file in exports and files array
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| package.json | Added encoding.d.ts to files array and configured types export mapping for encoding.js module |
| encoding.d.ts | Added TypeScript type definitions for normalizeEncoding, getBOMEncoding, legacyHookDecode, labelToName functions and TextDecoder/TextEncoder/TextDecoderStream/TextEncoderStream classes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@ChALkeR thanks for reviewing the PR. :) PR still says:
Can you help me with these? |
|
@ajaymathur Already running! |
|
Thanks @ChALkeR 👍 |
|
Released in v1.8.0 |
Addressing issue cheeriojs/cheerio#4977
cheerio was dependent on whatwg-encoding which got deprecated in favour of @exodus/bytes and the consuming package https://github.com/fb55/encoding-sniffer/blob/master/package.json#L67 needs to be updated. The update failed at type check as encoding types were missing. Therefore added those.