> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whop.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# DmsListElement (Eski)

> Eski DmsListElement için referans. Yeni entegrasyonlar için @whop/elements içindeki ChannelListElement'i kullanın.

## Genel bakış

Bir DM listesi görüntüleyen bir kullanıcı arayüzü öğesi.

## Kullanım

### Temel kullanım

```typescript theme={null}
// Create the element
const element = session.createElement("dms-list-element", {
  onReady: (element) => {
    console.log("Dms list element is ready");
  },
});

// Mount it to a container
element.mount("#dms-list-container");
```

### Olayları dinleme

```typescript theme={null}
const element = session.createElement("dms-list-element", {});

element.on("ready", () => {
  console.log("Dms list element is ready");
});

element.on("channelSelected", (ev) => {
  console.log("Channel selected:", ev.detail.id);
});

element.mount("#dms-list-container");
```

```typescript theme={null}
const element = session.createElement("dms-list-element", {
  onReady: (element) => {
    console.log("Dms list element is ready");
  },
});
```

## Olaylar

DmListElement tarafından yayılan olaylar.

Bu olayları `on()` metodunu kullanarak veya seçeneklerde geri çağırma fonksiyonları geçirerek dinleyin.

### `error`

Öğenin başlatılması veya çalışması sırasında bir hata oluştuğunda yayılır.

**Geri çağırma imzası:** (error: `unknown`) => void

### `ready`

Öğe yüklemeyi tamamladığında ve kullanıcı etkileşimine hazır olduğunda yayılır.

**Geri çağırma imzası:** (element: `DmsListElement`) => void

### `optionsUpdated`

Öğenin seçenekleri `updateOptions()` aracılığıyla güncellendiğinde yayılır.

**Geri çağırma imzası:** (options: [`DmsListElementOptions`](#dmslistelementoptions)) => void

### `snapshot`

Öğenin dahili durumu değiştiğinde yayılır.

**Geri çağırma imzası:** (snapshot: [`DmsListElementSnapshot`](#dmslistelementsnapshot)) => void

### `channelSelected`

Kullanıcı bir kanala tıkladığında yayılır.

**Geri çağırma imzası:** (ev: `CustomEvent`\<\{ id: `string`; }>) => void

## Metodlar

### `mount(container)`

Öğeyi bir DOM kapsayıcısına yerleştirir.

Kapsayıcı boş bir öğe olmalıdır. Öğe, alt öğe olarak eklenir.
Öğe zaten yerleştirilmişse, bu metod bir uyarı kaydeder ve geri döner.

| Parametre | Tür | Açıklama |
| - | - | - |
| `container` | `HTMLElement` \| `#$\{`string`\}` | Kapsayıcı öğe veya '#' ile başlayan bir CSS seçicisi |

```typescript theme={null}
// Using a selector
element.mount("#my-container");

// Using an element reference
const container = document.getElementById("my-container");
element.mount(container);
```

### `unmount()`

Öğeyi DOM'dan kaldırır ve tüm olay dinleyicilerini temizler.

Kaldırıldıktan sonra öğe örneği yeniden kullanılmamalıdır.
Yeniden yerleştirmeniz gerekirse yeni bir öğe örneği oluşturun.

```typescript theme={null}
// Unmount when done
element.unmount();

// Commonly used in event handlers
element.on("complete", () => {
  element.unmount();
});
```

### `updateOptions(options)`

Oluşturulduktan sonra öğenin yapılandırma seçeneklerini günceller.

Yalnızca sağlanan seçenekler güncellenir; diğer seçenekler değişmeden kalır.
Öğe yeni seçeneklerle yeniden işlenir.

| Parametre | Tür | Açıklama |
| - | - | - |
| `options` | `Partial`\<[`DmsListElementOptions`](#dmslistelementoptions)> | Güncellenecek değerleri içeren kısmi seçenekler nesnesi |

```typescript theme={null}
// Update a single option
element.updateOptions({
  onComplete: (ev) => {
    console.log("New handler!");
  },
});
```

### `getSnapshot()`

Öğenin mevcut durum anlık görüntüsünü alır.

Anlık görüntü, yükleme durumu, form değerleri veya öğeye özgü diğer veriler
gibi öğenin mevcut dahili durumunu içerir.

**Döndürür:** [`DmsListElementSnapshot`](#dmslistelementsnapshot)

```typescript theme={null}
const snapshot = element.getSnapshot();
console.log("Current state:", snapshot.state);

// Or listen for changes
element.on("snapshot", (snapshot) => {
  console.log("State changed:", snapshot);
});
```

## Stil

Bu öğeyi `appearance.classes` ile özelleştirin. Kararlı sınıf adlarının tam listesi ve örnek kod parçacıkları için [stil referansına](https://docs.whop.com/tr/sdk/elements/styling-reference.md) bakın.

## Türler

### DmsListElementOptions

DmsListElement için yapılandırma seçenekleri.

| Özellik | Tür | Zorunlu | Varsayılan | Açıklama |
| - | - | - | - | - |
| `companyId` | `string \| undefined` | Hayır | - | Kanalların filtreleneceği hesap kimliği. |
| `selectedChannel` | `string \| undefined` | Hayır | - | Şu anda seçili olan kanalın kimliği. |
| `emptyState` | `EmptyStateOptions \| undefined` | Hayır | - | Kanal olmadığında görüntülenen özel boş durum. |
| `onReady` | `((element: DmsListElement) => void) \| undefined` | Hayır | - | Öğe yüklemeyi tamamladığında ve etkileşime hazır olduğunda tetiklenen geri çağırma. Bu, 'ready' olayını dinlemekle eşdeğerdir. |
| `onEvent` | `((event: DmsListElementEvent) => void) \| undefined` | Hayır | - | Bir DM listesi öğesi olayı yayıldığında tetiklenen geri çağırma. |

### DmsListElementSnapshot

DmsListElement'in mevcut durumunu temsil eder.

Mevcut durumu almak için `element.getSnapshot()` kullanın veya değişiklikler için `snapshot` olayını dinleyin.

| Özellik | Tür | Zorunlu | Varsayılan | Açıklama |
| - | - | - | - | - |
| `state` | `"ready" \| "loading"` | Evet | - | Öğenin mevcut yükleme durumu. - '"loading"' - Öğe başlatılıyor - '"ready"' - Öğe tamamen yüklendi ve etkileşime hazır |


## Related topics

- [Kanal Listesi Öğesini Gömün](https://docs.whop.com/tr/developer/guides/chat/dms-list-element.md)
- [List messages](https://docs.whop.com/tr/api-reference/legacy/messages/list-messages.md)
- [List reactions](https://docs.whop.com/tr/api-reference/legacy/reactions/list-reactions.md)
