mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-18 20:12:12 +00:00
feat(parser): Add ButtonCardView (#834)
This commit is contained in:
18
src/parser/classes/ButtonCardView.ts
Normal file
18
src/parser/classes/ButtonCardView.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import NavigationEndpoint from './NavigationEndpoint.js';
|
||||
import { YTNode } from '../helpers.js';
|
||||
import type { RawNode } from '../index.js';
|
||||
|
||||
export default class ButtonCardView extends YTNode {
|
||||
static type = 'ButtonCardView';
|
||||
|
||||
title: string;
|
||||
icon_name: string;
|
||||
on_tap_endpoint: NavigationEndpoint;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.title = data.title;
|
||||
this.icon_name = data.icon.sources[0].clientResource.imageName;
|
||||
this.on_tap_endpoint = new NavigationEndpoint(data.rendererContext.commandContext.onTap);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user