feat: bring back Video#is_live and add ExpandableMetadata (#256)

* bring back `Video#is_live`

* add ExpandableMetadata
This commit is contained in:
LuanRT
2022-12-15 19:01:42 -03:00
committed by GitHub
parent 883a023624
commit e37f42f41b
8 changed files with 127 additions and 20 deletions

View File

@@ -6,17 +6,21 @@ import { YTNode } from '../helpers';
class Button extends YTNode {
static type = 'Button';
text: string;
text?: string;
label;
tooltip;
icon_type;
label?: string;
tooltip?: string;
icon_type?: string;
is_disabled?: boolean;
endpoint: NavigationEndpoint;
constructor(data: any) {
super();
this.text = new Text(data.text).toString();
if (data.text) {
this.text = new Text(data.text).toString();
}
if (data.accessibility?.label) {
this.label = data.accessibility?.label;
@@ -30,6 +34,10 @@ class Button extends YTNode {
this.icon_type = data.icon?.iconType;
}
if (Reflect.has(data, 'isDisabled')) {
this.is_disabled = data.isDisabled;
}
this.endpoint = new NavigationEndpoint(data.navigationEndpoint || data.serviceEndpoint || data.command);
}
}