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

# api.UI

> toast, системные уведомления, диалог подтверждения

## toast

```js theme={null}
api.UI.toast(message, duration = 3000)
```

Уведомление внутри интерфейса YM. `duration` — время в мс.

```js theme={null}
api.UI.toast('Скорость: 1.5×', 1500);
```

## notify

```js theme={null}
api.UI.notify(title, body?, opts?)
```

Системное уведомление через Electron — появляется в трее Windows. Работает когда YM свёрнут.

```js theme={null}
api.UI.notify('Новый трек', 'Imagine Dragons — Bones');
```

## showConfirm

```js theme={null}
const ok = await api.UI.showConfirm(title, body)
// → true (OK) | false (Отмена)
```

```js theme={null}
const ok = await api.UI.showConfirm('Сброс', 'Удалить все данные?');
if (ok) api.Storage.set('config', null);
```

## Когда что использовать

| Ситуация                    | Метод         |
| --------------------------- | ------------- |
| Быстрая обратная связь      | `toast`       |
| Уведомление когда YM в фоне | `notify`      |
| Запросить подтверждение     | `showConfirm` |
