ionic-team / ionic-team/ionicons

feat: add types for icon names

Offen
#1,269 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
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

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.