Skip to content

Add TypeScript types for TextEncoder/TextDecoder to global type declarations #56325

@deyaaeldeen

Description

@deyaaeldeen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions