react / react/react-native

Add TypeScript types for TextEncoder/TextDecoder to global type declarations

Open Beginner friendly
#56,325 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs: Attention Needs: Repro
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:

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.