Files
YouTube.js/src/parser/classes/ButtonView.ts
Luan 15f3b5fdba fix(ButtonView): Rename type property to button_type
It was overriding the static property "type".
2024-06-05 16:00:16 -03:00

28 lines
779 B
TypeScript

import { YTNode } from '../helpers.js';
import type { RawNode } from '../index.js';
import NavigationEndpoint from './NavigationEndpoint.js';
export default class ButtonView extends YTNode {
static type = 'ButtonView';
icon_name: string;
title: string;
accessibility_text: string;
style: string;
is_full_width: boolean;
button_type: string;
button_size: string;
on_tap: NavigationEndpoint;
constructor(data: RawNode) {
super();
this.icon_name = data.iconName;
this.title = data.title;
this.accessibility_text = data.accessibilityText;
this.style = data.style;
this.is_full_width = data.isFullWidth;
this.button_type = data.type;
this.button_size = data.buttonSize;
this.on_tap = new NavigationEndpoint(data.onTap);
}
}