Skip to content

Type string union #7

@CavalcanteLeo

Description

@CavalcanteLeo

Would be great if it also worked with type union...

type IconName =
  // image(../../assets/icons/icon1.svg)
  | 'icon1' 
  // image(../../assets/icons/icon2.svg)
  | 'icon2'
  // image(../../assets/icons/icon3.svg)
  | 'icon3'
  // image(../../assets/icons/icon4.svg)
  | 'icon4'

Then I could use something like:

const icon: IconName = 'icon2' // <-- here it could show on autocomplete or while hovering 
Screenshot 2024-02-17 at 10 15 35 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions