UNPKG

594 BJavaScriptView Raw
1const { Attachment } = require('../index');
2
3/**
4 * Обычная инициализация
5 */
6new Attachment('wall', -29060604, 448799, 'hash');
7
8/**
9 * Инициализация из строки
10 */
11new Attachment('wall-29060604_448799');
12
13/**
14 * Инициализация из объекта API, полученного в событии / запросе
15 */
16new Attachment({
17 type: 'photo',
18 photo: {
19 id: 1,
20 album_id: 4,
21 owner_id: -1,
22 user_id: 100,
23 text: '',
24 date: 1577826000,
25 sizes: []
26 }
27});
\No newline at end of file