# Type Alias Gösterimi Sorunu ve Çözümü

<figure><img src="https://2136337814-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3IVBqG9Jn8K2viWOpgUm%2Fuploads%2Fgit-blob-8ba247bb6f64b8706afa2eb9767a05bd324157fb%2FDALL%C2%B7E%202023-10-26%2023.53.04%20-%20illustration%20of%20a%20very%20cute%20cat%20with%20lineal%20colors%20lying%20down%20on%20a%20desk%20with%20programming%20books%2C%20a%20cup%20with%20the%20TypeScript%20logo%2C%20and%20type%20symbols.png?alt=media" alt=""><figcaption></figcaption></figure>

### İçerikte alttaki sorunlara çözüm bulacağız:

1. "VS Code TypeScript type hover display issue"
2. "VS Code displaying type alias as template literal TypeScript"
3. "Change how VS Code shows TypeScript type aliases"
4. "TypeScript type resolution problem in VS Code hover"
5. "VS Code not resolving TypeScript type alias correctly"

## TypeScript ile basit **`type`** yapıları tanımladığımızda yeni isim yerine detaylarını gösteriyor.

```typescript
export type PairId = Readonly<`${AssetSymbol}_${AssetSymbol}`>
```

<figure><img src="https://2136337814-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3IVBqG9Jn8K2viWOpgUm%2Fuploads%2Fgit-blob-cf81cf53688ff22f9e23cf3dbac90d064c4d71db%2Fimage%20(10).png?alt=media" alt=""><figcaption></figcaption></figure>

## Sorunu çözmek için **`alias`** isimli ek bir **`type`** daha tanımlıyoruz.

```typescript
type alias<t> = t & { _?: never }
export type PairId = alias<Readonly<`${AssetSymbol}_${AssetSymbol}`>>
```

<figure><img src="https://2136337814-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3IVBqG9Jn8K2viWOpgUm%2Fuploads%2Fgit-blob-1407f385fe9d7721ceffcec55e8b06b2212cd0db%2Fimage%20(1)%20(3).png?alt=media" alt=""><figcaption></figcaption></figure>

## Referanslar

{% embed url="<https://github.com/microsoft/TypeScript/issues/31940#issuecomment-1555533360>" %}
