Add TypeScript types for TextEncoder/TextDecoder to global type declarations
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 127k
- Forks
- 25.3k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 4
Description
Hey! Both TextEncoder and TextDecoder are now natively available in Hermes:
TextEncoderlanded in Hermes for RN 0.74 (https://github.com/facebook/hermes/issues/948)TextDecoderlanded in Dec 2025 (https://github.com/facebook/hermes/pull/1855), should ship with RN 0.85
But neither is declared in React Native's TypeScript globals (src/types/globals.d.ts), so TypeScript users have to either cast through any, pull in lib: ["dom"], or add their own declarations to use these APIs without type errors.
Would be great to add the type declarations now that the runtime support is there. Happy to submit a PR if that helps.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading src/types/globals.d.ts and inspect how existing global APIs are declared. Add declarations for TextEncoder and TextDecoder, then verify that TypeScript users can reference both APIs without casts, DOM libraries, or custom declarations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience, mobile
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100