UNPKG

@duell10111/youtubei.js

Version:

A JavaScript client for YouTube's private API, known as InnerTube.

28 lines 1.12 kB
import { YTNode } from '../helpers.js'; import { Parser } from '../index.js'; import NavigationEndpoint from './NavigationEndpoint.js'; import TileMetadata from './TileMetadata.js'; import TileHeader from './TileHeader.js'; export default class Tile extends YTNode { static type = 'Tile'; style; header; on_select_endpoint; content_id; content_type; on_long_press_endpoint; metadata; on_focus_endpoint; constructor(data) { super(); this.style = data.style; this.header = Parser.parseItem(data.header, TileHeader); this.on_select_endpoint = new NavigationEndpoint(data.onSelectCommand); this.content_id = data.contentId; this.content_type = data.contentType; this.on_long_press_endpoint = new NavigationEndpoint(data.onLongPressCommand); this.metadata = Reflect.has(data, 'metadata') ? Parser.parseItem(data.metadata, TileMetadata) : undefined; this.on_focus_endpoint = Reflect.has(data, 'onFocusCommand') ? new NavigationEndpoint(data.onFocusCommand) : undefined; } } //# sourceMappingURL=Tile.js.map