Files
YouTube.js/src/parser/classes/MetadataBadge.ts
LuanRT e37f42f41b feat: bring back Video#is_live and add ExpandableMetadata (#256)
* bring back `Video#is_live`

* add ExpandableMetadata
2022-12-15 19:01:42 -03:00

32 lines
566 B
TypeScript

import { YTNode } from '../helpers';
class MetadataBadge extends YTNode {
static type = 'MetadataBadge';
icon_type?: string;
style?: string;
label?: string;
tooltip?: string;
constructor(data: any) {
super();
if (data?.icon) {
this.icon_type = data.icon.iconType;
}
if (data?.style) {
this.style = data.style;
}
if (data?.label) {
this.style = data.label;
}
if (data?.tooltip || data?.iconTooltip) {
this.tooltip = data.tooltip || data.iconTooltip;
}
}
}
export default MetadataBadge;