mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-17 19:42:14 +00:00
* tests: improve coverage * refactor: clean up nodes * chore: lint * feat(parser): ignore `BrandVideoShelf` Seems to be used for ads. * feat(parser): ignore `BrandVideoSingleton` too
26 lines
817 B
TypeScript
26 lines
817 B
TypeScript
import { YTNode } from '../helpers.js';
|
|
import type { RawNode } from '../index.js';
|
|
import NavigationEndpoint from './NavigationEndpoint.js';
|
|
import Text from './misc/Text.js';
|
|
import Thumbnail from './misc/Thumbnail.js';
|
|
|
|
export default class SimpleCardContent extends YTNode {
|
|
static type = 'SimpleCardContent';
|
|
|
|
image: Thumbnail[];
|
|
title: Text;
|
|
display_domain: Text;
|
|
show_link_icon: boolean;
|
|
call_to_action: Text;
|
|
endpoint: NavigationEndpoint;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
this.image = Thumbnail.fromResponse(data.image);
|
|
this.title = new Text(data.title);
|
|
this.display_domain = new Text(data.displayDomain);
|
|
this.show_link_icon = data.showLinkIcon;
|
|
this.call_to_action = new Text(data.callToAction);
|
|
this.endpoint = new NavigationEndpoint(data.command);
|
|
}
|
|
} |