Files
YouTube.js/src/parser/classes/MetadataBadge.ts
LuanRT 34281e2445 refactor: migrate parsers to TS (#133)
* dev: finish top-level parsers TS migration

* dev: migrate menu renderers to TS

* chore: fix ts errors

* dev: finish ts migration 🎉
2022-08-20 03:18:17 -03:00

25 lines
449 B
TypeScript

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