Skip to content
This repository was archived by the owner on Jun 11, 2026. It is now read-only.
This repository was archived by the owner on Jun 11, 2026. It is now read-only.

Convert type alias to interface? #4

@alloy

Description

@alloy

TypeScript allows for declaration merging of interfaces, which appears to be something that people do to extend types for react-native-web, whereas this cannot be done with type aliases. So it might be preferable to convert to interfaces.

interface X { foo: string }
interface X { bar: string } // merge declaration
const x: X = { foo: "foo", bar: "bar" }

In case it makes things easier, perhaps as a first step, we could also create a temp type alias and use it to extend an empty interface with:

type $1 = { foo: string }
interface X extends $1 {}
interface X { bar: string } // merge declaration
const x: X = { foo: "foo", bar: "bar" }

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedtype projectionAll about Flow to TypeScript projections

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions