You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During development, we use IxIcon type to check if we used correct icon.
/**
* The original IxIcon type union includes (string & {})
* very hard to exclude, the Exclude typescript function would result in never type.
*
* This Literal IxIcon font will help in checking for renamed / removed icons as the storybook
* would simply fail to build.
*/
type GetLiteral<Type extends string | number, Value> = Value extends Type
? Type extends Value
? never
: Value
: never
type ObtainLiterals<T> = T extends infer R ? GetLiteral<string, R> : never
type IxIconsLiterals = ObtainLiterals<IxIcons>
Expected behavior
To be able to import IxIcons in TypeScript
Minimal reproduction of the problem with instructions
import { IxIcons } from '@siemens/ix-icons/dist/types/components'
What is the motivation / use case for changing the behavior?
In case I derive Icon literal type, I have nice way in code that checks if I actually used the correct name of an icon.
It can easily happen during migrations, that you might remove or rename icon, and our code would just compile and have incorect icon name.
The text was updated successfully, but these errors were encountered:
I'm submitting a...
Current behavior
During development, we use IxIcon type to check if we used correct icon.
Expected behavior
To be able to import IxIcons in TypeScript
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
In case I derive Icon literal type, I have nice way in code that checks if I actually used the correct name of an icon.
It can easily happen during migrations, that you might remove or rename icon, and our code would just compile and have incorect icon name.
The text was updated successfully, but these errors were encountered: