-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Add TypeScript types for TextEncoder/TextDecoder to global type declarations #56325
Copy link
Copy link
Open
Labels
Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.
Description
Hey! Both TextEncoder and TextDecoder are now natively available in Hermes:
TextEncoderlanded in Hermes for RN 0.74 (using TextEncoder with hermes hermes#948)TextDecoderlanded in Dec 2025 (Add support for TextDecoder hermes#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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.