Skip to content

[Feature] SvgName as const assertion #3

@luigigorlero

Description

@luigigorlero

Hello! Really enjoying using this :)
I was looking for a way to iterate over the union type, was wondering what your thoughts were on using a const assertions to declare the SvgName type.

So, instead of having:

export {}

declare global {
  export type SvgName = 'plus' | 'minus' | 'cross' | 'default' | etc…
}

the module would generate:

export const svgName = ['plus', 'minus', 'cross', 'default', etc…] as const

declare global {
  type SvgName = typeof svgName[number]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions