Files
YouTube.js/src/parser/classes/comments/AuthorCommentBadge.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

31 lines
605 B
TypeScript

import { YTNode } from '../../helpers';
class AuthorCommentBadge extends YTNode {
static type = 'AuthorCommentBadge';
#data;
icon_type: string | null;
tooltip: string;
style?: string;
constructor(data: any) {
super();
this.icon_type = data.icon?.iconType || null;
this.tooltip = data.iconTooltip;
// *** For consistency
this.tooltip === 'Verified' &&
(this.style = 'BADGE_STYLE_TYPE_VERIFIED') &&
(data.style = 'BADGE_STYLE_TYPE_VERIFIED');
this.#data = data;
}
get orig_badge() {
return this.#data;
}
}
export default AuthorCommentBadge;