mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-18 03:59:38 +00:00
29
src/parser/classes/SimpleCardContent.ts
Normal file
29
src/parser/classes/SimpleCardContent.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import Text from './misc/Text';
|
||||
import Thumbnail from './misc/Thumbnail';
|
||||
import NavigationEndpoint from './NavigationEndpoint';
|
||||
|
||||
import { YTNode } from '../helpers';
|
||||
|
||||
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: any) {
|
||||
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 = data.callToAction;
|
||||
this.endpoint = new NavigationEndpoint(data.command);
|
||||
}
|
||||
}
|
||||
|
||||
export default SimpleCardContent;
|
||||
@@ -185,6 +185,7 @@ import { default as SecondarySearchContainer } from './classes/SecondarySearchCo
|
||||
import { default as SectionList } from './classes/SectionList';
|
||||
import { default as Shelf } from './classes/Shelf';
|
||||
import { default as ShowingResultsFor } from './classes/ShowingResultsFor';
|
||||
import { default as SimpleCardContent } from './classes/SimpleCardContent';
|
||||
import { default as SimpleCardTeaser } from './classes/SimpleCardTeaser';
|
||||
import { default as SingleActionEmergencySupport } from './classes/SingleActionEmergencySupport';
|
||||
import { default as SingleColumnBrowseResults } from './classes/SingleColumnBrowseResults';
|
||||
@@ -416,6 +417,7 @@ const map: Record<string, YTNodeConstructor> = {
|
||||
SectionList,
|
||||
Shelf,
|
||||
ShowingResultsFor,
|
||||
SimpleCardContent,
|
||||
SimpleCardTeaser,
|
||||
SingleActionEmergencySupport,
|
||||
SingleColumnBrowseResults,
|
||||
|
||||
Reference in New Issue
Block a user