@duell10111/youtubei.js
Version:
A JavaScript client for YouTube's private API, known as InnerTube.
21 lines • 970 B
JavaScript
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';
class Tile extends YTNode {
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;
}
}
Tile.type = 'Tile';
export default Tile;
//# sourceMappingURL=Tile.js.map