ionic-team / ionic-team/ionicons
feat: add types for icon names
Offen
type: feature request
- Vorherrschende Sprache
- TypeScript
- Sterne
- 18.2k
- Forks
- 2.1k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
### Describe Problem
it should be possible to type the `name` and `icon` props with available icon names
### Describe Preferred Solution
`name` could be typed as:
```typescript
type IconNames = 'accessibility' | 'accessibility-outline' | 'accessibility-sharp'...
```
`icon` could be typed as:
```typescript
type IconSource = IconNames | (string & {})
```
You can find an [explanation for the `string & {}` part on google](https://www.google.com/search?q=string+%2526+%7B%7D)
### Describe Alternatives
_No response_
### Additional Information
_No response_
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.