diff --git a/src/parser/classes/CompactLink.ts b/src/parser/classes/CompactLink.ts index e52a91fe..5219dab8 100644 --- a/src/parser/classes/CompactLink.ts +++ b/src/parser/classes/CompactLink.ts @@ -6,14 +6,27 @@ import type { RawNode } from '../index.js'; export default class CompactLink extends YTNode { static type = 'CompactLink'; - title: string; - endpoint: NavigationEndpoint; - style: string; + public title: string; + public subtitle?: Text; + public endpoint: NavigationEndpoint; + public style: string; + public icon_type?: string; + public secondary_icon_type?: string; constructor(data: RawNode) { super(); this.title = new Text(data.title).toString(); - this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + + if ('subtitle' in data) + this.subtitle = new Text(data.subtitle); + + if ('icon' in data && 'iconType' in data.icon) + this.icon_type = data.icon.iconType; + + if ('secondaryIcon' in data && 'iconType' in data.secondaryIcon) + this.secondary_icon_type = data.secondaryIcon.iconType; + + this.endpoint = new NavigationEndpoint(data.navigationEndpoint || data.serviceEndpoint); this.style = data.style; } } \ No newline at end of file